diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/README.md b/sdk/webpubsub/azure-resourcemanager-webpubsub/README.md index 379887e16911..8cc01dce4f97 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/README.md +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/README.md @@ -2,7 +2,7 @@ Azure Resource Manager WebPubSub client library for Java. -This package contains Microsoft Azure SDK for WebPubSub Management SDK. REST API for Azure WebPubSub Service. Package tag package-2024-03-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for WebPubSub Management SDK. REST API for Azure WebPubSub Service. Package api-version 2025-12-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ WebPubSubManager manager = WebPubSubManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -108,5 +108,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/SAMPLE.md b/sdk/webpubsub/azure-resourcemanager-webpubsub/SAMPLE.md index 02d42125ded2..4f4079c5b09d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/SAMPLE.md +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/SAMPLE.md @@ -45,6 +45,13 @@ - [Get](#webpubsubhubs_get) - [List](#webpubsubhubs_list) +## WebPubSubPersistentStorages + +- [CreateOrUpdate](#webpubsubpersistentstorages_createorupdate) +- [Delete](#webpubsubpersistentstorages_delete) +- [Get](#webpubsubpersistentstorages_get) +- [List](#webpubsubpersistentstorages_list) + ## WebPubSubPrivateEndpointConnections - [Delete](#webpubsubprivateendpointconnections_delete) @@ -85,8 +92,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/Operations_List.json + * x-ms-original-file: 2025-12-01-preview/Operations_List.json */ /** * Sample code: Operations_List. @@ -107,8 +113,7 @@ public final class OperationsListSamples { */ public final class UsagesListSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/Usages_List.json + * x-ms-original-file: 2025-12-01-preview/Usages_List.json */ /** * Sample code: Usages_List. @@ -131,8 +136,7 @@ import com.azure.resourcemanager.webpubsub.models.NameAvailabilityParameters; */ public final class WebPubSubCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_CheckNameAvailability.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_CheckNameAvailability.json */ /** * Sample code: WebPubSub_CheckNameAvailability. @@ -175,8 +179,7 @@ import java.util.Map; */ public final class WebPubSubCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_CreateOrUpdate.json */ /** * Sample code: WebPubSub_CreateOrUpdate. @@ -230,9 +233,7 @@ public final class WebPubSubCreateOrUpdateSamples { */ public final class WebPubSubDeleteSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_Delete. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_Delete.json */ /** * Sample code: WebPubSub_Delete. @@ -253,8 +254,7 @@ public final class WebPubSubDeleteSamples { */ public final class WebPubSubGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_Get.json */ /** * Sample code: WebPubSub_Get. @@ -276,8 +276,7 @@ public final class WebPubSubGetByResourceGroupSamples { */ public final class WebPubSubListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_ListBySubscription.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListBySubscription.json */ /** * Sample code: WebPubSub_ListBySubscription. @@ -298,8 +297,7 @@ public final class WebPubSubListSamples { */ public final class WebPubSubListByResourceGroupSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_ListByResourceGroup.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListByResourceGroup.json */ /** * Sample code: WebPubSub_ListByResourceGroup. @@ -320,9 +318,7 @@ public final class WebPubSubListByResourceGroupSamples { */ public final class WebPubSubListKeysSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_ListKeys. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListKeys.json */ /** * Sample code: WebPubSub_ListKeys. @@ -344,8 +340,7 @@ public final class WebPubSubListKeysSamples { */ public final class WebPubSubListReplicaSkusSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_ListReplicaSkus.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListReplicaSkus.json */ /** * Sample code: WebPubSub_ListReplicaSkus. @@ -368,9 +363,7 @@ public final class WebPubSubListReplicaSkusSamples { */ public final class WebPubSubListSkusSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_ListSkus. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListSkus.json */ /** * Sample code: WebPubSub_ListSkus. @@ -395,8 +388,7 @@ import com.azure.resourcemanager.webpubsub.models.RegenerateKeyParameters; */ public final class WebPubSubRegenerateKeySamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_RegenerateKey.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_RegenerateKey.json */ /** * Sample code: WebPubSub_RegenerateKey. @@ -419,9 +411,7 @@ public final class WebPubSubRegenerateKeySamples { */ public final class WebPubSubRestartSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_Restart. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_Restart.json */ /** * Sample code: WebPubSub_Restart. @@ -460,9 +450,7 @@ import java.util.Map; */ public final class WebPubSubUpdateSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_Update. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_Update.json */ /** * Sample code: WebPubSub_Update. @@ -515,8 +503,7 @@ public final class WebPubSubUpdateSamples { */ public final class WebPubSubCustomCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomCertificates_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomCertificates_CreateOrUpdate.json */ /** * Sample code: WebPubSubCustomCertificates_CreateOrUpdate. @@ -544,8 +531,7 @@ public final class WebPubSubCustomCertificatesCreateOrUpdateSamples { */ public final class WebPubSubCustomCertificatesDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomCertificates_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomCertificates_Delete.json */ /** * Sample code: WebPubSubCustomCertificates_Delete. @@ -567,8 +553,7 @@ public final class WebPubSubCustomCertificatesDeleteSamples { */ public final class WebPubSubCustomCertificatesGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomCertificates_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomCertificates_Get.json */ /** * Sample code: WebPubSubCustomCertificates_Get. @@ -590,8 +575,7 @@ public final class WebPubSubCustomCertificatesGetSamples { */ public final class WebPubSubCustomCertificatesListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomCertificates_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomCertificates_List.json */ /** * Sample code: WebPubSubCustomCertificates_List. @@ -615,8 +599,7 @@ import com.azure.resourcemanager.webpubsub.models.ResourceReference; */ public final class WebPubSubCustomDomainsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomDomains_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomDomains_CreateOrUpdate.json */ /** * Sample code: WebPubSubCustomDomains_CreateOrUpdate. @@ -644,8 +627,7 @@ public final class WebPubSubCustomDomainsCreateOrUpdateSamples { */ public final class WebPubSubCustomDomainsDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomDomains_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomDomains_Delete.json */ /** * Sample code: WebPubSubCustomDomains_Delete. @@ -667,8 +649,7 @@ public final class WebPubSubCustomDomainsDeleteSamples { */ public final class WebPubSubCustomDomainsGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomDomains_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomDomains_Get.json */ /** * Sample code: WebPubSubCustomDomains_Get. @@ -690,8 +671,7 @@ public final class WebPubSubCustomDomainsGetSamples { */ public final class WebPubSubCustomDomainsListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomDomains_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomDomains_List.json */ /** * Sample code: WebPubSubCustomDomains_List. @@ -708,11 +688,15 @@ public final class WebPubSubCustomDomainsListSamples { ### WebPubSubHubs_CreateOrUpdate ```java +import com.azure.resourcemanager.webpubsub.models.ChatSettings; import com.azure.resourcemanager.webpubsub.models.EventHandler; import com.azure.resourcemanager.webpubsub.models.EventHubEndpoint; import com.azure.resourcemanager.webpubsub.models.EventListener; import com.azure.resourcemanager.webpubsub.models.EventNameFilter; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventFilters; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; import com.azure.resourcemanager.webpubsub.models.ManagedIdentitySettings; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthSettings; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthType; import com.azure.resourcemanager.webpubsub.models.WebPubSubHubProperties; @@ -723,8 +707,7 @@ import java.util.Arrays; */ public final class WebPubSubHubsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubHubs_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubHubs_CreateOrUpdate.json */ /** * Sample code: WebPubSubHubs_CreateOrUpdate. @@ -740,14 +723,20 @@ public final class WebPubSubHubsCreateOrUpdateSamples { .withUserEventPattern("*") .withSystemEvents(Arrays.asList("connect", "connected")) .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.MANAGED_IDENTITY) - .withManagedIdentity(new ManagedIdentitySettings().withResource("abc"))))) + .withManagedIdentity(new ManagedIdentitySettings().withResource("abc"))) + .withGroupPresenceEvents(new GroupPresenceEventFilters() + .withEventNames(Arrays.asList(GroupPresenceEventName.JOINED, GroupPresenceEventName.LEFT)) + .withGroupFilters(Arrays.asList("chat*"))))) .withEventListeners(Arrays.asList(new EventListener() .withFilter(new EventNameFilter().withSystemEvents(Arrays.asList("connected", "disconnected")) .withUserEventPattern("*")) .withEndpoint(new EventHubEndpoint().withFullyQualifiedNamespace("example.servicebus.windows.net") .withEventHubName("eventHubName1")))) .withAnonymousConnectPolicy("allow") - .withWebSocketKeepAliveIntervalInSeconds(50)) + .withWebSocketKeepAliveIntervalInSeconds(50) + .withChat(new ChatSettings().withMode("Enabled") + .withPersistentStorage(new ResourceReference().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/persistentStorages/myStor")))) .create(); } } @@ -761,9 +750,7 @@ public final class WebPubSubHubsCreateOrUpdateSamples { */ public final class WebPubSubHubsDeleteSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSubHubs_Delete - * .json + * x-ms-original-file: 2025-12-01-preview/WebPubSubHubs_Delete.json */ /** * Sample code: WebPubSubHubs_Delete. @@ -772,7 +759,7 @@ public final class WebPubSubHubsDeleteSamples { */ public static void webPubSubHubsDelete(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubHubs() - .delete("exampleHub", "myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + .delete("myResourceGroup", "myWebPubSubService", "exampleHub", com.azure.core.util.Context.NONE); } } ``` @@ -785,9 +772,7 @@ public final class WebPubSubHubsDeleteSamples { */ public final class WebPubSubHubsGetSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSubHubs_Get. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSubHubs_Get.json */ /** * Sample code: WebPubSubHubs_Get. @@ -796,7 +781,7 @@ public final class WebPubSubHubsGetSamples { */ public static void webPubSubHubsGet(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubHubs() - .getWithResponse("exampleHub", "myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + .getWithResponse("myResourceGroup", "myWebPubSubService", "exampleHub", com.azure.core.util.Context.NONE); } } ``` @@ -809,9 +794,7 @@ public final class WebPubSubHubsGetSamples { */ public final class WebPubSubHubsListSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSubHubs_List. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSubHubs_List.json */ /** * Sample code: WebPubSubHubs_List. @@ -824,6 +807,101 @@ public final class WebPubSubHubsListSamples { } ``` +### WebPubSubPersistentStorages_CreateOrUpdate + +```java +import com.azure.resourcemanager.webpubsub.models.ResourceReference; + +/** + * Samples for WebPubSubPersistentStorages CreateOrUpdate. + */ +public final class WebPubSubPersistentStoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-12-01-preview/WebPubSubPersistentStorages_CreateOrUpdate.json + */ + /** + * Sample code: WebPubSubPersistentStorages_CreateOrUpdate. + * + * @param manager Entry point to WebPubSubManager. + */ + public static void + webPubSubPersistentStoragesCreateOrUpdate(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { + manager.webPubSubPersistentStorages() + .define("myStor") + .withExistingWebPubSub("myResourceGroup", "myWebPubSubService") + .withStorageAccount(new ResourceReference().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")) + .create(); + } +} +``` + +### WebPubSubPersistentStorages_Delete + +```java +/** + * Samples for WebPubSubPersistentStorages Delete. + */ +public final class WebPubSubPersistentStoragesDeleteSamples { + /* + * x-ms-original-file: 2025-12-01-preview/WebPubSubPersistentStorages_Delete.json + */ + /** + * Sample code: WebPubSubPersistentStorages_Delete. + * + * @param manager Entry point to WebPubSubManager. + */ + public static void webPubSubPersistentStoragesDelete(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { + manager.webPubSubPersistentStorages() + .delete("myResourceGroup", "myWebPubSubService", "example", com.azure.core.util.Context.NONE); + } +} +``` + +### WebPubSubPersistentStorages_Get + +```java +/** + * Samples for WebPubSubPersistentStorages Get. + */ +public final class WebPubSubPersistentStoragesGetSamples { + /* + * x-ms-original-file: 2025-12-01-preview/WebPubSubPersistentStorages_Get.json + */ + /** + * Sample code: WebPubSubPersistentStorages_Get. + * + * @param manager Entry point to WebPubSubManager. + */ + public static void webPubSubPersistentStoragesGet(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { + manager.webPubSubPersistentStorages() + .getWithResponse("myResourceGroup", "myWebPubSubService", "example", com.azure.core.util.Context.NONE); + } +} +``` + +### WebPubSubPersistentStorages_List + +```java +/** + * Samples for WebPubSubPersistentStorages List. + */ +public final class WebPubSubPersistentStoragesListSamples { + /* + * x-ms-original-file: 2025-12-01-preview/WebPubSubPersistentStorages_List.json + */ + /** + * Sample code: WebPubSubPersistentStorages_List. + * + * @param manager Entry point to WebPubSubManager. + */ + public static void webPubSubPersistentStoragesList(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { + manager.webPubSubPersistentStorages() + .list("myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + } +} +``` + ### WebPubSubPrivateEndpointConnections_Delete ```java @@ -832,8 +910,7 @@ public final class WebPubSubHubsListSamples { */ public final class WebPubSubPrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateEndpointConnections_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateEndpointConnections_Delete.json */ /** * Sample code: WebPubSubPrivateEndpointConnections_Delete. @@ -843,7 +920,7 @@ public final class WebPubSubPrivateEndpointConnectionsDeleteSamples { public static void webPubSubPrivateEndpointConnectionsDelete(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubPrivateEndpointConnections() - .delete("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "myWebPubSubService", + .delete("myResourceGroup", "myWebPubSubService", "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); } } @@ -857,8 +934,7 @@ public final class WebPubSubPrivateEndpointConnectionsDeleteSamples { */ public final class WebPubSubPrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateEndpointConnections_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateEndpointConnections_Get.json */ /** * Sample code: WebPubSubPrivateEndpointConnections_Get. @@ -868,8 +944,8 @@ public final class WebPubSubPrivateEndpointConnectionsGetSamples { public static void webPubSubPrivateEndpointConnectionsGet(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubPrivateEndpointConnections() - .getWithResponse("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", - "myWebPubSubService", com.azure.core.util.Context.NONE); + .getWithResponse("myResourceGroup", "myWebPubSubService", + "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); } } ``` @@ -882,8 +958,7 @@ public final class WebPubSubPrivateEndpointConnectionsGetSamples { */ public final class WebPubSubPrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateEndpointConnections_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateEndpointConnections_List.json */ /** * Sample code: WebPubSubPrivateEndpointConnections_List. @@ -911,8 +986,7 @@ import com.azure.resourcemanager.webpubsub.models.PrivateLinkServiceConnectionSt */ public final class WebPubSubPrivateEndpointConnectionsUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateEndpointConnections_Update.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateEndpointConnections_Update.json */ /** * Sample code: WebPubSubPrivateEndpointConnections_Update. @@ -922,8 +996,8 @@ public final class WebPubSubPrivateEndpointConnectionsUpdateSamples { public static void webPubSubPrivateEndpointConnectionsUpdate(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubPrivateEndpointConnections() - .updateWithResponse("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", - "myWebPubSubService", + .updateWithResponse("myResourceGroup", "myWebPubSubService", + "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) @@ -941,8 +1015,7 @@ public final class WebPubSubPrivateEndpointConnectionsUpdateSamples { */ public final class WebPubSubPrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateLinkResources_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateLinkResources_List.json */ /** * Sample code: WebPubSubPrivateLinkResources_List. @@ -966,8 +1039,7 @@ import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResour */ public final class WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicaSharedPrivateLinkResources_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicaSharedPrivateLinkResources_CreateOrUpdate.json */ /** * Sample code: WebPubSubReplicaSharedPrivateLinkResources_CreateOrUpdate. @@ -995,8 +1067,7 @@ public final class WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateSampl */ public final class WebPubSubReplicaSharedPrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicaSharedPrivateLinkResources_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicaSharedPrivateLinkResources_Get.json */ /** * Sample code: WebPubSubReplicaSharedPrivateLinkResources_Get. @@ -1020,8 +1091,7 @@ public final class WebPubSubReplicaSharedPrivateLinkResourcesGetSamples { */ public final class WebPubSubReplicaSharedPrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicaSharedPrivateLinkResources_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicaSharedPrivateLinkResources_List.json */ /** * Sample code: WebPubSubReplicaSharedPrivateLinkResources_List. @@ -1050,8 +1120,7 @@ import java.util.Map; */ public final class WebPubSubReplicasCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_CreateOrUpdate.json */ /** * Sample code: WebPubSubReplicas_CreateOrUpdate. @@ -1091,8 +1160,7 @@ public final class WebPubSubReplicasCreateOrUpdateSamples { */ public final class WebPubSubReplicasDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_Delete.json */ /** * Sample code: WebPubSubReplicas_Delete. @@ -1115,8 +1183,7 @@ public final class WebPubSubReplicasDeleteSamples { */ public final class WebPubSubReplicasGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_Get.json */ /** * Sample code: WebPubSubReplicas_Get. @@ -1139,8 +1206,7 @@ public final class WebPubSubReplicasGetSamples { */ public final class WebPubSubReplicasListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_List.json */ /** * Sample code: WebPubSubReplicas_List. @@ -1161,8 +1227,7 @@ public final class WebPubSubReplicasListSamples { */ public final class WebPubSubReplicasRestartSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_Restart.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_Restart.json */ /** * Sample code: WebPubSubReplicas_Restart. @@ -1191,8 +1256,7 @@ import java.util.Map; */ public final class WebPubSubReplicasUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_Update.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_Update.json */ /** * Sample code: WebPubSubReplicas_Update. @@ -1233,8 +1297,7 @@ public final class WebPubSubReplicasUpdateSamples { */ public final class WebPubSubSharedPrivateLinkResourcesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubSharedPrivateLinkResources_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubSharedPrivateLinkResources_CreateOrUpdate.json */ /** * Sample code: WebPubSubSharedPrivateLinkResources_CreateOrUpdate. @@ -1263,8 +1326,7 @@ public final class WebPubSubSharedPrivateLinkResourcesCreateOrUpdateSamples { */ public final class WebPubSubSharedPrivateLinkResourcesDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubSharedPrivateLinkResources_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubSharedPrivateLinkResources_Delete.json */ /** * Sample code: WebPubSubSharedPrivateLinkResources_Delete. @@ -1274,7 +1336,7 @@ public final class WebPubSubSharedPrivateLinkResourcesDeleteSamples { public static void webPubSubSharedPrivateLinkResourcesDelete(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubSharedPrivateLinkResources() - .delete("upstream", "myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + .delete("myResourceGroup", "myWebPubSubService", "upstream", com.azure.core.util.Context.NONE); } } ``` @@ -1287,8 +1349,7 @@ public final class WebPubSubSharedPrivateLinkResourcesDeleteSamples { */ public final class WebPubSubSharedPrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubSharedPrivateLinkResources_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubSharedPrivateLinkResources_Get.json */ /** * Sample code: WebPubSubSharedPrivateLinkResources_Get. @@ -1298,7 +1359,7 @@ public final class WebPubSubSharedPrivateLinkResourcesGetSamples { public static void webPubSubSharedPrivateLinkResourcesGet(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubSharedPrivateLinkResources() - .getWithResponse("upstream", "myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + .getWithResponse("myResourceGroup", "myWebPubSubService", "upstream", com.azure.core.util.Context.NONE); } } ``` @@ -1311,8 +1372,7 @@ public final class WebPubSubSharedPrivateLinkResourcesGetSamples { */ public final class WebPubSubSharedPrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubSharedPrivateLinkResources_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubSharedPrivateLinkResources_List.json */ /** * Sample code: WebPubSubSharedPrivateLinkResources_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml b/sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml index 18295d509150..83ed07df4587 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for WebPubSub Management - This package contains Microsoft Azure SDK for WebPubSub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for Azure WebPubSub Service. Package tag package-2024-03-01. + This package contains Microsoft Azure SDK for WebPubSub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for Azure WebPubSub Service. Package api-version 2025-12-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,13 +45,9 @@ UTF-8 0 0 + true - - com.azure - azure-json - 1.5.1 - com.azure azure-core @@ -74,6 +70,11 @@ 1.18.4 test + + com.azure + azure-json + 1.5.1 + com.azure.resourcemanager azure-resourcemanager-resources diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java index b7fb588ec429..be64903d776e 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub; @@ -11,17 +11,18 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubManagementClient; import com.azure.resourcemanager.webpubsub.implementation.OperationsImpl; @@ -30,6 +31,7 @@ import com.azure.resourcemanager.webpubsub.implementation.WebPubSubCustomDomainsImpl; import com.azure.resourcemanager.webpubsub.implementation.WebPubSubHubsImpl; import com.azure.resourcemanager.webpubsub.implementation.WebPubSubManagementClientBuilder; +import com.azure.resourcemanager.webpubsub.implementation.WebPubSubPersistentStoragesImpl; import com.azure.resourcemanager.webpubsub.implementation.WebPubSubPrivateEndpointConnectionsImpl; import com.azure.resourcemanager.webpubsub.implementation.WebPubSubPrivateLinkResourcesImpl; import com.azure.resourcemanager.webpubsub.implementation.WebPubSubReplicaSharedPrivateLinkResourcesImpl; @@ -41,16 +43,18 @@ import com.azure.resourcemanager.webpubsub.models.WebPubSubCustomCertificates; import com.azure.resourcemanager.webpubsub.models.WebPubSubCustomDomains; import com.azure.resourcemanager.webpubsub.models.WebPubSubHubs; +import com.azure.resourcemanager.webpubsub.models.WebPubSubPersistentStorages; import com.azure.resourcemanager.webpubsub.models.WebPubSubPrivateEndpointConnections; import com.azure.resourcemanager.webpubsub.models.WebPubSubPrivateLinkResources; -import com.azure.resourcemanager.webpubsub.models.WebPubSubReplicas; import com.azure.resourcemanager.webpubsub.models.WebPubSubReplicaSharedPrivateLinkResources; -import com.azure.resourcemanager.webpubsub.models.WebPubSubs; +import com.azure.resourcemanager.webpubsub.models.WebPubSubReplicas; import com.azure.resourcemanager.webpubsub.models.WebPubSubSharedPrivateLinkResources; +import com.azure.resourcemanager.webpubsub.models.WebPubSubs; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -61,25 +65,27 @@ public final class WebPubSubManager { private Operations operations; + private WebPubSubHubs webPubSubHubs; + + private WebPubSubSharedPrivateLinkResources webPubSubSharedPrivateLinkResources; + private WebPubSubs webPubSubs; - private Usages usages; + private WebPubSubPrivateLinkResources webPubSubPrivateLinkResources; private WebPubSubCustomCertificates webPubSubCustomCertificates; private WebPubSubCustomDomains webPubSubCustomDomains; - private WebPubSubHubs webPubSubHubs; - private WebPubSubPrivateEndpointConnections webPubSubPrivateEndpointConnections; - private WebPubSubPrivateLinkResources webPubSubPrivateLinkResources; - private WebPubSubReplicas webPubSubReplicas; private WebPubSubReplicaSharedPrivateLinkResources webPubSubReplicaSharedPrivateLinkResources; - private WebPubSubSharedPrivateLinkResources webPubSubSharedPrivateLinkResources; + private WebPubSubPersistentStorages webPubSubPersistentStorages; + + private Usages usages; private final WebPubSubManagementClient clientObject; @@ -133,6 +139,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-webpubsub.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -240,12 +249,14 @@ public WebPubSubManager authenticate(TokenCredential credential, AzureProfile pr Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.webpubsub") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -278,7 +289,7 @@ public WebPubSubManager authenticate(TokenCredential credential, AzureProfile pr 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, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); @@ -303,6 +314,31 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of WebPubSubHubs. It manages WebPubSubHub. + * + * @return Resource collection API of WebPubSubHubs. + */ + public WebPubSubHubs webPubSubHubs() { + if (this.webPubSubHubs == null) { + this.webPubSubHubs = new WebPubSubHubsImpl(clientObject.getWebPubSubHubs(), this); + } + return webPubSubHubs; + } + + /** + * Gets the resource collection API of WebPubSubSharedPrivateLinkResources. It manages SharedPrivateLinkResource. + * + * @return Resource collection API of WebPubSubSharedPrivateLinkResources. + */ + public WebPubSubSharedPrivateLinkResources webPubSubSharedPrivateLinkResources() { + if (this.webPubSubSharedPrivateLinkResources == null) { + this.webPubSubSharedPrivateLinkResources = new WebPubSubSharedPrivateLinkResourcesImpl( + clientObject.getWebPubSubSharedPrivateLinkResources(), this); + } + return webPubSubSharedPrivateLinkResources; + } + /** * Gets the resource collection API of WebPubSubs. It manages WebPubSubResource. * @@ -316,15 +352,16 @@ public WebPubSubs webPubSubs() { } /** - * Gets the resource collection API of Usages. + * Gets the resource collection API of WebPubSubPrivateLinkResources. * - * @return Resource collection API of Usages. + * @return Resource collection API of WebPubSubPrivateLinkResources. */ - public Usages usages() { - if (this.usages == null) { - this.usages = new UsagesImpl(clientObject.getUsages(), this); + public WebPubSubPrivateLinkResources webPubSubPrivateLinkResources() { + if (this.webPubSubPrivateLinkResources == null) { + this.webPubSubPrivateLinkResources + = new WebPubSubPrivateLinkResourcesImpl(clientObject.getWebPubSubPrivateLinkResources(), this); } - return usages; + return webPubSubPrivateLinkResources; } /** @@ -353,18 +390,6 @@ public WebPubSubCustomDomains webPubSubCustomDomains() { return webPubSubCustomDomains; } - /** - * Gets the resource collection API of WebPubSubHubs. It manages WebPubSubHub. - * - * @return Resource collection API of WebPubSubHubs. - */ - public WebPubSubHubs webPubSubHubs() { - if (this.webPubSubHubs == null) { - this.webPubSubHubs = new WebPubSubHubsImpl(clientObject.getWebPubSubHubs(), this); - } - return webPubSubHubs; - } - /** * Gets the resource collection API of WebPubSubPrivateEndpointConnections. * @@ -378,19 +403,6 @@ public WebPubSubPrivateEndpointConnections webPubSubPrivateEndpointConnections() return webPubSubPrivateEndpointConnections; } - /** - * Gets the resource collection API of WebPubSubPrivateLinkResources. - * - * @return Resource collection API of WebPubSubPrivateLinkResources. - */ - public WebPubSubPrivateLinkResources webPubSubPrivateLinkResources() { - if (this.webPubSubPrivateLinkResources == null) { - this.webPubSubPrivateLinkResources - = new WebPubSubPrivateLinkResourcesImpl(clientObject.getWebPubSubPrivateLinkResources(), this); - } - return webPubSubPrivateLinkResources; - } - /** * Gets the resource collection API of WebPubSubReplicas. It manages Replica. * @@ -417,16 +429,28 @@ public WebPubSubReplicaSharedPrivateLinkResources webPubSubReplicaSharedPrivateL } /** - * Gets the resource collection API of WebPubSubSharedPrivateLinkResources. It manages SharedPrivateLinkResource. + * Gets the resource collection API of WebPubSubPersistentStorages. It manages PersistentStorage. * - * @return Resource collection API of WebPubSubSharedPrivateLinkResources. + * @return Resource collection API of WebPubSubPersistentStorages. */ - public WebPubSubSharedPrivateLinkResources webPubSubSharedPrivateLinkResources() { - if (this.webPubSubSharedPrivateLinkResources == null) { - this.webPubSubSharedPrivateLinkResources = new WebPubSubSharedPrivateLinkResourcesImpl( - clientObject.getWebPubSubSharedPrivateLinkResources(), this); + public WebPubSubPersistentStorages webPubSubPersistentStorages() { + if (this.webPubSubPersistentStorages == null) { + this.webPubSubPersistentStorages + = new WebPubSubPersistentStoragesImpl(clientObject.getWebPubSubPersistentStorages(), this); } - return webPubSubSharedPrivateLinkResources; + return webPubSubPersistentStorages; + } + + /** + * Gets the resource collection API of Usages. + * + * @return Resource collection API of Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; } /** diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/OperationsClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/OperationsClient.java index 4e37ffd7b1ef..799b98d6c8de 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/OperationsClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -15,23 +15,23 @@ */ public interface OperationsClient { /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/UsagesClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/UsagesClient.java index c3617e9dbffe..aa25996d4fb8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/UsagesClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/UsagesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -17,7 +17,7 @@ public interface UsagesClient { /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -30,7 +30,7 @@ public interface UsagesClient { /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomCertificatesClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomCertificatesClient.java index 2df0c8e52173..2e6d51a364da 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomCertificatesClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomCertificatesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -17,33 +17,6 @@ * An instance of this class provides access to all the operations defined in WebPubSubCustomCertificatesClient. */ public interface WebPubSubCustomCertificatesClient { - /** - * List all custom certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom certificates list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * List all custom certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom certificates list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - /** * Get a custom certificate. * @@ -168,4 +141,31 @@ Response deleteWithResponse(String resourceGroupName, String resourceName, */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String resourceName, String certificateName); + + /** + * List all custom certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom certificates list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List all custom certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom certificates list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomDomainsClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomDomainsClient.java index 355e577fcfc2..5a673ad0eb38 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomDomainsClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomDomainsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -17,33 +17,6 @@ * An instance of this class provides access to all the operations defined in WebPubSubCustomDomainsClient. */ public interface WebPubSubCustomDomainsClient { - /** - * List all custom domains. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domains list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * List all custom domains. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domains list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - /** * Get a custom domain. * @@ -196,4 +169,31 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String resourceName, String name, Context context); + + /** + * List all custom domains. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domains list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List all custom domains. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domains list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubHubsClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubHubsClient.java index 39e7f6c3e6e5..6acc144ef701 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubHubsClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubHubsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -17,39 +17,12 @@ * An instance of this class provides access to all the operations defined in WebPubSubHubsClient. */ public interface WebPubSubHubsClient { - /** - * List hub settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hub setting list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * List hub settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hub setting list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - /** * Get a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -57,29 +30,29 @@ public interface WebPubSubHubsClient { * @return a hub setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String hubName, String resourceGroupName, String resourceName, + Response getWithResponse(String resourceGroupName, String resourceName, String hubName, Context context); /** * Get a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a hub setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - WebPubSubHubInner get(String hubName, String resourceGroupName, String resourceName); + WebPubSubHubInner get(String resourceGroupName, String resourceName, String hubName); /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -87,15 +60,15 @@ Response getWithResponse(String hubName, String resourceGroup * @return the {@link SyncPoller} for polling of a hub setting. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebPubSubHubInner> beginCreateOrUpdate(String hubName, - String resourceGroupName, String resourceName, WebPubSubHubInner parameters); + SyncPoller, WebPubSubHubInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String hubName, WebPubSubHubInner parameters); /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -104,15 +77,15 @@ SyncPoller, WebPubSubHubInner> beginCreateOrUpdate * @return the {@link SyncPoller} for polling of a hub setting. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebPubSubHubInner> beginCreateOrUpdate(String hubName, - String resourceGroupName, String resourceName, WebPubSubHubInner parameters, Context context); + SyncPoller, WebPubSubHubInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String hubName, WebPubSubHubInner parameters, Context context); /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -120,15 +93,15 @@ SyncPoller, WebPubSubHubInner> beginCreateOrUpdate * @return a hub setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - WebPubSubHubInner createOrUpdate(String hubName, String resourceGroupName, String resourceName, + WebPubSubHubInner createOrUpdate(String resourceGroupName, String resourceName, String hubName, WebPubSubHubInner parameters); /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,29 +110,29 @@ WebPubSubHubInner createOrUpdate(String hubName, String resourceGroupName, Strin * @return a hub setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - WebPubSubHubInner createOrUpdate(String hubName, String resourceGroupName, String resourceName, + WebPubSubHubInner createOrUpdate(String resourceGroupName, String resourceName, String hubName, WebPubSubHubInner parameters, Context context); /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String hubName, String resourceGroupName, String resourceName); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String hubName); /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -167,33 +140,60 @@ WebPubSubHubInner createOrUpdate(String hubName, String resourceGroupName, Strin * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String hubName, String resourceGroupName, String resourceName, + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String hubName, Context context); /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String hubName, String resourceGroupName, String resourceName); + void delete(String resourceGroupName, String resourceName, String hubName); /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String hubName, String resourceGroupName, String resourceName, Context context); + void delete(String resourceGroupName, String resourceName, String hubName, Context context); + + /** + * List hub settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hub setting list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List hub settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hub setting list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubManagementClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubManagementClient.java index 752136bc55ac..8e7a7e74689f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubManagementClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -12,26 +12,26 @@ */ public interface WebPubSubManagementClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -53,6 +53,20 @@ public interface WebPubSubManagementClient { */ OperationsClient getOperations(); + /** + * Gets the WebPubSubHubsClient object to access its operations. + * + * @return the WebPubSubHubsClient object. + */ + WebPubSubHubsClient getWebPubSubHubs(); + + /** + * Gets the WebPubSubSharedPrivateLinkResourcesClient object to access its operations. + * + * @return the WebPubSubSharedPrivateLinkResourcesClient object. + */ + WebPubSubSharedPrivateLinkResourcesClient getWebPubSubSharedPrivateLinkResources(); + /** * Gets the WebPubSubsClient object to access its operations. * @@ -61,11 +75,11 @@ public interface WebPubSubManagementClient { WebPubSubsClient getWebPubSubs(); /** - * Gets the UsagesClient object to access its operations. + * Gets the WebPubSubPrivateLinkResourcesClient object to access its operations. * - * @return the UsagesClient object. + * @return the WebPubSubPrivateLinkResourcesClient object. */ - UsagesClient getUsages(); + WebPubSubPrivateLinkResourcesClient getWebPubSubPrivateLinkResources(); /** * Gets the WebPubSubCustomCertificatesClient object to access its operations. @@ -81,13 +95,6 @@ public interface WebPubSubManagementClient { */ WebPubSubCustomDomainsClient getWebPubSubCustomDomains(); - /** - * Gets the WebPubSubHubsClient object to access its operations. - * - * @return the WebPubSubHubsClient object. - */ - WebPubSubHubsClient getWebPubSubHubs(); - /** * Gets the WebPubSubPrivateEndpointConnectionsClient object to access its operations. * @@ -95,13 +102,6 @@ public interface WebPubSubManagementClient { */ WebPubSubPrivateEndpointConnectionsClient getWebPubSubPrivateEndpointConnections(); - /** - * Gets the WebPubSubPrivateLinkResourcesClient object to access its operations. - * - * @return the WebPubSubPrivateLinkResourcesClient object. - */ - WebPubSubPrivateLinkResourcesClient getWebPubSubPrivateLinkResources(); - /** * Gets the WebPubSubReplicasClient object to access its operations. * @@ -117,9 +117,16 @@ public interface WebPubSubManagementClient { WebPubSubReplicaSharedPrivateLinkResourcesClient getWebPubSubReplicaSharedPrivateLinkResources(); /** - * Gets the WebPubSubSharedPrivateLinkResourcesClient object to access its operations. + * Gets the WebPubSubPersistentStoragesClient object to access its operations. * - * @return the WebPubSubSharedPrivateLinkResourcesClient object. + * @return the WebPubSubPersistentStoragesClient object. */ - WebPubSubSharedPrivateLinkResourcesClient getWebPubSubSharedPrivateLinkResources(); + WebPubSubPersistentStoragesClient getWebPubSubPersistentStorages(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPersistentStoragesClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPersistentStoragesClient.java new file mode 100644 index 000000000000..8a4660dc60bf --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPersistentStoragesClient.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner; + +/** + * An instance of this class provides access to all the operations defined in WebPubSubPersistentStoragesClient. + */ +public interface WebPubSubPersistentStoragesClient { + /** + * Get a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, String name, + Context context); + + /** + * Get a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PersistentStorageInner get(String resourceGroupName, String resourceName, String name); + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a persistent storage. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PersistentStorageInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String name, PersistentStorageInner parameters); + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a persistent storage. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PersistentStorageInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String name, PersistentStorageInner parameters, Context context); + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PersistentStorageInner createOrUpdate(String resourceGroupName, String resourceName, String name, + PersistentStorageInner parameters); + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PersistentStorageInner createOrUpdate(String resourceGroupName, String resourceName, String name, + PersistentStorageInner parameters, Context context); + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String name); + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String name, + Context context); + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String name); + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String name, Context context); + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateEndpointConnectionsClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateEndpointConnectionsClient.java index a79c2825c6d8..483c1d8eeef3 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateEndpointConnectionsClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateEndpointConnectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -18,39 +18,12 @@ */ public interface WebPubSubPrivateEndpointConnectionsClient { /** - * List private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * List private endpoint connections. + * Get the specified private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - - /** - * Get the specified private endpoint connection. - * * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -58,32 +31,32 @@ public interface WebPubSubPrivateEndpointConnectionsClient { * @return the specified private endpoint connection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, Context context); + Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context); /** * Get the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get(String privateEndpointConnectionName, String resourceGroupName, - String resourceName); + PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName); /** * Update the state of specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @param parameters The resource of private endpoint and its properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -92,16 +65,16 @@ PrivateEndpointConnectionInner get(String privateEndpointConnectionName, String * @return a private endpoint connection to an azure resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, PrivateEndpointConnectionInner parameters, Context context); + Response updateWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context); /** * Update the state of specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @param parameters The resource of private endpoint and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -109,32 +82,32 @@ Response updateWithResponse(String privateEndpoi * @return a private endpoint connection to an azure resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner update(String privateEndpointConnectionName, String resourceGroupName, - String resourceName, PrivateEndpointConnectionInner parameters); + PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters); /** * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String privateEndpointConnectionName, String resourceGroupName, - String resourceName); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String privateEndpointConnectionName); /** * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -142,35 +115,62 @@ SyncPoller, Void> beginDelete(String privateEndpointConnectionN * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String privateEndpointConnectionName, String resourceGroupName, - String resourceName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context); /** * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName); + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName); /** * Delete the specified private endpoint connection. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * List private endpoint connections. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List private endpoint connections. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateLinkResourcesClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateLinkResourcesClient.java index b67445a6be32..55a53eb9b339 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateLinkResourcesClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateLinkResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicaSharedPrivateLinkResourcesClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicaSharedPrivateLinkResourcesClient.java index 47538de646f5..2b5683edfe2c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicaSharedPrivateLinkResourcesClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicaSharedPrivateLinkResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -18,37 +18,6 @@ * WebPubSubReplicaSharedPrivateLinkResourcesClient. */ public interface WebPubSubReplicaSharedPrivateLinkResourcesClient { - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, - String replicaName); - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, - String replicaName, Context context); - /** * Get the specified shared private link resource. * @@ -153,4 +122,35 @@ SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String r @ServiceMethod(returns = ReturnType.SINGLE) SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String resourceName, String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context); + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, + String replicaName); + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, + String replicaName, Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicasClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicasClient.java index 949fb97673cb..04073be06dca 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicasClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicasClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -17,33 +17,6 @@ * An instance of this class provides access to all the operations defined in WebPubSubReplicasClient. */ public interface WebPubSubReplicasClient { - /** - * List all replicas belong to this resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * List all replicas belong to this resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - /** * Get the replica and its properties. * @@ -141,33 +114,37 @@ ReplicaInner createOrUpdate(String resourceGroupName, String resourceName, Strin ReplicaInner parameters, Context context); /** - * Operation to delete a replica. + * Operation to update an exiting replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param context The context to associate with this operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link SyncPoller} for polling of a class represent a replica resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String resourceName, String replicaName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicaInner> beginUpdate(String resourceGroupName, String resourceName, + String replicaName, ReplicaInner parameters); /** - * Operation to delete a replica. + * Operation to update an exiting replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a class represent a replica resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, String replicaName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicaInner> beginUpdate(String resourceGroupName, String resourceName, + String replicaName, ReplicaInner parameters, Context context); /** * Operation to update an exiting replica. @@ -179,11 +156,10 @@ Response deleteWithResponse(String resourceGroupName, String resourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a replica resource. + * @return a class represent a replica resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReplicaInner> beginUpdate(String resourceGroupName, String resourceName, - String replicaName, ReplicaInner parameters); + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicaInner update(String resourceGroupName, String resourceName, String replicaName, ReplicaInner parameters); /** * Operation to update an exiting replica. @@ -196,43 +172,67 @@ SyncPoller, ReplicaInner> beginUpdate(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a replica resource. + * @return a class represent a replica resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ReplicaInner> beginUpdate(String resourceGroupName, String resourceName, - String replicaName, ReplicaInner parameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicaInner update(String resourceGroupName, String resourceName, String replicaName, ReplicaInner parameters, + Context context); /** - * Operation to update an exiting replica. + * Operation to delete a replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ReplicaInner update(String resourceGroupName, String resourceName, String replicaName, ReplicaInner parameters); + Response deleteWithResponse(String resourceGroupName, String resourceName, String replicaName, + Context context); /** - * Operation to update an exiting replica. + * Operation to delete a replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ReplicaInner update(String resourceGroupName, String resourceName, String replicaName, ReplicaInner parameters, - Context context); + void delete(String resourceGroupName, String resourceName, String replicaName); + + /** + * List all replicas belong to this resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Replica items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List all replicas belong to this resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Replica items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); /** * Operation to restart a replica. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubSharedPrivateLinkResourcesClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubSharedPrivateLinkResourcesClient.java index 47decd79f702..dfc56362ad65 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubSharedPrivateLinkResourcesClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubSharedPrivateLinkResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -17,39 +17,12 @@ * An instance of this class provides access to all the operations defined in WebPubSubSharedPrivateLinkResourcesClient. */ public interface WebPubSubSharedPrivateLinkResourcesClient { - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName); - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String resourceName, Context context); - /** * Get the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -57,30 +30,30 @@ public interface WebPubSubSharedPrivateLinkResourcesClient { * @return the specified shared private link resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, Context context); + Response getWithResponse(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, Context context); /** * Get the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified shared private link resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedPrivateLinkResourceInner get(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName); + SharedPrivateLinkResourceInner get(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName); /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -89,15 +62,15 @@ SharedPrivateLinkResourceInner get(String sharedPrivateLinkResourceName, String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SharedPrivateLinkResourceInner> beginCreateOrUpdate( - String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, + String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters); /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,15 +80,15 @@ SyncPoller, SharedPrivateLinkResource */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SharedPrivateLinkResourceInner> beginCreateOrUpdate( - String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, + String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context); /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -123,15 +96,15 @@ SyncPoller, SharedPrivateLinkResource * @return describes a Shared Private Link Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedPrivateLinkResourceInner createOrUpdate(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName, SharedPrivateLinkResourceInner parameters); + SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters); /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -140,30 +113,30 @@ SharedPrivateLinkResourceInner createOrUpdate(String sharedPrivateLinkResourceNa * @return describes a Shared Private Link Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedPrivateLinkResourceInner createOrUpdate(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName, SharedPrivateLinkResourceInner parameters, Context context); + SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context); /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName); /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -171,33 +144,60 @@ SyncPoller, Void> beginDelete(String sharedPrivateLinkResourceN * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, Context context); /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName); + void delete(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName); /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, Context context); + void delete(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, Context context); + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubsClient.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubsClient.java index fbc803fe2334..ab17db0f9653 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubsClient.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent; @@ -23,133 +23,116 @@ */ public interface WebPubSubsClient { /** - * Checks that the resource name is valid and is not already in use. + * Get the resource and its properties. * - * @param location the region. - * @param parameters Parameters supplied to the operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to check name availability along with {@link Response}. + * @return the resource and its properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(String location, - NameAvailabilityParameters parameters, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); /** - * Checks that the resource name is valid and is not already in use. + * Get the resource and its properties. * - * @param location the region. - * @param parameters Parameters supplied to the operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to check name availability. + * @return the resource and its properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - NameAvailabilityInner checkNameAvailability(String location, NameAvailabilityParameters parameters); - - /** - * Handles requests to list all resources in a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Handles requests to list all resources in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + WebPubSubResourceInner getByResourceGroup(String resourceGroupName, String resourceName); /** - * Handles requests to list all resources in a resource group. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update 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 object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of a class represent a resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebPubSubResourceInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, WebPubSubResourceInner parameters); /** - * Handles requests to list all resources in a resource group. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation. * @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 object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of a class represent a resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebPubSubResourceInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, WebPubSubResourceInner parameters, Context context); /** - * Get the resource and its properties. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param parameters Parameters for the create or update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties along with {@link Response}. + * @return a class represent a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context); + WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters); /** - * Get the resource and its properties. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties. + * @return a class represent a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - WebPubSubResourceInner getByResourceGroup(String resourceGroupName, String resourceName); + WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters, Context context); /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of a class represent a resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebPubSubResourceInner> beginCreateOrUpdate(String resourceGroupName, + SyncPoller, WebPubSubResourceInner> beginUpdate(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters); /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @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. @@ -157,30 +140,29 @@ SyncPoller, WebPubSubResourceInner> beginCrea * @return the {@link SyncPoller} for polling of a class represent a resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebPubSubResourceInner> beginCreateOrUpdate(String resourceGroupName, + SyncPoller, WebPubSubResourceInner> beginUpdate(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters, Context context); /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a class represent a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters); + WebPubSubResourceInner update(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters); /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @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. @@ -188,8 +170,8 @@ WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceN * @return a class represent a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters, Context context); + WebPubSubResourceInner update(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters, + Context context); /** * Operation to delete a resource. @@ -244,65 +226,55 @@ WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceN void delete(String resourceGroupName, String resourceName, Context context); /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebPubSubResourceInner> beginUpdate(String resourceGroupName, - String resourceName, WebPubSubResourceInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WebPubSubResourceInner> beginUpdate(String resourceGroupName, - String resourceName, WebPubSubResourceInner parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebPubSubResourceInner update(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - WebPubSubResourceInner update(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** * Get the access keys of the resource. @@ -393,34 +365,31 @@ WebPubSubKeysInner regenerateKey(String resourceGroupName, String resourceName, Context context); /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listReplicaSkusWithResponse(String resourceGroupName, String resourceName, - String replicaName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName); /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - SkuListInner listReplicaSkus(String resourceGroupName, String resourceName, String replicaName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName, Context context); /** * Operation to restart a resource. @@ -430,10 +399,9 @@ Response listReplicaSkusWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName); + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String resourceName); /** * Operation to restart a resource. @@ -444,41 +412,43 @@ Response listReplicaSkusWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String resourceName, Context context); /** - * Operation to restart a resource. + * List all available skus of the resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list skus operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String resourceName); + Response listSkusWithResponse(String resourceGroupName, String resourceName, Context context); /** - * Operation to restart a resource. + * List all available skus of the resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list skus operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - void restart(String resourceGroupName, String resourceName, Context context); + SkuListInner listSkus(String resourceGroupName, String resourceName); /** - * List all available skus of the resource. + * List all available skus of the replica resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param replicaName The name of the replica. * @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. @@ -486,18 +456,48 @@ Response listReplicaSkusWithResponse(String resourceGroupName, Str * @return the list skus operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listSkusWithResponse(String resourceGroupName, String resourceName, Context context); + Response listReplicaSkusWithResponse(String resourceGroupName, String resourceName, + String replicaName, Context context); /** - * List all available skus of the resource. + * List all available skus of the replica resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list skus operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - SkuListInner listSkus(String resourceGroupName, String resourceName); + SkuListInner listReplicaSkus(String resourceGroupName, String resourceName, String replicaName); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location The location name. + * @param parameters The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to check name availability along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse(String location, + NameAvailabilityParameters parameters, Context context); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location The location name. + * @param parameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NameAvailabilityInner checkNameAvailability(String location, NameAvailabilityParameters parameters); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateInner.java index 66449fc5cef9..786e98715095 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateInner.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -176,23 +175,6 @@ public CustomCertificateInner withKeyVaultSecretVersion(String keyVaultSecretVer return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model CustomCertificateInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CustomCertificateInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateProperties.java index bc1b5727e3b4..831edebd57c6 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateProperties.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -113,26 +112,6 @@ public CustomCertificateProperties withKeyVaultSecretVersion(String keyVaultSecr return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyVaultBaseUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property keyVaultBaseUri in model CustomCertificateProperties")); - } - if (keyVaultSecretName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property keyVaultSecretName in model CustomCertificateProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CustomCertificateProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainInner.java index aabb2c9353b2..e51fab30b5e8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainInner.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -154,23 +153,6 @@ public CustomDomainInner withCustomCertificate(ResourceReference customCertifica return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model CustomDomainInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CustomDomainInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainProperties.java index dca4c2748d6c..797eee88f1b4 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainProperties.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -89,28 +88,6 @@ public CustomDomainProperties withCustomCertificate(ResourceReference customCert return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (domainName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property domainName in model CustomDomainProperties")); - } - if (customCertificate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property customCertificate in model CustomDomainProperties")); - } else { - customCertificate().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CustomDomainProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/NameAvailabilityInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/NameAvailabilityInner.java index 2137788f4e8e..ea141571b545 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/NameAvailabilityInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/NameAvailabilityInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Result of the request to check name availability. It contains a flag and possible reason of failure. */ -@Fluent +@Immutable public final class NameAvailabilityInner implements JsonSerializable { /* * Indicates whether the name is available or not. @@ -34,7 +34,7 @@ public final class NameAvailabilityInner implements JsonSerializable { /* * Name of the operation with format: {provider}/{resource}/{operation} @@ -47,7 +47,7 @@ public final class OperationInner implements JsonSerializable { /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -59,17 +59,6 @@ public String name() { return this.name; } - /** - * Set the name property: Name of the operation with format: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - /** * Get the isDataAction property: If the operation is a data action. (for data plane rbac). * @@ -79,17 +68,6 @@ public Boolean isDataAction() { return this.isDataAction; } - /** - * Set the isDataAction property: If the operation is a data action. (for data plane rbac). - * - * @param isDataAction the isDataAction value to set. - * @return the OperationInner object itself. - */ - public OperationInner withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - /** * Get the display property: The object that describes a operation. * @@ -99,17 +77,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: The object that describes a operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - /** * Get the origin property: Optional. The intended executor of the operation; governs the display of the operation * in the RBAC UX and the audit logs UX. @@ -120,18 +87,6 @@ public String origin() { return this.origin; } - /** - * Set the origin property: Optional. The intended executor of the operation; governs the display of the operation - * in the RBAC UX and the audit logs UX. - * - * @param origin the origin value to set. - * @return the OperationInner object itself. - */ - public OperationInner withOrigin(String origin) { - this.origin = origin; - return this; - } - /** * Get the properties property: Extra Operation properties. * @@ -141,31 +96,6 @@ public OperationProperties properties() { return this.properties; } - /** - * Set the properties property: Extra Operation properties. - * - * @param properties the properties value to set. - * @return the OperationInner object itself. - */ - public OperationInner withProperties(OperationProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PersistentStorageInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PersistentStorageInner.java new file mode 100644 index 000000000000..d18374b2e9f9 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PersistentStorageInner.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.webpubsub.models.ProvisioningState; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; +import java.io.IOException; + +/** + * A persistent storage. + */ +@Fluent +public final class PersistentStorageInner extends ProxyResource { + /* + * Properties of a persistent storage. + */ + private PersistentStorageProperties innerProperties = new PersistentStorageProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PersistentStorageInner class. + */ + public PersistentStorageInner() { + } + + /** + * Get the innerProperties property: Properties of a persistent storage. + * + * @return the innerProperties value. + */ + private PersistentStorageProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the storageAccount property: Reference to the storage account to be used for persistent storage. + * + * @return the storageAccount value. + */ + public ResourceReference storageAccount() { + return this.innerProperties() == null ? null : this.innerProperties().storageAccount(); + } + + /** + * Set the storageAccount property: Reference to the storage account to be used for persistent storage. + * + * @param storageAccount the storageAccount value to set. + * @return the PersistentStorageInner object itself. + */ + public PersistentStorageInner withStorageAccount(ResourceReference storageAccount) { + if (this.innerProperties() == null) { + this.innerProperties = new PersistentStorageProperties(); + } + this.innerProperties().withStorageAccount(storageAccount); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PersistentStorageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PersistentStorageInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PersistentStorageInner. + */ + public static PersistentStorageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PersistentStorageInner deserializedPersistentStorageInner = new PersistentStorageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPersistentStorageInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPersistentStorageInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPersistentStorageInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPersistentStorageInner.innerProperties = PersistentStorageProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPersistentStorageInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPersistentStorageInner; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PersistentStorageProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PersistentStorageProperties.java new file mode 100644 index 000000000000..74a395d09f48 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PersistentStorageProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.webpubsub.models.ProvisioningState; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; +import java.io.IOException; + +/** + * Properties of a persistent storage. + */ +@Fluent +public final class PersistentStorageProperties implements JsonSerializable { + /* + * Provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Reference to the storage account to be used for persistent storage. + */ + private ResourceReference storageAccount; + + /** + * Creates an instance of PersistentStorageProperties class. + */ + public PersistentStorageProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the storageAccount property: Reference to the storage account to be used for persistent storage. + * + * @return the storageAccount value. + */ + public ResourceReference storageAccount() { + return this.storageAccount; + } + + /** + * Set the storageAccount property: Reference to the storage account to be used for persistent storage. + * + * @param storageAccount the storageAccount value to set. + * @return the PersistentStorageProperties object itself. + */ + public PersistentStorageProperties withStorageAccount(ResourceReference storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("storageAccount", this.storageAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PersistentStorageProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PersistentStorageProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PersistentStorageProperties. + */ + public static PersistentStorageProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PersistentStorageProperties deserializedPersistentStorageProperties = new PersistentStorageProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccount".equals(fieldName)) { + deserializedPersistentStorageProperties.storageAccount = ResourceReference.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPersistentStorageProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPersistentStorageProperties; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionInner.java index 892b47003434..7ceb45b95b92 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; @@ -165,17 +165,6 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionProperties.java index fa12a15c943b..7f6ae7224eb8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; @@ -106,20 +106,6 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceInner.java index a5609144b40e..5a6473b8d64e 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -17,7 +17,7 @@ /** * Private link resource. */ -@Fluent +@Immutable public final class PrivateLinkResourceInner extends ProxyResource { /* * Private link resource properties @@ -47,7 +47,7 @@ public final class PrivateLinkResourceInner extends ProxyResource { /** * Creates an instance of PrivateLinkResourceInner class. */ - public PrivateLinkResourceInner() { + private PrivateLinkResourceInner() { } /** @@ -107,20 +107,6 @@ public String groupId() { return this.innerProperties() == null ? null : this.innerProperties().groupId(); } - /** - * Set the groupId property: Group Id of the private link resource. - * - * @param groupId the groupId value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withGroupId(String groupId) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withGroupId(groupId); - return this; - } - /** * Get the requiredMembers property: Required members of the private link resource. * @@ -130,20 +116,6 @@ public List requiredMembers() { return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); } - /** - * Set the requiredMembers property: Required members of the private link resource. - * - * @param requiredMembers the requiredMembers value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withRequiredMembers(requiredMembers); - return this; - } - /** * Get the requiredZoneNames property: Required private DNS zone names. * @@ -153,20 +125,6 @@ public List requiredZoneNames() { return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); } - /** - * Set the requiredZoneNames property: Required private DNS zone names. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withRequiredZoneNames(requiredZoneNames); - return this; - } - /** * Get the shareablePrivateLinkResourceTypes property: The list of resources that are onboarded to private link * service. @@ -177,33 +135,6 @@ public List shareablePrivateLinkResourceTypes( return this.innerProperties() == null ? null : this.innerProperties().shareablePrivateLinkResourceTypes(); } - /** - * Set the shareablePrivateLinkResourceTypes property: The list of resources that are onboarded to private link - * service. - * - * @param shareablePrivateLinkResourceTypes the shareablePrivateLinkResourceTypes value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withShareablePrivateLinkResourceTypes( - List shareablePrivateLinkResourceTypes) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkResourceProperties(); - } - this.innerProperties().withShareablePrivateLinkResourceTypes(shareablePrivateLinkResourceTypes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceProperties.java index 20ab1bed8ab7..0dec2637e981 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Private link resource properties. */ -@Fluent +@Immutable public final class PrivateLinkResourceProperties implements JsonSerializable { /* * Group Id of the private link resource @@ -41,7 +41,7 @@ public final class PrivateLinkResourceProperties implements JsonSerializable requiredMembers() { return this.requiredMembers; } - /** - * Set the requiredMembers property: Required members of the private link resource. - * - * @param requiredMembers the requiredMembers value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredMembers(List requiredMembers) { - this.requiredMembers = requiredMembers; - return this; - } - /** * Get the requiredZoneNames property: Required private DNS zone names. * @@ -93,17 +71,6 @@ public List requiredZoneNames() { return this.requiredZoneNames; } - /** - * Set the requiredZoneNames property: Required private DNS zone names. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; - return this; - } - /** * Get the shareablePrivateLinkResourceTypes property: The list of resources that are onboarded to private link * service. @@ -114,30 +81,6 @@ public List shareablePrivateLinkResourceTypes( return this.shareablePrivateLinkResourceTypes; } - /** - * Set the shareablePrivateLinkResourceTypes property: The list of resources that are onboarded to private link - * service. - * - * @param shareablePrivateLinkResourceTypes the shareablePrivateLinkResourceTypes value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withShareablePrivateLinkResourceTypes( - List shareablePrivateLinkResourceTypes) { - this.shareablePrivateLinkResourceTypes = shareablePrivateLinkResourceTypes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (shareablePrivateLinkResourceTypes() != null) { - shareablePrivateLinkResourceTypes().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaInner.java index 9f4c6d7f598f..e98304d6c339 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; @@ -21,14 +21,14 @@ @Fluent public final class ReplicaInner extends Resource { /* - * The billing information of the resource. + * The properties property. */ - private ResourceSku sku; + private ReplicaProperties innerProperties; /* - * The properties property. + * The billing information of the resource. */ - private ReplicaProperties innerProperties; + private ResourceSku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -56,6 +56,15 @@ public final class ReplicaInner extends Resource { public ReplicaInner() { } + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private ReplicaProperties innerProperties() { + return this.innerProperties; + } + /** * Get the sku property: The billing information of the resource. * @@ -76,15 +85,6 @@ public ReplicaInner withSku(ResourceSku sku) { return this; } - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private ReplicaProperties innerProperties() { - return this.innerProperties; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -205,20 +205,6 @@ public ReplicaInner withResourceStopped(String resourceStopped) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -227,8 +213,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("sku", this.sku); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -259,10 +245,10 @@ public static ReplicaInner fromJson(JsonReader jsonReader) throws IOException { } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedReplicaInner.withTags(tags); - } else if ("sku".equals(fieldName)) { - deserializedReplicaInner.sku = ResourceSku.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedReplicaInner.innerProperties = ReplicaProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedReplicaInner.sku = ResourceSku.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedReplicaInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaProperties.java index 82fba1dda23c..903aba9b30ea 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaProperties.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; @@ -99,14 +99,6 @@ public ReplicaProperties withResourceStopped(String resourceStopped) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceInner.java index 13fce832e69f..bcee2864f8c7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; @@ -13,6 +13,7 @@ import com.azure.resourcemanager.webpubsub.models.ProvisioningState; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResourceStatus; import java.io.IOException; +import java.util.List; /** * Describes a Shared Private Link Resource. @@ -177,23 +178,35 @@ public SharedPrivateLinkResourceInner withRequestMessage(String requestMessage) } /** - * Get the status property: Status of the shared private link resource. + * Get the fqdns property: A list of FQDNs for third party private link service. * - * @return the status value. + * @return the fqdns value. */ - public SharedPrivateLinkResourceStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); + public List fqdns() { + return this.innerProperties() == null ? null : this.innerProperties().fqdns(); } /** - * Validates the instance. + * Set the fqdns property: A list of FQDNs for third party private link service. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param fqdns the fqdns value to set. + * @return the SharedPrivateLinkResourceInner object itself. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public SharedPrivateLinkResourceInner withFqdns(List fqdns) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedPrivateLinkResourceProperties(); } + this.innerProperties().withFqdns(fqdns); + return this; + } + + /** + * Get the status property: Status of the shared private link resource. + * + * @return the status value. + */ + public SharedPrivateLinkResourceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceProperties.java index c60527c6aee3..e3695e89383d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceProperties.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,6 +12,7 @@ import com.azure.resourcemanager.webpubsub.models.ProvisioningState; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResourceStatus; import java.io.IOException; +import java.util.List; /** * Describes the properties of an existing Shared Private Link Resource. @@ -40,6 +40,11 @@ public final class SharedPrivateLinkResourceProperties */ private String requestMessage; + /* + * A list of FQDNs for third party private link service + */ + private List fqdns; + /* * Status of the shared private link resource */ @@ -121,33 +126,33 @@ public SharedPrivateLinkResourceProperties withRequestMessage(String requestMess } /** - * Get the status property: Status of the shared private link resource. + * Get the fqdns property: A list of FQDNs for third party private link service. * - * @return the status value. + * @return the fqdns value. */ - public SharedPrivateLinkResourceStatus status() { - return this.status; + public List fqdns() { + return this.fqdns; } /** - * Validates the instance. + * Set the fqdns property: A list of FQDNs for third party private link service. * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (groupId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property groupId in model SharedPrivateLinkResourceProperties")); - } - if (privateLinkResourceId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateLinkResourceId in model SharedPrivateLinkResourceProperties")); - } + * @param fqdns the fqdns value to set. + * @return the SharedPrivateLinkResourceProperties object itself. + */ + public SharedPrivateLinkResourceProperties withFqdns(List fqdns) { + this.fqdns = fqdns; + return this; } - private static final ClientLogger LOGGER = new ClientLogger(SharedPrivateLinkResourceProperties.class); + /** + * Get the status property: Status of the shared private link resource. + * + * @return the status value. + */ + public SharedPrivateLinkResourceStatus status() { + return this.status; + } /** * {@inheritDoc} @@ -158,6 +163,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("groupId", this.groupId); jsonWriter.writeStringField("privateLinkResourceId", this.privateLinkResourceId); jsonWriter.writeStringField("requestMessage", this.requestMessage); + jsonWriter.writeArrayField("fqdns", this.fqdns, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -187,6 +193,9 @@ public static SharedPrivateLinkResourceProperties fromJson(JsonReader jsonReader = ProvisioningState.fromString(reader.getString()); } else if ("requestMessage".equals(fieldName)) { deserializedSharedPrivateLinkResourceProperties.requestMessage = reader.getString(); + } else if ("fqdns".equals(fieldName)) { + List fqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedSharedPrivateLinkResourceProperties.fqdns = fqdns; } else if ("status".equals(fieldName)) { deserializedSharedPrivateLinkResourceProperties.status = SharedPrivateLinkResourceStatus.fromString(reader.getString()); diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SignalRServiceUsageInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SignalRServiceUsageInner.java index b5e8f6f4204a..64247a30003f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SignalRServiceUsageInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SignalRServiceUsageInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Object that describes a specific usage of the resources. */ -@Fluent +@Immutable public final class SignalRServiceUsageInner implements JsonSerializable { /* * Fully qualified ARM resource id @@ -46,7 +46,7 @@ public final class SignalRServiceUsageInner implements JsonSerializable { /** * Creates an instance of SkuListInner class. */ - public SkuListInner() { + private SkuListInner() { } /** @@ -54,17 +54,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubHubInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubHubInner.java index 68e2b7d11ae9..42c13a3e68fb 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubHubInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubHubInner.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -109,22 +108,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property properties in model WebPubSubHubInner")); - } else { - properties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WebPubSubHubInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubKeysInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubKeysInner.java index 18ab0ea44b9e..d5266b2ac010 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubKeysInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubKeysInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * A class represents the access keys of the resource. */ -@Fluent +@Immutable public final class WebPubSubKeysInner implements JsonSerializable { /* * The primary access key. @@ -39,7 +39,7 @@ public final class WebPubSubKeysInner implements JsonSerializable e.validate()); - } - if (sharedPrivateLinkResources() != null) { - sharedPrivateLinkResources().forEach(e -> e.validate()); - } - if (tls() != null) { - tls().validate(); - } - if (liveTraceConfiguration() != null) { - liveTraceConfiguration().validate(); - } - if (resourceLogConfiguration() != null) { - resourceLogConfiguration().validate(); - } - if (networkACLs() != null) { - networkACLs().validate(); - } - if (socketIO() != null) { - socketIO().validate(); - } - } - /** * {@inheritDoc} */ @@ -479,6 +476,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("liveTraceConfiguration", this.liveTraceConfiguration); jsonWriter.writeJsonField("resourceLogConfiguration", this.resourceLogConfiguration); jsonWriter.writeJsonField("networkACLs", this.networkACLs); + jsonWriter.writeJsonField("applicationFirewall", this.applicationFirewall); jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); jsonWriter.writeBooleanField("disableAadAuth", this.disableAadAuth); @@ -535,6 +533,8 @@ public static WebPubSubProperties fromJson(JsonReader jsonReader) throws IOExcep = ResourceLogConfiguration.fromJson(reader); } else if ("networkACLs".equals(fieldName)) { deserializedWebPubSubProperties.networkACLs = WebPubSubNetworkACLs.fromJson(reader); + } else if ("applicationFirewall".equals(fieldName)) { + deserializedWebPubSubProperties.applicationFirewall = ApplicationFirewallSettings.fromJson(reader); } else if ("publicNetworkAccess".equals(fieldName)) { deserializedWebPubSubProperties.publicNetworkAccess = reader.getString(); } else if ("disableLocalAuth".equals(fieldName)) { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubResourceInner.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubResourceInner.java index 7fad2131cbd6..1c6e962a0b66 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubResourceInner.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.fluent.models; @@ -10,6 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.webpubsub.models.ApplicationFirewallSettings; import com.azure.resourcemanager.webpubsub.models.LiveTraceConfiguration; import com.azure.resourcemanager.webpubsub.models.ManagedIdentity; import com.azure.resourcemanager.webpubsub.models.ProvisioningState; @@ -29,14 +30,14 @@ @Fluent public final class WebPubSubResourceInner extends Resource { /* - * The billing information of the resource. + * A class that describes the properties of the resource */ - private ResourceSku sku; + private WebPubSubProperties innerProperties; /* - * A class that describes the properties of the resource + * The billing information of the resource. */ - private WebPubSubProperties innerProperties; + private ResourceSku sku; /* * The kind of the service @@ -74,6 +75,15 @@ public final class WebPubSubResourceInner extends Resource { public WebPubSubResourceInner() { } + /** + * Get the innerProperties property: A class that describes the properties of the resource. + * + * @return the innerProperties value. + */ + private WebPubSubProperties innerProperties() { + return this.innerProperties; + } + /** * Get the sku property: The billing information of the resource. * @@ -94,15 +104,6 @@ public WebPubSubResourceInner withSku(ResourceSku sku) { return this; } - /** - * Get the innerProperties property: A class that describes the properties of the resource. - * - * @return the innerProperties value. - */ - private WebPubSubProperties innerProperties() { - return this.innerProperties; - } - /** * Get the kind property: The kind of the service. * @@ -375,6 +376,29 @@ public WebPubSubResourceInner withNetworkACLs(WebPubSubNetworkACLs networkACLs) return this; } + /** + * Get the applicationFirewall property: Application firewall settings for the resource. + * + * @return the applicationFirewall value. + */ + public ApplicationFirewallSettings applicationFirewall() { + return this.innerProperties() == null ? null : this.innerProperties().applicationFirewall(); + } + + /** + * Set the applicationFirewall property: Application firewall settings for the resource. + * + * @param applicationFirewall the applicationFirewall value to set. + * @return the WebPubSubResourceInner object itself. + */ + public WebPubSubResourceInner withApplicationFirewall(ApplicationFirewallSettings applicationFirewall) { + if (this.innerProperties() == null) { + this.innerProperties = new WebPubSubProperties(); + } + this.innerProperties().withApplicationFirewall(applicationFirewall); + return this; + } + /** * Get the publicNetworkAccess property: Enable or disable public network access. Default to "Enabled". * When it's Enabled, network ACLs still apply. @@ -535,23 +559,6 @@ public WebPubSubResourceInner withSocketIO(WebPubSubSocketIOSettings socketIO) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (innerProperties() != null) { - innerProperties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } - /** * {@inheritDoc} */ @@ -560,8 +567,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("sku", this.sku); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("sku", this.sku); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); @@ -594,10 +601,10 @@ public static WebPubSubResourceInner fromJson(JsonReader jsonReader) throws IOEx } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedWebPubSubResourceInner.withTags(tags); - } else if ("sku".equals(fieldName)) { - deserializedWebPubSubResourceInner.sku = ResourceSku.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedWebPubSubResourceInner.innerProperties = WebPubSubProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedWebPubSubResourceInner.sku = ResourceSku.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedWebPubSubResourceInner.kind = ServiceKind.fromString(reader.getString()); } else if ("identity".equals(fieldName)) { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/package-info.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/package-info.java index 0ae9547f31bf..8cbe16a04169 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/package-info.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for WebPubSubManagementClient. + * Package containing the inner data models for WebPubSub. * REST API for Azure WebPubSub Service. */ package com.azure.resourcemanager.webpubsub.fluent.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/package-info.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/package-info.java index 00fc4452604c..61261d3fe69a 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/package-info.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for WebPubSubManagementClient. + * Package containing the service clients for WebPubSub. * REST API for Azure WebPubSub Service. */ package com.azure.resourcemanager.webpubsub.fluent; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomCertificateImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomCertificateImpl.java index 1efa5abbbc8b..74d19c635d93 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomCertificateImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomCertificateImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomDomainImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomDomainImpl.java index 79f0a2dc2a80..d02b2275d78b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomDomainImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomDomainImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/NameAvailabilityImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/NameAvailabilityImpl.java index 49a7f765ff29..8fed892acb04 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/NameAvailabilityImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/NameAvailabilityImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationImpl.java index 0a4bd91a5e49..e5f32933de34 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsClientImpl.java index 57a2ccb6c080..0c8e7be79105 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.webpubsub.fluent.OperationsClient; import com.azure.resourcemanager.webpubsub.fluent.models.OperationInner; -import com.azure.resourcemanager.webpubsub.models.OperationList; +import com.azure.resourcemanager.webpubsub.implementation.models.OperationList; import reactor.core.publisher.Mono; /** @@ -59,14 +59,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for WebPubSubManagementClientOperations to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.SignalRService/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.SignalRService/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,23 +81,26 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of Operation items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -101,79 +111,75 @@ private Mono> listSinglePageAsync() { } /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of Operation items as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedFlux}. + * @return paged collection of Operation items along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedFlux}. + * @return paged collection of Operation items along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -183,18 +189,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of Operation items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -202,6 +201,23 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Operation items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -210,22 +226,13 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of Operation items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsImpl.java index 71ec22d329f6..3ed62eb80850 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PersistentStorageImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PersistentStorageImpl.java new file mode 100644 index 000000000000..ff3fccbda03c --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PersistentStorageImpl.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner; +import com.azure.resourcemanager.webpubsub.models.PersistentStorage; +import com.azure.resourcemanager.webpubsub.models.ProvisioningState; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; + +public final class PersistentStorageImpl + implements PersistentStorage, PersistentStorage.Definition, PersistentStorage.Update { + private PersistentStorageInner innerObject; + + private final com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ResourceReference storageAccount() { + return this.innerModel().storageAccount(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PersistentStorageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.webpubsub.WebPubSubManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String name; + + public PersistentStorageImpl withExistingWebPubSub(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public PersistentStorage create() { + this.innerObject = serviceManager.serviceClient() + .getWebPubSubPersistentStorages() + .createOrUpdate(resourceGroupName, resourceName, name, this.innerModel(), Context.NONE); + return this; + } + + public PersistentStorage create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWebPubSubPersistentStorages() + .createOrUpdate(resourceGroupName, resourceName, name, this.innerModel(), context); + return this; + } + + PersistentStorageImpl(String name, com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager) { + this.innerObject = new PersistentStorageInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public PersistentStorageImpl update() { + return this; + } + + public PersistentStorage apply() { + this.innerObject = serviceManager.serviceClient() + .getWebPubSubPersistentStorages() + .createOrUpdate(resourceGroupName, resourceName, name, this.innerModel(), Context.NONE); + return this; + } + + public PersistentStorage apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWebPubSubPersistentStorages() + .createOrUpdate(resourceGroupName, resourceName, name, this.innerModel(), context); + return this; + } + + PersistentStorageImpl(PersistentStorageInner innerObject, + com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "webPubSub"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "persistentStorages"); + } + + public PersistentStorage refresh() { + this.innerObject = serviceManager.serviceClient() + .getWebPubSubPersistentStorages() + .getWithResponse(resourceGroupName, resourceName, name, Context.NONE) + .getValue(); + return this; + } + + public PersistentStorage refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWebPubSubPersistentStorages() + .getWithResponse(resourceGroupName, resourceName, name, context) + .getValue(); + return this; + } + + public PersistentStorageImpl withStorageAccount(ResourceReference storageAccount) { + this.innerModel().withStorageAccount(storageAccount); + return this; + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateEndpointConnectionImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateEndpointConnectionImpl.java index 41bba20599b1..4daeb0682c29 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateEndpointConnectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateLinkResourceImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateLinkResourceImpl.java index f396d998293c..e7aff5ff60bc 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateLinkResourceImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateLinkResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/ReplicaImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/ReplicaImpl.java index 587eae035f5d..57b53b998bb9 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/ReplicaImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/ReplicaImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/ResourceManagerUtils.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/ResourceManagerUtils.java index 8d18e60b7efe..ac68fc1c6e3b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/ResourceManagerUtils.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SharedPrivateLinkResourceImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SharedPrivateLinkResourceImpl.java index 1de3e6103bec..f532878fa17d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SharedPrivateLinkResourceImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SharedPrivateLinkResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -10,6 +10,8 @@ import com.azure.resourcemanager.webpubsub.models.ProvisioningState; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResource; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResourceStatus; +import java.util.Collections; +import java.util.List; public final class SharedPrivateLinkResourceImpl implements SharedPrivateLinkResource, SharedPrivateLinkResource.Definition, SharedPrivateLinkResource.Update { @@ -49,6 +51,15 @@ public String requestMessage() { return this.innerModel().requestMessage(); } + public List fqdns() { + List inner = this.innerModel().fqdns(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public SharedPrivateLinkResourceStatus status() { return this.innerModel().status(); } @@ -65,12 +76,12 @@ private com.azure.resourcemanager.webpubsub.WebPubSubManager manager() { return this.serviceManager; } - private String sharedPrivateLinkResourceName; - private String resourceGroupName; private String resourceName; + private String sharedPrivateLinkResourceName; + public SharedPrivateLinkResourceImpl withExistingWebPubSub(String resourceGroupName, String resourceName) { this.resourceGroupName = resourceGroupName; this.resourceName = resourceName; @@ -80,7 +91,7 @@ public SharedPrivateLinkResourceImpl withExistingWebPubSub(String resourceGroupN public SharedPrivateLinkResource create() { this.innerObject = serviceManager.serviceClient() .getWebPubSubSharedPrivateLinkResources() - .createOrUpdate(sharedPrivateLinkResourceName, resourceGroupName, resourceName, this.innerModel(), + .createOrUpdate(resourceGroupName, resourceName, sharedPrivateLinkResourceName, this.innerModel(), Context.NONE); return this; } @@ -88,7 +99,7 @@ public SharedPrivateLinkResource create() { public SharedPrivateLinkResource create(Context context) { this.innerObject = serviceManager.serviceClient() .getWebPubSubSharedPrivateLinkResources() - .createOrUpdate(sharedPrivateLinkResourceName, resourceGroupName, resourceName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, resourceName, sharedPrivateLinkResourceName, this.innerModel(), context); return this; } @@ -105,7 +116,7 @@ public SharedPrivateLinkResourceImpl update() { public SharedPrivateLinkResource apply() { this.innerObject = serviceManager.serviceClient() .getWebPubSubSharedPrivateLinkResources() - .createOrUpdate(sharedPrivateLinkResourceName, resourceGroupName, resourceName, this.innerModel(), + .createOrUpdate(resourceGroupName, resourceName, sharedPrivateLinkResourceName, this.innerModel(), Context.NONE); return this; } @@ -113,7 +124,7 @@ public SharedPrivateLinkResource apply() { public SharedPrivateLinkResource apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWebPubSubSharedPrivateLinkResources() - .createOrUpdate(sharedPrivateLinkResourceName, resourceGroupName, resourceName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, resourceName, sharedPrivateLinkResourceName, this.innerModel(), context); return this; } @@ -121,16 +132,16 @@ public SharedPrivateLinkResource apply(Context context) { com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.sharedPrivateLinkResourceName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sharedPrivateLinkResources"); this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "webPubSub"); + this.sharedPrivateLinkResourceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "sharedPrivateLinkResources"); } public SharedPrivateLinkResource refresh() { this.innerObject = serviceManager.serviceClient() .getWebPubSubSharedPrivateLinkResources() - .getWithResponse(sharedPrivateLinkResourceName, resourceGroupName, resourceName, Context.NONE) + .getWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName, Context.NONE) .getValue(); return this; } @@ -138,7 +149,7 @@ public SharedPrivateLinkResource refresh() { public SharedPrivateLinkResource refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getWebPubSubSharedPrivateLinkResources() - .getWithResponse(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context) + .getWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName, context) .getValue(); return this; } @@ -157,4 +168,9 @@ public SharedPrivateLinkResourceImpl withRequestMessage(String requestMessage) { this.innerModel().withRequestMessage(requestMessage); return this; } + + public SharedPrivateLinkResourceImpl withFqdns(List fqdns) { + this.innerModel().withFqdns(fqdns); + return this; + } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SignalRServiceUsageImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SignalRServiceUsageImpl.java index f26deeb032a0..1fc07cffee0d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SignalRServiceUsageImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SignalRServiceUsageImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SkuListImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SkuListImpl.java index 4fbe13dceab7..c2ad5d73f980 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SkuListImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/SkuListImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesClientImpl.java index 4e5af6456949..7e24308d6f93 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.webpubsub.fluent.UsagesClient; import com.azure.resourcemanager.webpubsub.fluent.models.SignalRServiceUsageInner; -import com.azure.resourcemanager.webpubsub.models.SignalRServiceUsageList; +import com.azure.resourcemanager.webpubsub.implementation.models.SignalRServiceUsageList; import reactor.core.publisher.Mono; /** @@ -58,29 +58,44 @@ public final class UsagesClientImpl implements UsagesClient { * The interface defining all the services for WebPubSubManagementClientUsages to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientUsages") public interface UsagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("location") String location, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -89,21 +104,10 @@ Mono> listNext(@PathParam(value = "nextLink", */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), location, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -112,72 +116,61 @@ private Mono> listSinglePageAsync(String /** * List resource usage quotas by location. * - * @param location the location like "eastus". - * @param context The context to associate with this operation. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of the resource usages and a possible link for next set along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return object that includes an array of the resource usages and a possible link for next set as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), location, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of the resource usages and a possible link for next set as paginated - * response with {@link PagedFlux}. + * @return object that includes an array of the resource usages and a possible link for next set along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of the resource usages and a possible link for next set as paginated - * response with {@link PagedFlux}. + * @return object that includes an array of the resource usages and a possible link for next set along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(location, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String location, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -186,13 +179,13 @@ private PagedFlux listAsync(String location, Context c */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location) { - return new PagedIterable<>(listAsync(location)); + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); } /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -202,7 +195,8 @@ public PagedIterable list(String location) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String location, Context context) { - return new PagedIterable<>(listAsync(location, context)); + return new PagedIterable<>(() -> listSinglePage(location, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -217,13 +211,6 @@ public PagedIterable list(String location, Context con */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -231,6 +218,25 @@ private Mono> listNextSinglePageAsync(St .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of the resource usages and a possible link for next set along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -240,21 +246,14 @@ private Mono> listNextSinglePageAsync(St * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of the resource usages and a possible link for next set along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesImpl.java index ed15c94fa374..f69d3a4d5517 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesClientImpl.java index ce5c0a40094e..1487dcd79ead 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient; import com.azure.resourcemanager.webpubsub.fluent.models.CustomCertificateInner; -import com.azure.resourcemanager.webpubsub.models.CustomCertificateList; +import com.azure.resourcemanager.webpubsub.implementation.models.CustomCertificateList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,47 +68,83 @@ public final class WebPubSubCustomCertificatesClientImpl implements WebPubSubCus * The interface defining all the services for WebPubSubManagementClientWebPubSubCustomCertificates to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubCustomCertificates") public interface WebPubSubCustomCertificatesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CustomCertificateInner parameters, @HeaderParam("Accept") String accept, + @PathParam("certificateName") String certificateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomCertificateInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("certificateName") String certificateName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomCertificateInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("certificateName") String certificateName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates/{certificateName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, + @PathParam("certificateName") String certificateName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customCertificates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -115,147 +152,14 @@ Mono> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List all custom certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 custom certificates list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all custom certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom certificates list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all custom certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 custom certificates list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all custom certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom certificates list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all custom certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 custom certificates list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List all custom certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom certificates list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -272,72 +176,13 @@ public PagedIterable list(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, String certificateName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, certificateName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a custom certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param certificateName Custom certificate name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom certificate along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String certificateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - certificateName, this.client.getApiVersion(), accept, context); - } - /** * Get a custom certificate. * @@ -371,7 +216,9 @@ private Mono getAsync(String resourceGroupName, String r @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String resourceName, String certificateName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, certificateName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, certificateName, accept, context); } /** @@ -405,35 +252,12 @@ public CustomCertificateInner get(String resourceGroupName, String resourceName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, String certificateName, CustomCertificateInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, certificateName, this.client.getApiVersion(), parameters, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -444,43 +268,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceName The name of the resource. * @param certificateName Custom certificate name. * @param parameters The parameters parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom certificate along with {@link Response} on successful completion of {@link Mono}. + * @return a custom certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String certificateName, CustomCertificateInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String certificateName, CustomCertificateInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, certificateName, this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, contentType, accept, + parameters, Context.NONE); } /** @@ -490,19 +290,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceName The name of the resource. * @param certificateName Custom certificate name. * @param parameters The parameters parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a custom certificate. + * @return a custom certificate along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CustomCertificateInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, String certificateName, CustomCertificateInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, certificateName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CustomCertificateInner.class, CustomCertificateInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String certificateName, CustomCertificateInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, contentType, accept, + parameters, context); } /** @@ -512,7 +313,6 @@ private PollerFlux, CustomCertificateInner> b * @param resourceName The name of the resource. * @param certificateName Custom certificate name. * @param parameters The parameters parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -520,13 +320,12 @@ private PollerFlux, CustomCertificateInner> b */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CustomCertificateInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, String certificateName, CustomCertificateInner parameters, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String resourceName, String certificateName, CustomCertificateInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, certificateName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, certificateName, parameters); return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CustomCertificateInner.class, CustomCertificateInner.class, context); + this.client.getHttpPipeline(), CustomCertificateInner.class, CustomCertificateInner.class, + this.client.getContext()); } /** @@ -544,8 +343,10 @@ private PollerFlux, CustomCertificateInner> b @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomCertificateInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, String certificateName, CustomCertificateInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, certificateName, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, certificateName, parameters); + return this.client.getLroResult(response, + CustomCertificateInner.class, CustomCertificateInner.class, Context.NONE); } /** @@ -565,8 +366,10 @@ public SyncPoller, CustomCertificateInner> be public SyncPoller, CustomCertificateInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, String certificateName, CustomCertificateInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, certificateName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, certificateName, parameters, context); + return this.client.getLroResult(response, + CustomCertificateInner.class, CustomCertificateInner.class, context); } /** @@ -595,17 +398,15 @@ private Mono createOrUpdateAsync(String resourceGroupNam * @param resourceName The name of the resource. * @param certificateName Custom certificate name. * @param parameters The parameters parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom certificate on successful completion of {@link Mono}. + * @return a custom certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String certificateName, CustomCertificateInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, certificateName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public CustomCertificateInner createOrUpdate(String resourceGroupName, String resourceName, String certificateName, + CustomCertificateInner parameters) { + return beginCreateOrUpdate(resourceGroupName, resourceName, certificateName, parameters).getFinalResult(); } /** @@ -615,6 +416,7 @@ private Mono createOrUpdateAsync(String resourceGroupNam * @param resourceName The name of the resource. * @param certificateName Custom certificate name. * @param parameters The parameters parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -622,27 +424,29 @@ private Mono createOrUpdateAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.SINGLE) public CustomCertificateInner createOrUpdate(String resourceGroupName, String resourceName, String certificateName, - CustomCertificateInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, certificateName, parameters).block(); + CustomCertificateInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, certificateName, parameters, context) + .getFinalResult(); } /** - * Create or update a custom certificate. + * Delete a custom certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param certificateName Custom certificate name. - * @param parameters The parameters parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom certificate. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CustomCertificateInner createOrUpdate(String resourceGroupName, String resourceName, String certificateName, - CustomCertificateInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, certificateName, parameters, context).block(); + private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String certificateName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -654,35 +458,12 @@ public CustomCertificateInner createOrUpdate(String resourceGroupName, String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String certificateName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, certificateName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String resourceName, String certificateName) { + return deleteWithResponseAsync(resourceGroupName, resourceName, certificateName) + .flatMap(ignored -> Mono.empty()); } /** @@ -695,34 +476,13 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String certificateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, certificateName, this.client.getApiVersion(), accept, context); + public Response deleteWithResponse(String resourceGroupName, String resourceName, String certificateName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, context); } /** @@ -734,45 +494,121 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, String certificateName) { - return deleteWithResponseAsync(resourceGroupName, resourceName, certificateName) - .flatMap(ignored -> Mono.empty()); + public void delete(String resourceGroupName, String resourceName, String certificateName) { + deleteWithResponse(resourceGroupName, resourceName, certificateName, Context.NONE); } /** - * Delete a custom certificate. + * List all custom certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 custom certificates list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all custom certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 custom certificates list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all custom certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 custom certificates list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all custom certificates. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param certificateName Custom certificate name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return custom certificates list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, String certificateName, + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, certificateName, context).block(); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Delete a custom certificate. + * List all custom certificates. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param certificateName Custom certificate name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom certificates list as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String certificateName) { - deleteWithResponse(resourceGroupName, resourceName, certificateName, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List all custom certificates. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom certificates list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -786,13 +622,6 @@ public void delete(String resourceGroupName, String resourceName, String certifi */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -800,6 +629,24 @@ private Mono> listNextSinglePageAsync(Stri .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom certificates list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -808,21 +655,14 @@ private Mono> listNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom certificates list along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return custom certificates list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesImpl.java index 0e9a735a5791..3a2df3a8fe16 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,27 +27,12 @@ public WebPubSubCustomCertificatesImpl(WebPubSubCustomCertificatesClient innerCl this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomCertificateImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomCertificateImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String resourceName, String certificateName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, resourceName, certificateName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CustomCertificateImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CustomCertificateImpl(inner.getValue(), this.manager())); } public CustomCertificate get(String resourceGroupName, String resourceName, String certificateName) { @@ -68,6 +53,17 @@ public void delete(String resourceGroupName, String resourceName, String certifi this.serviceClient().delete(resourceGroupName, resourceName, certificateName); } + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomCertificateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomCertificateImpl(inner1, this.manager())); + } + public CustomCertificate getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsClientImpl.java index 238f86d58cfa..cc43d9db4c5d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient; import com.azure.resourcemanager.webpubsub.fluent.models.CustomDomainInner; -import com.azure.resourcemanager.webpubsub.models.CustomDomainList; +import com.azure.resourcemanager.webpubsub.implementation.models.CustomDomainList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,47 +68,81 @@ public final class WebPubSubCustomDomainsClientImpl implements WebPubSubCustomDo * The interface defining all the services for WebPubSubManagementClientWebPubSubCustomDomains to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubCustomDomains") public interface WebPubSubCustomDomainsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CustomDomainInner parameters, @HeaderParam("Accept") String accept, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomDomainInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CustomDomainInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains/{name}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/customDomains") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -115,145 +150,14 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List all custom domains. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 custom domains list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List all custom domains. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domains list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all custom domains. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 custom domains list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all custom domains. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domains list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all custom domains. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 custom domains list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } - - /** - * List all custom domains. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domains list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -270,70 +174,13 @@ public PagedIterable list(String resourceGroupName, String re @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a custom domain. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param name Custom domain name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom domain along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - name, this.client.getApiVersion(), accept, context); - } - /** * Get a custom domain. * @@ -366,7 +213,9 @@ private Mono getAsync(String resourceGroupName, String resour @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String resourceName, String name, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, name, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, name, accept, context); } /** @@ -400,33 +249,12 @@ public CustomDomainInner get(String resourceGroupName, String resourceName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, String name, CustomDomainInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, name, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -437,42 +265,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceName The name of the resource. * @param name Custom domain name. * @param parameters The parameters parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom domain along with {@link Response} on successful completion of {@link Mono}. + * @return a custom domain along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String name, CustomDomainInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, String name, + CustomDomainInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, name, this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, accept, parameters, + Context.NONE); } /** @@ -482,18 +287,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceName The name of the resource. * @param name Custom domain name. * @param parameters The parameters parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a custom domain. + * @return a custom domain along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CustomDomainInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, String name, CustomDomainInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, name, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CustomDomainInner.class, CustomDomainInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, String name, + CustomDomainInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, accept, parameters, + context); } /** @@ -503,7 +310,6 @@ private PollerFlux, CustomDomainInner> beginCreate * @param resourceName The name of the resource. * @param name Custom domain name. * @param parameters The parameters parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -511,12 +317,11 @@ private PollerFlux, CustomDomainInner> beginCreate */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CustomDomainInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, String name, CustomDomainInner parameters, Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String resourceName, String name, CustomDomainInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, name, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, name, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CustomDomainInner.class, CustomDomainInner.class, context); + CustomDomainInner.class, CustomDomainInner.class, this.client.getContext()); } /** @@ -534,7 +339,9 @@ private PollerFlux, CustomDomainInner> beginCreate @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomDomainInner> beginCreateOrUpdate(String resourceGroupName, String resourceName, String name, CustomDomainInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, name, parameters).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, name, parameters); + return this.client.getLroResult(response, CustomDomainInner.class, + CustomDomainInner.class, Context.NONE); } /** @@ -553,8 +360,10 @@ public SyncPoller, CustomDomainInner> beginCreateO @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CustomDomainInner> beginCreateOrUpdate(String resourceGroupName, String resourceName, String name, CustomDomainInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, name, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, name, parameters, context); + return this.client.getLroResult(response, CustomDomainInner.class, + CustomDomainInner.class, context); } /** @@ -576,26 +385,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, St .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create or update a custom domain. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param name Custom domain name. - * @param parameters The parameters parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom domain on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, String name, - CustomDomainInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, name, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create or update a custom domain. * @@ -611,7 +400,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public CustomDomainInner createOrUpdate(String resourceGroupName, String resourceName, String name, CustomDomainInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, name, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, resourceName, name, parameters).getFinalResult(); } /** @@ -630,7 +419,7 @@ public CustomDomainInner createOrUpdate(String resourceGroupName, String resourc @ServiceMethod(returns = ReturnType.SINGLE) public CustomDomainInner createOrUpdate(String resourceGroupName, String resourceName, String name, CustomDomainInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, name, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, resourceName, name, parameters, context).getFinalResult(); } /** @@ -647,28 +436,9 @@ public CustomDomainInner createOrUpdate(String resourceGroupName, String resourc @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, String name) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, name, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -678,37 +448,15 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param name Custom domain name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String name, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, name, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String resourceName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, Context.NONE); } /** @@ -717,17 +465,17 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param name Custom domain name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, - String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, context); } /** @@ -736,7 +484,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param name Custom domain name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -744,11 +491,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, - String name, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, name, context); + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, name); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -764,7 +510,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String name) { - return this.beginDeleteAsync(resourceGroupName, resourceName, name).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, resourceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -782,7 +529,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, resourceName, name, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, resourceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -808,16 +556,13 @@ private Mono deleteAsync(String resourceGroupName, String resourceName, St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param name Custom domain name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, name, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String resourceName, String name) { + beginDelete(resourceGroupName, resourceName, name).getFinalResult(); } /** @@ -826,29 +571,124 @@ private Mono deleteAsync(String resourceGroupName, String resourceName, St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param name Custom domain name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String name) { - deleteAsync(resourceGroupName, resourceName, name).block(); + public void delete(String resourceGroupName, String resourceName, String name, Context context) { + beginDelete(resourceGroupName, resourceName, name, context).getFinalResult(); } /** - * Delete a custom domain. + * List all custom domains. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 custom domains list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all custom domains. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 custom domains list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all custom domains. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 custom domains list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all custom domains. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param name Custom domain name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domains list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String name, Context context) { - deleteAsync(resourceGroupName, resourceName, name, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all custom domains. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 custom domains list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List all custom domains. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domains list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -862,13 +702,6 @@ public void delete(String resourceGroupName, String resourceName, String name, C */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -876,6 +709,24 @@ private Mono> listNextSinglePageAsync(String ne .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domains list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -884,21 +735,13 @@ private Mono> listNextSinglePageAsync(String ne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domains list along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return custom domains list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsImpl.java index 925accd86d01..0c0ef442927a 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,26 +27,12 @@ public WebPubSubCustomDomainsImpl(WebPubSubCustomDomainsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomDomainImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomDomainImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String resourceName, String name, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, resourceName, name, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CustomDomainImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CustomDomainImpl(inner.getValue(), this.manager())); } public CustomDomain get(String resourceGroupName, String resourceName, String name) { @@ -66,6 +52,16 @@ public void delete(String resourceGroupName, String resourceName, String name, C this.serviceClient().delete(resourceGroupName, resourceName, name, context); } + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomDomainImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomDomainImpl(inner1, this.manager())); + } + public CustomDomain getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubImpl.java index 3e4e82137ef7..dcdc27a3b642 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -47,12 +47,12 @@ private com.azure.resourcemanager.webpubsub.WebPubSubManager manager() { return this.serviceManager; } - private String hubName; - private String resourceGroupName; private String resourceName; + private String hubName; + public WebPubSubHubImpl withExistingWebPubSub(String resourceGroupName, String resourceName) { this.resourceGroupName = resourceGroupName; this.resourceName = resourceName; @@ -62,14 +62,14 @@ public WebPubSubHubImpl withExistingWebPubSub(String resourceGroupName, String r public WebPubSubHub create() { this.innerObject = serviceManager.serviceClient() .getWebPubSubHubs() - .createOrUpdate(hubName, resourceGroupName, resourceName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, resourceName, hubName, this.innerModel(), Context.NONE); return this; } public WebPubSubHub create(Context context) { this.innerObject = serviceManager.serviceClient() .getWebPubSubHubs() - .createOrUpdate(hubName, resourceGroupName, resourceName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, resourceName, hubName, this.innerModel(), context); return this; } @@ -86,14 +86,14 @@ public WebPubSubHubImpl update() { public WebPubSubHub apply() { this.innerObject = serviceManager.serviceClient() .getWebPubSubHubs() - .createOrUpdate(hubName, resourceGroupName, resourceName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, resourceName, hubName, this.innerModel(), Context.NONE); return this; } public WebPubSubHub apply(Context context) { this.innerObject = serviceManager.serviceClient() .getWebPubSubHubs() - .createOrUpdate(hubName, resourceGroupName, resourceName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, resourceName, hubName, this.innerModel(), context); return this; } @@ -101,15 +101,15 @@ public WebPubSubHub apply(Context context) { com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.hubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hubs"); this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "webPubSub"); + this.hubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "hubs"); } public WebPubSubHub refresh() { this.innerObject = serviceManager.serviceClient() .getWebPubSubHubs() - .getWithResponse(hubName, resourceGroupName, resourceName, Context.NONE) + .getWithResponse(resourceGroupName, resourceName, hubName, Context.NONE) .getValue(); return this; } @@ -117,7 +117,7 @@ public WebPubSubHub refresh() { public WebPubSubHub refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getWebPubSubHubs() - .getWithResponse(hubName, resourceGroupName, resourceName, context) + .getWithResponse(resourceGroupName, resourceName, hubName, context) .getValue(); return this; } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java index 0264a3aa71af..cab3868d8ff3 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient; import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubHubInner; -import com.azure.resourcemanager.webpubsub.models.WebPubSubHubList; +import com.azure.resourcemanager.webpubsub.implementation.models.WebPubSubHubList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,45 +68,80 @@ public final class WebPubSubHubsClientImpl implements WebPubSubHubsClient { * The interface defining all the services for WebPubSubManagementClientWebPubSubHubs to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubHubs") public interface WebPubSubHubsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs/{hubName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("hubName") String hubName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs/{hubName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("hubName") String hubName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("hubName") String hubName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs/{hubName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("hubName") String hubName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @BodyParam("application/json") WebPubSubHubInner parameters, @HeaderParam("Accept") String accept, + @PathParam("hubName") String hubName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WebPubSubHubInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs/{hubName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("hubName") String hubName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") WebPubSubHubInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs/{hubName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("hubName") String hubName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("hubName") String hubName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs/{hubName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("hubName") String hubName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/hubs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @@ -114,248 +150,60 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List hub settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 hub setting list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List hub settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hub setting list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List hub settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 hub setting list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List hub settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hub setting list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List hub settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 hub setting list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } - - /** - * List hub settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hub setting list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a hub setting along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String hubName, String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (hubName == null) { - return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, + String hubName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), hubName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, hubName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hub setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String hubName, String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (hubName == null) { - return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), hubName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - - /** - * Get a hub setting. - * * @param hubName The hub name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a hub setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String hubName, String resourceGroupName, String resourceName) { - return getWithResponseAsync(hubName, resourceGroupName, resourceName) + private Mono getAsync(String resourceGroupName, String resourceName, String hubName) { + return getWithResponseAsync(resourceGroupName, resourceName, hubName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -363,33 +211,35 @@ private Mono getAsync(String hubName, String resourceGroupNam * @return a hub setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String hubName, String resourceGroupName, String resourceName, + public Response getWithResponse(String resourceGroupName, String resourceName, String hubName, Context context) { - return getWithResponseAsync(hubName, resourceGroupName, resourceName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, hubName, accept, context); } /** * Get a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a hub setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WebPubSubHubInner get(String hubName, String resourceGroupName, String resourceName) { - return getWithResponse(hubName, resourceGroupName, resourceName, Context.NONE).getValue(); + public WebPubSubHubInner get(String resourceGroupName, String resourceName, String hubName) { + return getWithResponse(resourceGroupName, resourceName, hubName, Context.NONE).getValue(); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -397,134 +247,89 @@ public WebPubSubHubInner get(String hubName, String resourceGroupName, String re * @return a hub setting along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String hubName, String resourceGroupName, - String resourceName, WebPubSubHubInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (hubName == null) { - return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, String hubName, WebPubSubHubInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.createOrUpdate(this.client.getEndpoint(), hubName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, hubName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hub setting along with {@link Response} on successful completion of {@link Mono}. + * @return a hub setting along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String hubName, String resourceGroupName, - String resourceName, WebPubSubHubInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (hubName == null) { - return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String hubName, WebPubSubHubInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), hubName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, hubName, contentType, accept, parameters, + Context.NONE); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a hub setting. + * @return a hub setting along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebPubSubHubInner> beginCreateOrUpdateAsync(String hubName, - String resourceGroupName, String resourceName, WebPubSubHubInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(hubName, resourceGroupName, resourceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WebPubSubHubInner.class, WebPubSubHubInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String hubName, WebPubSubHubInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, hubName, contentType, accept, parameters, + context); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of a hub setting. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebPubSubHubInner> beginCreateOrUpdateAsync(String hubName, - String resourceGroupName, String resourceName, WebPubSubHubInner parameters, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, WebPubSubHubInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, String hubName, WebPubSubHubInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(hubName, resourceGroupName, resourceName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, hubName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WebPubSubHubInner.class, WebPubSubHubInner.class, context); + WebPubSubHubInner.class, WebPubSubHubInner.class, this.client.getContext()); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -532,17 +337,20 @@ private PollerFlux, WebPubSubHubInner> beginCreate * @return the {@link SyncPoller} for polling of a hub setting. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebPubSubHubInner> beginCreateOrUpdate(String hubName, - String resourceGroupName, String resourceName, WebPubSubHubInner parameters) { - return this.beginCreateOrUpdateAsync(hubName, resourceGroupName, resourceName, parameters).getSyncPoller(); + public SyncPoller, WebPubSubHubInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String hubName, WebPubSubHubInner parameters) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, hubName, parameters); + return this.client.getLroResult(response, WebPubSubHubInner.class, + WebPubSubHubInner.class, Context.NONE); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -551,18 +359,20 @@ public SyncPoller, WebPubSubHubInner> beginCreateO * @return the {@link SyncPoller} for polling of a hub setting. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebPubSubHubInner> beginCreateOrUpdate(String hubName, - String resourceGroupName, String resourceName, WebPubSubHubInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(hubName, resourceGroupName, resourceName, parameters, context) - .getSyncPoller(); + public SyncPoller, WebPubSubHubInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, String hubName, WebPubSubHubInner parameters, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, hubName, parameters, context); + return this.client.getLroResult(response, WebPubSubHubInner.class, + WebPubSubHubInner.class, context); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -570,38 +380,18 @@ public SyncPoller, WebPubSubHubInner> beginCreateO * @return a hub setting on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String hubName, String resourceGroupName, String resourceName, + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, String hubName, WebPubSubHubInner parameters) { - return beginCreateOrUpdateAsync(hubName, resourceGroupName, resourceName, parameters).last() + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, hubName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The resource of WebPubSubHub and its properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hub setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String hubName, String resourceGroupName, String resourceName, - WebPubSubHubInner parameters, Context context) { - return beginCreateOrUpdateAsync(hubName, resourceGroupName, resourceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update a hub setting. - * * @param hubName The hub name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. * @param parameters The resource of WebPubSubHub and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -609,17 +399,17 @@ private Mono createOrUpdateAsync(String hubName, String resou * @return a hub setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WebPubSubHubInner createOrUpdate(String hubName, String resourceGroupName, String resourceName, + public WebPubSubHubInner createOrUpdate(String resourceGroupName, String resourceName, String hubName, WebPubSubHubInner parameters) { - return createOrUpdateAsync(hubName, resourceGroupName, resourceName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, resourceName, hubName, parameters).getFinalResult(); } /** * Create or update a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param parameters The resource of WebPubSubHub and its properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -628,153 +418,110 @@ public WebPubSubHubInner createOrUpdate(String hubName, String resourceGroupName * @return a hub setting. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WebPubSubHubInner createOrUpdate(String hubName, String resourceGroupName, String resourceName, + public WebPubSubHubInner createOrUpdate(String resourceGroupName, String resourceName, String hubName, WebPubSubHubInner parameters, Context context) { - return createOrUpdateAsync(hubName, resourceGroupName, resourceName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, resourceName, hubName, parameters, context).getFinalResult(); } /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String hubName, String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (hubName == null) { - return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String hubName) { return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), hubName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, hubName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String hubName, String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (hubName == null) { - return Mono.error(new IllegalArgumentException("Parameter hubName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), hubName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String resourceName, String hubName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, hubName, Context.NONE); } /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String hubName, String resourceGroupName, - String resourceName) { - Mono>> mono = deleteWithResponseAsync(hubName, resourceGroupName, resourceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, String hubName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, hubName, context); } /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String hubName, String resourceGroupName, - String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(hubName, resourceGroupName, resourceName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String hubName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, hubName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String hubName, String resourceGroupName, - String resourceName) { - return this.beginDeleteAsync(hubName, resourceGroupName, resourceName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String hubName) { + Response response = deleteWithResponse(resourceGroupName, resourceName, hubName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -782,75 +529,168 @@ public SyncPoller, Void> beginDelete(String hubName, String res * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String hubName, String resourceGroupName, String resourceName, + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String hubName, Context context) { - return this.beginDeleteAsync(hubName, resourceGroupName, resourceName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, resourceName, hubName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String hubName, String resourceGroupName, String resourceName) { - return beginDeleteAsync(hubName, resourceGroupName, resourceName).last() + private Mono deleteAsync(String resourceGroupName, String resourceName, String hubName) { + return beginDeleteAsync(resourceGroupName, resourceName, hubName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String hubName, String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(hubName, resourceGroupName, resourceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String resourceName, String hubName) { + beginDelete(resourceGroupName, resourceName, hubName).getFinalResult(); } /** * Delete a hub setting. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. * @param hubName The hub name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String hubName, Context context) { + beginDelete(resourceGroupName, resourceName, hubName, context).getFinalResult(); + } + + /** + * List hub settings. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the 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 hub setting list along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String hubName, String resourceGroupName, String resourceName) { - deleteAsync(hubName, resourceGroupName, resourceName).block(); + private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a hub setting. + * List hub settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 hub setting list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List hub settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 hub setting list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List hub settings. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hub setting list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String hubName, String resourceGroupName, String resourceName, Context context) { - deleteAsync(hubName, resourceGroupName, resourceName, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List hub settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 hub setting list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List hub settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hub setting list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -864,13 +704,6 @@ public void delete(String hubName, String resourceGroupName, String resourceName */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -878,6 +711,24 @@ private Mono> listNextSinglePageAsync(String ne .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hub setting list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -886,21 +737,13 @@ private Mono> listNextSinglePageAsync(String ne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hub setting list along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return hub setting list along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsImpl.java index 4bd81bf8c49a..8cab1c15d7a1 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,30 +27,16 @@ public WebPubSubHubsImpl(WebPubSubHubsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubHubImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubHubImpl(inner1, this.manager())); - } - - public Response getWithResponse(String hubName, String resourceGroupName, String resourceName, + public Response getWithResponse(String resourceGroupName, String resourceName, String hubName, Context context) { Response inner - = this.serviceClient().getWithResponse(hubName, resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new WebPubSubHubImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getWithResponse(resourceGroupName, resourceName, hubName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WebPubSubHubImpl(inner.getValue(), this.manager())); } - public WebPubSubHub get(String hubName, String resourceGroupName, String resourceName) { - WebPubSubHubInner inner = this.serviceClient().get(hubName, resourceGroupName, resourceName); + public WebPubSubHub get(String resourceGroupName, String resourceName, String hubName) { + WebPubSubHubInner inner = this.serviceClient().get(resourceGroupName, resourceName, hubName); if (inner != null) { return new WebPubSubHubImpl(inner, this.manager()); } else { @@ -58,20 +44,25 @@ public WebPubSubHub get(String hubName, String resourceGroupName, String resourc } } - public void delete(String hubName, String resourceGroupName, String resourceName) { - this.serviceClient().delete(hubName, resourceGroupName, resourceName); + public void delete(String resourceGroupName, String resourceName, String hubName) { + this.serviceClient().delete(resourceGroupName, resourceName, hubName); } - public void delete(String hubName, String resourceGroupName, String resourceName, Context context) { - this.serviceClient().delete(hubName, resourceGroupName, resourceName, context); + public void delete(String resourceGroupName, String resourceName, String hubName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, hubName, context); + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubHubImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubHubImpl(inner1, this.manager())); } public WebPubSubHub getById(String id) { - String hubName = ResourceManagerUtils.getValueFromIdByName(id, "hubs"); - if (hubName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'hubs'.", id))); - } String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -82,15 +73,15 @@ public WebPubSubHub getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); } - return this.getWithResponse(hubName, resourceGroupName, resourceName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { String hubName = ResourceManagerUtils.getValueFromIdByName(id, "hubs"); if (hubName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'hubs'.", id))); } + return this.getWithResponse(resourceGroupName, resourceName, hubName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -101,15 +92,15 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); } - return this.getWithResponse(hubName, resourceGroupName, resourceName, context); - } - - public void deleteById(String id) { String hubName = ResourceManagerUtils.getValueFromIdByName(id, "hubs"); if (hubName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'hubs'.", id))); } + return this.getWithResponse(resourceGroupName, resourceName, hubName, context); + } + + public void deleteById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -120,15 +111,15 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); } - this.delete(hubName, resourceGroupName, resourceName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { String hubName = ResourceManagerUtils.getValueFromIdByName(id, "hubs"); if (hubName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'hubs'.", id))); } + this.delete(resourceGroupName, resourceName, hubName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -139,7 +130,12 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); } - this.delete(hubName, resourceGroupName, resourceName, context); + String hubName = ResourceManagerUtils.getValueFromIdByName(id, "hubs"); + if (hubName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'hubs'.", id))); + } + this.delete(resourceGroupName, resourceName, hubName, context); } private WebPubSubHubsClient serviceClient() { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubKeysImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubKeysImpl.java index f6fbcd9d9fa2..98d8495d4c58 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubKeysImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubKeysImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientBuilder.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientBuilder.java index 9f2a121b0100..8439fde2d17b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientBuilder.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { WebPubSubManagementClientImpl.class }) public final class WebPubSubManagementClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the WebPubSubManagementClientBuilder. */ - public WebPubSubManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public WebPubSubManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the WebPubSubManagementClientBuilder. */ - public WebPubSubManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public WebPubSubManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public WebPubSubManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); WebPubSubManagementClientImpl client = new WebPubSubManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientImpl.java index b71000b9eda2..120f7bf279b6 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -13,14 +13,17 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollerFactory; import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.webpubsub.fluent.OperationsClient; @@ -29,12 +32,13 @@ import com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubManagementClient; +import com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateLinkResourcesClient; -import com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicaSharedPrivateLinkResourcesClient; -import com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient; +import com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient; +import com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -50,26 +54,12 @@ @ServiceClient(builder = WebPubSubManagementClientBuilder.class) public final class WebPubSubManagementClientImpl implements WebPubSubManagementClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -78,12 +68,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -91,6 +81,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -147,6 +151,34 @@ public OperationsClient getOperations() { return this.operations; } + /** + * The WebPubSubHubsClient object to access its operations. + */ + private final WebPubSubHubsClient webPubSubHubs; + + /** + * Gets the WebPubSubHubsClient object to access its operations. + * + * @return the WebPubSubHubsClient object. + */ + public WebPubSubHubsClient getWebPubSubHubs() { + return this.webPubSubHubs; + } + + /** + * The WebPubSubSharedPrivateLinkResourcesClient object to access its operations. + */ + private final WebPubSubSharedPrivateLinkResourcesClient webPubSubSharedPrivateLinkResources; + + /** + * Gets the WebPubSubSharedPrivateLinkResourcesClient object to access its operations. + * + * @return the WebPubSubSharedPrivateLinkResourcesClient object. + */ + public WebPubSubSharedPrivateLinkResourcesClient getWebPubSubSharedPrivateLinkResources() { + return this.webPubSubSharedPrivateLinkResources; + } + /** * The WebPubSubsClient object to access its operations. */ @@ -162,17 +194,17 @@ public WebPubSubsClient getWebPubSubs() { } /** - * The UsagesClient object to access its operations. + * The WebPubSubPrivateLinkResourcesClient object to access its operations. */ - private final UsagesClient usages; + private final WebPubSubPrivateLinkResourcesClient webPubSubPrivateLinkResources; /** - * Gets the UsagesClient object to access its operations. + * Gets the WebPubSubPrivateLinkResourcesClient object to access its operations. * - * @return the UsagesClient object. + * @return the WebPubSubPrivateLinkResourcesClient object. */ - public UsagesClient getUsages() { - return this.usages; + public WebPubSubPrivateLinkResourcesClient getWebPubSubPrivateLinkResources() { + return this.webPubSubPrivateLinkResources; } /** @@ -203,20 +235,6 @@ public WebPubSubCustomDomainsClient getWebPubSubCustomDomains() { return this.webPubSubCustomDomains; } - /** - * The WebPubSubHubsClient object to access its operations. - */ - private final WebPubSubHubsClient webPubSubHubs; - - /** - * Gets the WebPubSubHubsClient object to access its operations. - * - * @return the WebPubSubHubsClient object. - */ - public WebPubSubHubsClient getWebPubSubHubs() { - return this.webPubSubHubs; - } - /** * The WebPubSubPrivateEndpointConnectionsClient object to access its operations. */ @@ -231,20 +249,6 @@ public WebPubSubPrivateEndpointConnectionsClient getWebPubSubPrivateEndpointConn return this.webPubSubPrivateEndpointConnections; } - /** - * The WebPubSubPrivateLinkResourcesClient object to access its operations. - */ - private final WebPubSubPrivateLinkResourcesClient webPubSubPrivateLinkResources; - - /** - * Gets the WebPubSubPrivateLinkResourcesClient object to access its operations. - * - * @return the WebPubSubPrivateLinkResourcesClient object. - */ - public WebPubSubPrivateLinkResourcesClient getWebPubSubPrivateLinkResources() { - return this.webPubSubPrivateLinkResources; - } - /** * The WebPubSubReplicasClient object to access its operations. */ @@ -274,17 +278,31 @@ public WebPubSubReplicaSharedPrivateLinkResourcesClient getWebPubSubReplicaShare } /** - * The WebPubSubSharedPrivateLinkResourcesClient object to access its operations. + * The WebPubSubPersistentStoragesClient object to access its operations. */ - private final WebPubSubSharedPrivateLinkResourcesClient webPubSubSharedPrivateLinkResources; + private final WebPubSubPersistentStoragesClient webPubSubPersistentStorages; /** - * Gets the WebPubSubSharedPrivateLinkResourcesClient object to access its operations. + * Gets the WebPubSubPersistentStoragesClient object to access its operations. * - * @return the WebPubSubSharedPrivateLinkResourcesClient object. + * @return the WebPubSubPersistentStoragesClient object. */ - public WebPubSubSharedPrivateLinkResourcesClient getWebPubSubSharedPrivateLinkResources() { - return this.webPubSubSharedPrivateLinkResources; + public WebPubSubPersistentStoragesClient getWebPubSubPersistentStorages() { + return this.webPubSubPersistentStorages; + } + + /** + * The UsagesClient object to access its operations. + */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; } /** @@ -294,29 +312,30 @@ public WebPubSubSharedPrivateLinkResourcesClient getWebPubSubSharedPrivateLinkRe * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ WebPubSubManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-03-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-12-01-preview"; this.operations = new OperationsClientImpl(this); + this.webPubSubHubs = new WebPubSubHubsClientImpl(this); + this.webPubSubSharedPrivateLinkResources = new WebPubSubSharedPrivateLinkResourcesClientImpl(this); this.webPubSubs = new WebPubSubsClientImpl(this); - this.usages = new UsagesClientImpl(this); + this.webPubSubPrivateLinkResources = new WebPubSubPrivateLinkResourcesClientImpl(this); this.webPubSubCustomCertificates = new WebPubSubCustomCertificatesClientImpl(this); this.webPubSubCustomDomains = new WebPubSubCustomDomainsClientImpl(this); - this.webPubSubHubs = new WebPubSubHubsClientImpl(this); this.webPubSubPrivateEndpointConnections = new WebPubSubPrivateEndpointConnectionsClientImpl(this); - this.webPubSubPrivateLinkResources = new WebPubSubPrivateLinkResourcesClientImpl(this); this.webPubSubReplicas = new WebPubSubReplicasClientImpl(this); this.webPubSubReplicaSharedPrivateLinkResources = new WebPubSubReplicaSharedPrivateLinkResourcesClientImpl(this); - this.webPubSubSharedPrivateLinkResources = new WebPubSubSharedPrivateLinkResourcesClientImpl(this); + this.webPubSubPersistentStorages = new WebPubSubPersistentStoragesClientImpl(this); + this.usages = new UsagesClientImpl(this); } /** @@ -356,6 +375,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -413,7 +449,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPersistentStoragesClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPersistentStoragesClientImpl.java new file mode 100644 index 000000000000..1e0487bb0db1 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPersistentStoragesClientImpl.java @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient; +import com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner; +import com.azure.resourcemanager.webpubsub.implementation.models.PersistentStorageList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WebPubSubPersistentStoragesClient. + */ +public final class WebPubSubPersistentStoragesClientImpl implements WebPubSubPersistentStoragesClient { + /** + * The proxy service used to perform REST calls. + */ + private final WebPubSubPersistentStoragesService service; + + /** + * The service client containing this operation class. + */ + private final WebPubSubManagementClientImpl client; + + /** + * Initializes an instance of WebPubSubPersistentStoragesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebPubSubPersistentStoragesClientImpl(WebPubSubManagementClientImpl client) { + this.service = RestProxy.create(WebPubSubPersistentStoragesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WebPubSubManagementClientWebPubSubPersistentStorages to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubPersistentStorages") + public interface WebPubSubPersistentStoragesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/persistentStorages/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/persistentStorages/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/persistentStorages/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PersistentStorageInner parameters, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/persistentStorages/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PersistentStorageInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/persistentStorages/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/persistentStorages/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/persistentStorages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/persistentStorages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, + String name) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, String name) { + return getWithResponseAsync(resourceGroupName, resourceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, String name, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, name, accept, context); + } + + /** + * Get a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PersistentStorageInner get(String resourceGroupName, String resourceName, String name) { + return getWithResponse(resourceGroupName, resourceName, name, Context.NONE).getValue(); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, String name, PersistentStorageInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, String name, + PersistentStorageInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, accept, parameters, + Context.NONE); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, String name, + PersistentStorageInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, accept, parameters, + context); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a persistent storage. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PersistentStorageInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, String name, PersistentStorageInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, name, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PersistentStorageInner.class, PersistentStorageInner.class, + this.client.getContext()); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a persistent storage. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PersistentStorageInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String name, PersistentStorageInner parameters) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, name, parameters); + return this.client.getLroResult(response, + PersistentStorageInner.class, PersistentStorageInner.class, Context.NONE); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a persistent storage. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PersistentStorageInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String name, PersistentStorageInner parameters, + Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, name, parameters, context); + return this.client.getLroResult(response, + PersistentStorageInner.class, PersistentStorageInner.class, context); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, String name, + PersistentStorageInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, name, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PersistentStorageInner createOrUpdate(String resourceGroupName, String resourceName, String name, + PersistentStorageInner parameters) { + return beginCreateOrUpdate(resourceGroupName, resourceName, name, parameters).getFinalResult(); + } + + /** + * Create or update a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param parameters The resource of persistent storage and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PersistentStorageInner createOrUpdate(String resourceGroupName, String resourceName, String name, + PersistentStorageInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, name, parameters, context).getFinalResult(); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, Context.NONE); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, String name, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, context); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String name) { + Response response = deleteWithResponse(resourceGroupName, resourceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, String name, + Context context) { + Response response = deleteWithResponse(resourceGroupName, resourceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String name) { + return beginDeleteAsync(resourceGroupName, resourceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String name) { + beginDelete(resourceGroupName, resourceName, name).getFinalResult(); + } + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String name, Context context) { + beginDelete(resourceGroupName, resourceName, name, context).getFinalResult(); + } + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 persistent storages list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 persistent storages list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 persistent storages list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 persistent storages list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPersistentStoragesImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPersistentStoragesImpl.java new file mode 100644 index 000000000000..7903992a9548 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPersistentStoragesImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient; +import com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner; +import com.azure.resourcemanager.webpubsub.models.PersistentStorage; +import com.azure.resourcemanager.webpubsub.models.WebPubSubPersistentStorages; + +public final class WebPubSubPersistentStoragesImpl implements WebPubSubPersistentStorages { + private static final ClientLogger LOGGER = new ClientLogger(WebPubSubPersistentStoragesImpl.class); + + private final WebPubSubPersistentStoragesClient innerClient; + + private final com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager; + + public WebPubSubPersistentStoragesImpl(WebPubSubPersistentStoragesClient innerClient, + com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, String name, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, resourceName, name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PersistentStorageImpl(inner.getValue(), this.manager())); + } + + public PersistentStorage get(String resourceGroupName, String resourceName, String name) { + PersistentStorageInner inner = this.serviceClient().get(resourceGroupName, resourceName, name); + if (inner != null) { + return new PersistentStorageImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String name) { + this.serviceClient().delete(resourceGroupName, resourceName, name); + } + + public void delete(String resourceGroupName, String resourceName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, name, context); + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PersistentStorageImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PersistentStorageImpl(inner1, this.manager())); + } + + public PersistentStorage getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "webPubSub"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "persistentStorages"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'persistentStorages'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "webPubSub"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "persistentStorages"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'persistentStorages'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "webPubSub"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "persistentStorages"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'persistentStorages'.", id))); + } + this.delete(resourceGroupName, resourceName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = ResourceManagerUtils.getValueFromIdByName(id, "webPubSub"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "persistentStorages"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'persistentStorages'.", id))); + } + this.delete(resourceGroupName, resourceName, name, context); + } + + private WebPubSubPersistentStoragesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.webpubsub.WebPubSubManager manager() { + return this.serviceManager; + } + + public PersistentStorageImpl define(String name) { + return new PersistentStorageImpl(name, this.manager()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java index f85c63a09e0e..7b29a6d02e3f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient; import com.azure.resourcemanager.webpubsub.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.webpubsub.models.PrivateEndpointConnectionList; +import com.azure.resourcemanager.webpubsub.implementation.models.PrivateEndpointConnectionList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,45 +68,81 @@ public final class WebPubSubPrivateEndpointConnectionsClientImpl implements WebP * The interface defining all the services for WebPubSubManagementClientWebPubSubPrivateEndpointConnections to be * used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubPrivateEndpointConnections") public interface WebPubSubPrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @BodyParam("application/json") PrivateEndpointConnectionInner parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @@ -115,688 +152,479 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List private endpoint connections. + * Get the specified private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * @return the specified private endpoint connection along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceName, String privateEndpointConnectionName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List private endpoint connections. + * Get the specified private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the specified private endpoint connection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); + private Mono getAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List private endpoint connections. + * Get the specified private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections as paginated response with {@link PagedFlux}. + * @return the specified private endpoint connection along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, privateEndpointConnectionName, accept, context); } /** - * List private endpoint connections. + * Get the specified private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. + * @return the specified private endpoint connection. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE).getValue(); } /** - * List private endpoint connections. + * Update the state of specified private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); - } - - /** - * Get the specified private endpoint connection. - * * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. + * @param parameters The resource of private endpoint and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection along with {@link Response} on successful completion of - * {@link Mono}. + * @return a private endpoint connection to an azure resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } + private Mono> updateWithResponseAsync(String resourceGroupName, + String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), privateEndpointConnectionName, - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the specified private endpoint connection. + * Update the state of specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), privateEndpointConnectionName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - - /** - * Get the specified private endpoint connection. - * * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure * resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. + * @param parameters The resource of private endpoint and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection on successful completion of {@link Mono}. + * @return a private endpoint connection to an azure resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName) { - return getWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName) + private Mono updateAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return updateWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get the specified private endpoint connection. + * Update the state of specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param parameters The resource of private endpoint and its properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection along with {@link Response}. + * @return a private endpoint connection to an azure resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, Context context) { - return getWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context).block(); + public Response updateWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + contentType, accept, parameters, context); } /** - * Get the specified private endpoint connection. + * Update the state of specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param parameters The resource of private endpoint and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection. + * @return a private endpoint connection to an azure resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get(String privateEndpointConnectionName, String resourceGroupName, - String resourceName) { - return getWithResponse(privateEndpointConnectionName, resourceGroupName, resourceName, Context.NONE).getValue(); + public PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { + return updateWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, parameters, + Context.NONE).getValue(); } /** - * Update the state of specified private endpoint connection. + * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The resource of private endpoint and its properties. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection to an azure resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, PrivateEndpointConnectionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), privateEndpointConnectionName, - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - parameters, accept, context)) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update the state of specified private endpoint connection. + * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The resource of private endpoint and its properties. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection to an azure resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, PrivateEndpointConnectionInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), privateEndpointConnectionName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context); + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + Context.NONE); } /** - * Update the state of specified private endpoint connection. + * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The resource of private endpoint and its properties. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection to an azure resource on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, PrivateEndpointConnectionInner parameters) { - return updateWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, context); } /** - * Update the state of specified private endpoint connection. + * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The resource of private endpoint and its properties. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection to an azure resource along with {@link Response}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, PrivateEndpointConnectionInner parameters, Context context) { - return updateWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName, parameters, - context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Update the state of specified private endpoint connection. + * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The resource of private endpoint and its properties. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection to an azure resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner update(String privateEndpointConnectionName, String resourceGroupName, - String resourceName, PrivateEndpointConnectionInner parameters) { - return updateWithResponse(privateEndpointConnectionName, resourceGroupName, resourceName, parameters, - Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), privateEndpointConnectionName, - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), privateEndpointConnectionName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + private Mono deleteAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName) { - Mono>> mono - = deleteWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName).getFinalResult(); } /** * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, + Context context) { + beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName, context).getFinalResult(); } /** - * Delete the specified private endpoint connection. + * List private endpoint connections. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String privateEndpointConnectionName, - String resourceGroupName, String resourceName) { - return this.beginDeleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete the specified private endpoint connection. + * List private endpoint connections. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a list of private endpoint connections as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, Context context) { - return this.beginDeleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Delete the specified private endpoint connection. + * List private endpoint connections. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a list of private endpoint connections along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String privateEndpointConnectionName, String resourceGroupName, + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { - return beginDeleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName).last() - .flatMap(this.client::getLroFinalResultOrError); + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Delete the specified private endpoint connection. + * List private endpoint connections. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a list of private endpoint connections along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String privateEndpointConnectionName, String resourceGroupName, String resourceName, + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Delete the specified private endpoint connection. + * List private endpoint connections. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName) { - deleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); } /** - * Delete the specified private endpoint connection. + * List private endpoint connections. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - deleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context).block(); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -811,13 +639,6 @@ public void delete(String privateEndpointConnectionName, String resourceGroupNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -825,6 +646,24 @@ private Mono> listNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -833,23 +672,14 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of private endpoint connections along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsImpl.java index 66e14e717ef0..b60ba4184ca1 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,35 +27,18 @@ public WebPubSubPrivateEndpointConnectionsImpl(WebPubSubPrivateEndpointConnectio this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - public Response getWithResponse(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, Context context) { + public Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { Response inner = this.serviceClient() - .getWithResponse(privateEndpointConnectionName, resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } - public PrivateEndpointConnection get(String privateEndpointConnectionName, String resourceGroupName, - String resourceName) { + public PrivateEndpointConnection get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { PrivateEndpointConnectionInner inner - = this.serviceClient().get(privateEndpointConnectionName, resourceGroupName, resourceName); + = this.serviceClient().get(resourceGroupName, resourceName, privateEndpointConnectionName); if (inner != null) { return new PrivateEndpointConnectionImpl(inner, this.manager()); } else { @@ -63,22 +46,18 @@ public PrivateEndpointConnection get(String privateEndpointConnectionName, Strin } } - public Response updateWithResponse(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, PrivateEndpointConnectionInner parameters, Context context) { + public Response updateWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context) { Response inner = this.serviceClient() - .updateWithResponse(privateEndpointConnectionName, resourceGroupName, resourceName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .updateWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } - public PrivateEndpointConnection update(String privateEndpointConnectionName, String resourceGroupName, - String resourceName, PrivateEndpointConnectionInner parameters) { + public PrivateEndpointConnection update(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters) { PrivateEndpointConnectionInner inner - = this.serviceClient().update(privateEndpointConnectionName, resourceGroupName, resourceName, parameters); + = this.serviceClient().update(resourceGroupName, resourceName, privateEndpointConnectionName, parameters); if (inner != null) { return new PrivateEndpointConnectionImpl(inner, this.manager()); } else { @@ -86,13 +65,26 @@ public PrivateEndpointConnection update(String privateEndpointConnectionName, St } } - public void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName) { - this.serviceClient().delete(privateEndpointConnectionName, resourceGroupName, resourceName); + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName); } - public void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName, + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - this.serviceClient().delete(privateEndpointConnectionName, resourceGroupName, resourceName, context); + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } private WebPubSubPrivateEndpointConnectionsClient serviceClient() { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesClientImpl.java index 6d4748747b12..294cb31fefef 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateLinkResourcesClient; import com.azure.resourcemanager.webpubsub.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.webpubsub.models.PrivateLinkResourceList; +import com.azure.resourcemanager.webpubsub.implementation.models.PrivateLinkResourceList; import reactor.core.publisher.Mono; /** @@ -59,14 +59,23 @@ public final class WebPubSubPrivateLinkResourcesClientImpl implements WebPubSubP * The interface defining all the services for WebPubSubManagementClientWebPubSubPrivateLinkResources to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubPrivateLinkResources") public interface WebPubSubPrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @@ -76,7 +85,14 @@ Mono> list(@HostParam("$host") String endpoint @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -93,21 +109,6 @@ Mono> listNext(@PathParam(value = "nextLink", @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -122,38 +123,16 @@ private Mono> listSinglePageAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a resource along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the private link resources that need to be created for a resource as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -164,13 +143,15 @@ private Mono> listSinglePageAsync(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 private link resources that need to be created for a resource as paginated response with - * {@link PagedFlux}. + * @return the private link resources that need to be created for a resource along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -182,14 +163,16 @@ private PagedFlux listAsync(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 private link resources that need to be created for a resource as paginated response with - * {@link PagedFlux}. + * @return the private link resources that need to be created for a resource along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -205,7 +188,8 @@ private PagedFlux listAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -223,7 +207,8 @@ public PagedIterable list(String resourceGroupName, St @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -233,18 +218,11 @@ public PagedIterable list(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 contains a list of PrivateLinkResource and a possible link to query more results along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the private link resources that need to be created for a resource along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -252,6 +230,24 @@ private Mono> listNextSinglePageAsync(St .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -260,22 +256,14 @@ private Mono> listNextSinglePageAsync(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 contains a list of PrivateLinkResource and a possible link to query more results along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the private link resources that need to be created for a resource along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesImpl.java index 6737c7cd15de..13bef0a2ff00 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesClientImpl.java index 4a2391d3ab53..07ac0e4a47de 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -26,13 +26,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicaSharedPrivateLinkResourcesClient; import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceInner; -import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResourceList; +import com.azure.resourcemanager.webpubsub.implementation.models.SharedPrivateLinkResourceList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -68,207 +69,86 @@ public final class WebPubSubReplicaSharedPrivateLinkResourcesClientImpl * The interface defining all the services for WebPubSubManagementClientWebPubSubReplicaSharedPrivateLinkResources * to be used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubReplicaSharedPrivateLinkResources") public interface WebPubSubReplicaSharedPrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, + @PathParam("replicaName") String replicaName, + @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @PathParam("replicaName") String replicaName, @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @PathParam("replicaName") String replicaName, @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SharedPrivateLinkResourceInner parameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SharedPrivateLinkResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, + @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SharedPrivateLinkResourceInner parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/sharedPrivateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName, String replicaName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName, String replicaName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - replicaName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, - String replicaName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, replicaName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, - String replicaName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, replicaName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, - String replicaName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, replicaName)); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, - String replicaName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, replicaName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -287,81 +167,14 @@ public PagedIterable list(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, String replicaName, String sharedPrivateLinkResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, + sharedPrivateLinkResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the specified shared private link resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param sharedPrivateLinkResourceName The name of the shared private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified shared private link resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String resourceName, String replicaName, String sharedPrivateLinkResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - replicaName, sharedPrivateLinkResourceName, this.client.getApiVersion(), accept, context); - } - /** * Get the specified shared private link resource. * @@ -397,8 +210,9 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String resourceName, String replicaName, String sharedPrivateLinkResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, - context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, accept, context); } /** @@ -438,38 +252,12 @@ public SharedPrivateLinkResourceInner get(String resourceGroupName, String resou private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, + sharedPrivateLinkResourceName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -481,49 +269,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param replicaName The name of the replica. * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Shared Private Link Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return describes a Shared Private Link Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String replicaName, String sharedPrivateLinkResourceName, - SharedPrivateLinkResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, replicaName, sharedPrivateLinkResourceName, this.client.getApiVersion(), parameters, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, + sharedPrivateLinkResourceName, contentType, accept, parameters, Context.NONE); } /** @@ -534,20 +292,21 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param replicaName The name of the replica. * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of describes a Shared Private Link Resource. + * @return describes a Shared Private Link Resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SharedPrivateLinkResourceInner> - beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String replicaName, - String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, - replicaName, sharedPrivateLinkResourceName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, + sharedPrivateLinkResourceName, contentType, accept, parameters, context); } /** @@ -558,7 +317,6 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param replicaName The name of the replica. * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -567,13 +325,12 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SharedPrivateLinkResourceInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String replicaName, - String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context) { - context = this.client.mergeContext(context); + String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, - replicaName, sharedPrivateLinkResourceName, parameters, context); + replicaName, sharedPrivateLinkResourceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, - context); + this.client.getContext()); } /** @@ -593,10 +350,10 @@ private Mono>> createOrUpdateWithResponseAsync(String public SyncPoller, SharedPrivateLinkResourceInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, - parameters) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, replicaName, + sharedPrivateLinkResourceName, parameters); + return this.client.getLroResult(response, + SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, Context.NONE); } /** @@ -617,10 +374,10 @@ public SyncPoller, SharedPrivateLinkR public SyncPoller, SharedPrivateLinkResourceInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, - parameters, context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, replicaName, + sharedPrivateLinkResourceName, parameters, context); + return this.client.getLroResult(response, + SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, context); } /** @@ -651,18 +408,16 @@ private Mono createOrUpdateAsync(String resource * @param replicaName The name of the replica. * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Shared Private Link Resource on successful completion of {@link Mono}. + * @return describes a Shared Private Link Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, - parameters, context).last().flatMap(this.client::getLroFinalResultOrError); + public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String resourceName, + String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { + return beginCreateOrUpdate(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, + parameters).getFinalResult(); } /** @@ -673,6 +428,7 @@ private Mono createOrUpdateAsync(String resource * @param replicaName The name of the replica. * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -680,31 +436,134 @@ private Mono createOrUpdateAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String resourceName, - String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, - parameters).block(); + String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, + Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, + parameters, context).getFinalResult(); } /** - * Create or update a shared private link resource. + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String resourceName, String replicaName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName, + String replicaName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, replicaName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + String replicaName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, replicaName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List shared private link resources. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param sharedPrivateLinkResourceName The name of the shared private link resource. - * @param parameters The shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Shared Private Link Resource. + * @return a list of shared private link resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String resourceName, - String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, - parameters, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + String replicaName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, replicaName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, + String replicaName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, replicaName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, + String replicaName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, replicaName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -719,13 +578,6 @@ public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -733,6 +585,24 @@ private Mono> listNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -741,23 +611,14 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of shared private link resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesImpl.java index 056d8cb394ef..971fde381609 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -28,30 +28,12 @@ public WebPubSubReplicaSharedPrivateLinkResourcesImpl(WebPubSubReplicaSharedPriv this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String resourceName, - String replicaName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, resourceName, replicaName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SharedPrivateLinkResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, - String replicaName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, resourceName, replicaName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SharedPrivateLinkResourceImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String resourceName, String replicaName, String sharedPrivateLinkResourceName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, resourceName, replicaName, sharedPrivateLinkResourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SharedPrivateLinkResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SharedPrivateLinkResourceImpl(inner.getValue(), this.manager())); } public SharedPrivateLinkResource get(String resourceGroupName, String resourceName, String replicaName, @@ -88,6 +70,20 @@ public SharedPrivateLinkResource createOrUpdate(String resourceGroupName, String } } + public PagedIterable list(String resourceGroupName, String resourceName, + String replicaName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, replicaName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SharedPrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, + String replicaName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, replicaName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SharedPrivateLinkResourceImpl(inner1, this.manager())); + } + private WebPubSubReplicaSharedPrivateLinkResourcesClient serviceClient() { return this.innerClient; } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasClientImpl.java index 7d0c64ea5b36..8181e5c6b523 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -29,13 +29,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient; import com.azure.resourcemanager.webpubsub.fluent.models.ReplicaInner; -import com.azure.resourcemanager.webpubsub.models.ReplicaList; +import com.azure.resourcemanager.webpubsub.implementation.models.ReplicaList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,214 +70,134 @@ public final class WebPubSubReplicasClientImpl implements WebPubSubReplicasClien * The interface defining all the services for WebPubSubManagementClientWebPubSubReplicas to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubReplicas") public interface WebPubSubReplicasService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ReplicaInner parameters, @HeaderParam("Accept") String accept, + @PathParam("replicaName") String replicaName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ReplicaInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ReplicaInner parameters, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ReplicaInner parameters, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ReplicaInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("replicaName") String replicaName, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ReplicaInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/restart") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> restart(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("replicaName") String replicaName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/restart") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response restartSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List all replicas belong to this resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all replicas belong to this resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all replicas belong to this resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all replicas belong to this resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all replicas belong to this resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - /** - * List all replicas belong to this resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -293,70 +214,13 @@ public PagedIterable list(String resourceGroupName, String resourc @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, String replicaName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the replica and its properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replica and its properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String replicaName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - replicaName, this.client.getApiVersion(), accept, context); - } - /** * Get the replica and its properties. * @@ -389,7 +253,9 @@ private Mono getAsync(String resourceGroupName, String resourceNam @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String resourceName, String replicaName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, replicaName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, replicaName, accept, context); } /** @@ -424,33 +290,12 @@ public ReplicaInner get(String resourceGroupName, String resourceName, String re @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String resourceName, String replicaName, ReplicaInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -461,43 +306,19 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceName The name of the resource. * @param replicaName The name of the replica. * @param parameters Parameters for the create or update operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a class represent a replica resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String replicaName, ReplicaInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String replicaName, ReplicaInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, replicaName, this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, contentType, accept, + parameters, Context.NONE); } /** @@ -507,18 +328,20 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceName The name of the resource. * @param replicaName The name of the replica. * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a class represent a replica resource. + * @return a class represent a replica resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReplicaInner> beginCreateOrUpdateAsync(String resourceGroupName, - String resourceName, String replicaName, ReplicaInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, replicaName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ReplicaInner.class, ReplicaInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String replicaName, ReplicaInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, contentType, accept, + parameters, context); } /** @@ -528,7 +351,6 @@ private PollerFlux, ReplicaInner> beginCreateOrUpdateAs * @param resourceName The name of the resource. * @param replicaName The name of the replica. * @param parameters Parameters for the create or update operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -536,12 +358,11 @@ private PollerFlux, ReplicaInner> beginCreateOrUpdateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ReplicaInner> beginCreateOrUpdateAsync(String resourceGroupName, - String resourceName, String replicaName, ReplicaInner parameters, Context context) { - context = this.client.mergeContext(context); + String resourceName, String replicaName, ReplicaInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, replicaName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, replicaName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ReplicaInner.class, ReplicaInner.class, context); + ReplicaInner.class, ReplicaInner.class, this.client.getContext()); } /** @@ -559,7 +380,10 @@ private PollerFlux, ReplicaInner> beginCreateOrUpdateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ReplicaInner> beginCreateOrUpdate(String resourceGroupName, String resourceName, String replicaName, ReplicaInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, replicaName, parameters).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, replicaName, parameters); + return this.client.getLroResult(response, ReplicaInner.class, ReplicaInner.class, + Context.NONE); } /** @@ -578,8 +402,10 @@ public SyncPoller, ReplicaInner> beginCreateOrUpdate(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ReplicaInner> beginCreateOrUpdate(String resourceGroupName, String resourceName, String replicaName, ReplicaInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, replicaName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, replicaName, parameters, context); + return this.client.getLroResult(response, ReplicaInner.class, ReplicaInner.class, + context); } /** @@ -608,17 +434,15 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * @param resourceName The name of the resource. * @param replicaName The name of the replica. * @param parameters Parameters for the create or update operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource on successful completion of {@link Mono}. + * @return a class represent a replica resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, String replicaName, - ReplicaInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, replicaName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public ReplicaInner createOrUpdate(String resourceGroupName, String resourceName, String replicaName, + ReplicaInner parameters) { + return beginCreateOrUpdate(resourceGroupName, resourceName, replicaName, parameters).getFinalResult(); } /** @@ -628,6 +452,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * @param resourceName The name of the resource. * @param replicaName The name of the replica. * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -635,154 +460,141 @@ private Mono createOrUpdateAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public ReplicaInner createOrUpdate(String resourceGroupName, String resourceName, String replicaName, - ReplicaInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, replicaName, parameters).block(); + ReplicaInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, replicaName, parameters, context).getFinalResult(); } /** - * Create or update a replica. + * Operation to update an exiting replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param parameters Parameters for the create or update operation. - * @param context The context to associate with this operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource. + * @return a class represent a replica resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicaInner createOrUpdate(String resourceGroupName, String resourceName, String replicaName, - ReplicaInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, replicaName, parameters, context).block(); + private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, + String replicaName, ReplicaInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, contentType, accept, + parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to delete a replica. + * Operation to update an exiting replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a class represent a replica resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String replicaName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } + private Response updateWithResponse(String resourceGroupName, String resourceName, String replicaName, + ReplicaInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, contentType, accept, + parameters, Context.NONE); } /** - * Operation to delete a replica. + * Operation to update an exiting replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. + * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a class represent a replica resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String replicaName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } + private Response updateWithResponse(String resourceGroupName, String resourceName, String replicaName, + ReplicaInner parameters, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, replicaName, this.client.getApiVersion(), accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, contentType, accept, + parameters, context); } /** - * Operation to delete a replica. + * Operation to update an exiting replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link PollerFlux} for polling of a class represent a replica resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, String replicaName) { - return deleteWithResponseAsync(resourceGroupName, resourceName, replicaName).flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicaInner> beginUpdateAsync(String resourceGroupName, + String resourceName, String replicaName, ReplicaInner parameters) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, resourceName, replicaName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ReplicaInner.class, ReplicaInner.class, this.client.getContext()); } /** - * Operation to delete a replica. + * Operation to update an exiting replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param context The context to associate with this operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link SyncPoller} for polling of a class represent a replica resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, String replicaName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, replicaName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicaInner> beginUpdate(String resourceGroupName, String resourceName, + String replicaName, ReplicaInner parameters) { + Response response = updateWithResponse(resourceGroupName, resourceName, replicaName, parameters); + return this.client.getLroResult(response, ReplicaInner.class, ReplicaInner.class, + Context.NONE); } /** - * Operation to delete a replica. + * Operation to update an exiting replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a class represent a replica resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String replicaName) { - deleteWithResponse(resourceGroupName, resourceName, replicaName, Context.NONE); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicaInner> beginUpdate(String resourceGroupName, String resourceName, + String replicaName, ReplicaInner parameters, Context context) { + Response response + = updateWithResponse(resourceGroupName, resourceName, replicaName, parameters, context); + return this.client.getLroResult(response, ReplicaInner.class, ReplicaInner.class, + context); } /** @@ -795,40 +607,13 @@ public void delete(String resourceGroupName, String resourceName, String replica * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a class represent a replica resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - String replicaName, ReplicaInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, this.client.getApiVersion(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono updateAsync(String resourceGroupName, String resourceName, String replicaName, + ReplicaInner parameters) { + return beginUpdateAsync(resourceGroupName, resourceName, replicaName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -838,43 +623,15 @@ private Mono>> updateWithResponseAsync(String resource * @param resourceName The name of the resource. * @param replicaName The name of the replica. * @param parameters Parameters for the update operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return a class represent a replica resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - String replicaName, ReplicaInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, replicaName, this.client.getApiVersion(), parameters, accept, context); + public ReplicaInner update(String resourceGroupName, String resourceName, String replicaName, + ReplicaInner parameters) { + return beginUpdate(resourceGroupName, resourceName, replicaName, parameters).getFinalResult(); } /** @@ -884,154 +641,196 @@ private Mono>> updateWithResponseAsync(String resource * @param resourceName The name of the resource. * @param replicaName The name of the replica. * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a class represent a replica resource. + * @return a class represent a replica resource. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReplicaInner> beginUpdateAsync(String resourceGroupName, - String resourceName, String replicaName, ReplicaInner parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, resourceName, replicaName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ReplicaInner.class, ReplicaInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicaInner update(String resourceGroupName, String resourceName, String replicaName, + ReplicaInner parameters, Context context) { + return beginUpdate(resourceGroupName, resourceName, replicaName, parameters, context).getFinalResult(); } /** - * Operation to update an exiting replica. + * Operation to delete a replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a class represent a replica resource. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ReplicaInner> beginUpdateAsync(String resourceGroupName, - String resourceName, String replicaName, ReplicaInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, resourceName, replicaName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ReplicaInner.class, ReplicaInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String replicaName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to update an exiting replica. + * Operation to delete a replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a replica resource. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReplicaInner> beginUpdate(String resourceGroupName, String resourceName, - String replicaName, ReplicaInner parameters) { - return this.beginUpdateAsync(resourceGroupName, resourceName, replicaName, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String replicaName) { + return deleteWithResponseAsync(resourceGroupName, resourceName, replicaName).flatMap(ignored -> Mono.empty()); } /** - * Operation to update an exiting replica. + * Operation to delete a replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a replica resource. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ReplicaInner> beginUpdate(String resourceGroupName, String resourceName, - String replicaName, ReplicaInner parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, resourceName, replicaName, parameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String resourceName, String replicaName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, context); } /** - * Operation to update an exiting replica. + * Operation to delete a replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, String replicaName, - ReplicaInner parameters) { - return beginUpdateAsync(resourceGroupName, resourceName, replicaName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String resourceName, String replicaName) { + deleteWithResponse(resourceGroupName, resourceName, replicaName, Context.NONE); } /** - * Operation to update an exiting replica. + * List all replicas belong to this resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource on successful completion of {@link Mono}. + * @return paged collection of Replica items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, String replicaName, - ReplicaInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, resourceName, replicaName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to update an exiting replica. + * List all replicas belong to this resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource. + * @return paged collection of Replica items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all replicas belong to this resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 paged collection of Replica items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicaInner update(String resourceGroupName, String resourceName, String replicaName, - ReplicaInner parameters) { - return updateAsync(resourceGroupName, resourceName, replicaName, parameters).block(); + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Operation to update an exiting replica. + * List all replicas belong to this resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a replica resource. + * @return paged collection of Replica items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ReplicaInner update(String resourceGroupName, String resourceName, String replicaName, - ReplicaInner parameters, Context context) { - return updateAsync(resourceGroupName, resourceName, replicaName, parameters, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List all replicas belong to this resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 paged collection of Replica items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List all replicas belong to this resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Replica items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1048,28 +847,9 @@ public ReplicaInner update(String resourceGroupName, String resourceName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> restartWithResponseAsync(String resourceGroupName, String resourceName, String replicaName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1079,37 +859,16 @@ private Mono>> restartWithResponseAsync(String resourc * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync(String resourceGroupName, String resourceName, - String replicaName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.restart(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, replicaName, this.client.getApiVersion(), accept, context); + private Response restartWithResponse(String resourceGroupName, String resourceName, + String replicaName) { + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, Context.NONE); } /** @@ -1118,17 +877,17 @@ private Mono>> restartWithResponseAsync(String resourc * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String resourceName, - String replicaName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, resourceName, replicaName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response restartWithResponse(String resourceGroupName, String resourceName, String replicaName, + Context context) { + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, context); } /** @@ -1137,7 +896,6 @@ private PollerFlux, Void> beginRestartAsync(String resourceGrou * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1145,12 +903,10 @@ private PollerFlux, Void> beginRestartAsync(String resourceGrou */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String resourceName, - String replicaName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = restartWithResponseAsync(resourceGroupName, resourceName, replicaName, context); + String replicaName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, resourceName, replicaName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1167,7 +923,8 @@ private PollerFlux, Void> beginRestartAsync(String resourceGrou @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName, String replicaName) { - return this.beginRestartAsync(resourceGroupName, resourceName, replicaName).getSyncPoller(); + Response response = restartWithResponse(resourceGroupName, resourceName, replicaName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1185,7 +942,8 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName, String replicaName, Context context) { - return this.beginRestartAsync(resourceGroupName, resourceName, replicaName, context).getSyncPoller(); + Response response = restartWithResponse(resourceGroupName, resourceName, replicaName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1211,17 +969,13 @@ private Mono restartAsync(String resourceGroupName, String resourceName, S * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String resourceName, String replicaName, - Context context) { - return beginRestartAsync(resourceGroupName, resourceName, replicaName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void restart(String resourceGroupName, String resourceName, String replicaName) { + beginRestart(resourceGroupName, resourceName, replicaName).getFinalResult(); } /** @@ -1230,29 +984,33 @@ private Mono restartAsync(String resourceGroupName, String resourceName, S * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param replicaName The name of the replica. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String resourceName, String replicaName) { - restartAsync(resourceGroupName, resourceName, replicaName).block(); + public void restart(String resourceGroupName, String resourceName, String replicaName, Context context) { + beginRestart(resourceGroupName, resourceName, replicaName, context).getFinalResult(); } /** - * Operation to restart a replica. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Replica items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String resourceName, String replicaName, Context context) { - restartAsync(resourceGroupName, resourceName, replicaName, context).block(); + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1262,22 +1020,14 @@ public void restart(String resourceGroupName, String resourceName, String replic * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of Replica items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1288,21 +1038,13 @@ private Mono> listNextSinglePageAsync(String nextLin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of Replica items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasImpl.java index c6c73680b178..368667bf7cc6 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,26 +27,12 @@ public WebPubSubReplicasImpl(WebPubSubReplicasClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String resourceName, String replicaName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, resourceName, replicaName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ReplicaImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReplicaImpl(inner.getValue(), this.manager())); } public Replica get(String resourceGroupName, String resourceName, String replicaName) { @@ -67,6 +53,16 @@ public void delete(String resourceGroupName, String resourceName, String replica this.serviceClient().delete(resourceGroupName, resourceName, replicaName); } + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager())); + } + public void restart(String resourceGroupName, String resourceName, String replicaName) { this.serviceClient().restart(resourceGroupName, resourceName, replicaName); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java index 239664aca9ee..08914d8868e7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -11,6 +11,7 @@ import com.azure.resourcemanager.webpubsub.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceInner; import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubResourceInner; +import com.azure.resourcemanager.webpubsub.models.ApplicationFirewallSettings; import com.azure.resourcemanager.webpubsub.models.LiveTraceConfiguration; import com.azure.resourcemanager.webpubsub.models.ManagedIdentity; import com.azure.resourcemanager.webpubsub.models.PrivateEndpointConnection; @@ -143,6 +144,10 @@ public WebPubSubNetworkACLs networkACLs() { return this.innerModel().networkACLs(); } + public ApplicationFirewallSettings applicationFirewall() { + return this.innerModel().applicationFirewall(); + } + public String publicNetworkAccess() { return this.innerModel().publicNetworkAccess(); } @@ -332,6 +337,11 @@ public WebPubSubResourceImpl withNetworkACLs(WebPubSubNetworkACLs networkACLs) { return this; } + public WebPubSubResourceImpl withApplicationFirewall(ApplicationFirewallSettings applicationFirewall) { + this.innerModel().withApplicationFirewall(applicationFirewall); + return this; + } + public WebPubSubResourceImpl withPublicNetworkAccess(String publicNetworkAccess) { this.innerModel().withPublicNetworkAccess(publicNetworkAccess); return this; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java index 9122419c9a28..9cfbc7a97aa2 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,13 +27,14 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient; import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceInner; -import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResourceList; +import com.azure.resourcemanager.webpubsub.implementation.models.SharedPrivateLinkResourceList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,45 +68,81 @@ public final class WebPubSubSharedPrivateLinkResourcesClientImpl implements WebP * The interface defining all the services for WebPubSubManagementClientWebPubSubSharedPrivateLinkResources to be * used by the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubSharedPrivateLinkResources") public interface WebPubSubSharedPrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SharedPrivateLinkResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SharedPrivateLinkResourceInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @BodyParam("application/json") SharedPrivateLinkResourceInner parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("sharedPrivateLinkResourceName") String sharedPrivateLinkResourceName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/sharedPrivateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @@ -115,159 +152,24 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String resourceName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); - } - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String resourceName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -275,31 +177,12 @@ public PagedIterable list(String resourceGroupNa * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceName, String sharedPrivateLinkResourceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), sharedPrivateLinkResourceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, sharedPrivateLinkResourceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -307,68 +190,27 @@ private Mono> getWithResponseAsync(Stri /** * Get the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified shared private link resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), sharedPrivateLinkResourceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - - /** - * Get the specified shared private link resource. - * * @param sharedPrivateLinkResourceName The name of the shared private link resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the 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 specified shared private link resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName) { - return getWithResponseAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName) + private Mono getAsync(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, resourceName, sharedPrivateLinkResourceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -376,34 +218,36 @@ private Mono getAsync(String sharedPrivateLinkRe * @return the specified shared private link resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, Context context) { - return getWithResponseAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context).block(); + public Response getWithResponse(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, sharedPrivateLinkResourceName, accept, context); } /** * Get the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified shared private link resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedPrivateLinkResourceInner get(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName) { - return getWithResponse(sharedPrivateLinkResourceName, resourceGroupName, resourceName, Context.NONE).getValue(); + public SharedPrivateLinkResourceInner get(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName) { + return getWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName, Context.NONE).getValue(); } /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -412,119 +256,69 @@ public SharedPrivateLinkResourceInner get(String sharedPrivateLinkResourceName, * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, SharedPrivateLinkResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), sharedPrivateLinkResourceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, sharedPrivateLinkResourceName, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Shared Private Link Resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return describes a Shared Private Link Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, SharedPrivateLinkResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), sharedPrivateLinkResourceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, - accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, sharedPrivateLinkResourceName, + contentType, accept, parameters, Context.NONE); } /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of describes a Shared Private Link Resource. + * @return describes a Shared Private Link Resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SharedPrivateLinkResourceInner> - beginCreateOrUpdateAsync(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, - SharedPrivateLinkResourceInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(sharedPrivateLinkResourceName, - resourceGroupName, resourceName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, sharedPrivateLinkResourceName, + contentType, accept, parameters, context); } /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -532,22 +326,21 @@ private Mono>> createOrUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SharedPrivateLinkResourceInner> - beginCreateOrUpdateAsync(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, - SharedPrivateLinkResourceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(sharedPrivateLinkResourceName, - resourceGroupName, resourceName, parameters, context); + beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, + SharedPrivateLinkResourceInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, + sharedPrivateLinkResourceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, - context); + this.client.getContext()); } /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -556,18 +349,20 @@ private Mono>> createOrUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SharedPrivateLinkResourceInner> beginCreateOrUpdate( - String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, + String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { - return this.beginCreateOrUpdateAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName, parameters); + return this.client.getLroResult(response, + SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, Context.NONE); } /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -577,20 +372,20 @@ public SyncPoller, SharedPrivateLinkR */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SharedPrivateLinkResourceInner> beginCreateOrUpdate( - String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, + String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context) { - return this - .beginCreateOrUpdateAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters, - context) - .getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, + sharedPrivateLinkResourceName, parameters, context); + return this.client.getLroResult(response, + SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, context); } /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -598,9 +393,9 @@ public SyncPoller, SharedPrivateLinkR * @return describes a Shared Private Link Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, SharedPrivateLinkResourceInner parameters) { - return beginCreateOrUpdateAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, sharedPrivateLinkResourceName, parameters) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -608,158 +403,115 @@ private Mono createOrUpdateAsync(String sharedPr /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Shared Private Link Resource on successful completion of {@link Mono}. + * @return describes a Shared Private Link Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, SharedPrivateLinkResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters, - context).last().flatMap(this.client::getLroFinalResultOrError); + public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters) { + return beginCreateOrUpdate(resourceGroupName, resourceName, sharedPrivateLinkResourceName, parameters) + .getFinalResult(); } /** * Create or update a shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param parameters The shared private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return describes a Shared Private Link Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedPrivateLinkResourceInner createOrUpdate(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName, SharedPrivateLinkResourceInner parameters) { - return createOrUpdateAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters).block(); + public SharedPrivateLinkResourceInner createOrUpdate(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, sharedPrivateLinkResourceName, parameters, context) + .getFinalResult(); } /** - * Create or update a shared private link resource. + * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The shared private link resource. - * @param context The context to associate with this operation. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Shared Private Link Resource. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedPrivateLinkResourceInner createOrUpdate(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName, SharedPrivateLinkResourceInner parameters, Context context) { - return createOrUpdateAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, parameters, context) - .block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, sharedPrivateLinkResourceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), sharedPrivateLinkResourceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, sharedPrivateLinkResourceName, + Context.NONE); } /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sharedPrivateLinkResourceName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter sharedPrivateLinkResourceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), sharedPrivateLinkResourceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, sharedPrivateLinkResourceName, context); } /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName) { Mono>> mono - = deleteWithResponseAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName); + = deleteWithResponseAsync(resourceGroupName, resourceName, sharedPrivateLinkResourceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -767,128 +519,206 @@ private PollerFlux, Void> beginDeleteAsync(String sharedPrivate /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName) { - return this.beginDeleteAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, Context context) { - return this.beginDeleteAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName) { + return beginDeleteAsync(resourceGroupName, resourceName, sharedPrivateLinkResourceName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName) { - return beginDeleteAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName) { + beginDelete(resourceGroupName, resourceName, sharedPrivateLinkResourceName).getFinalResult(); } /** * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, + public void delete(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, Context context) { - return beginDeleteAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + beginDelete(resourceGroupName, resourceName, sharedPrivateLinkResourceName, context).getFinalResult(); } /** - * Delete the specified shared private link resource. + * List shared private link resources. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName) { - deleteAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName).block(); + private Mono> listSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete the specified shared private link resource. + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List shared private link resources. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { - deleteAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context).block(); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -903,13 +733,6 @@ public void delete(String sharedPrivateLinkResourceName, String resourceGroupNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -917,6 +740,24 @@ private Mono> listNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -925,23 +766,14 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of shared private link resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesImpl.java index fb80dd41fceb..d5d8e27d33e5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -27,35 +27,18 @@ public WebPubSubSharedPrivateLinkResourcesImpl(WebPubSubSharedPrivateLinkResourc this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String resourceName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SharedPrivateLinkResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String resourceName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SharedPrivateLinkResourceImpl(inner1, this.manager())); - } - - public Response getWithResponse(String sharedPrivateLinkResourceName, - String resourceGroupName, String resourceName, Context context) { + public Response getWithResponse(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, Context context) { Response inner = this.serviceClient() - .getWithResponse(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SharedPrivateLinkResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + .getWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SharedPrivateLinkResourceImpl(inner.getValue(), this.manager())); } - public SharedPrivateLinkResource get(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName) { + public SharedPrivateLinkResource get(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName) { SharedPrivateLinkResourceInner inner - = this.serviceClient().get(sharedPrivateLinkResourceName, resourceGroupName, resourceName); + = this.serviceClient().get(resourceGroupName, resourceName, sharedPrivateLinkResourceName); if (inner != null) { return new SharedPrivateLinkResourceImpl(inner, this.manager()); } else { @@ -63,22 +46,29 @@ public SharedPrivateLinkResource get(String sharedPrivateLinkResourceName, Strin } } - public void delete(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName) { - this.serviceClient().delete(sharedPrivateLinkResourceName, resourceGroupName, resourceName); + public void delete(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName) { + this.serviceClient().delete(resourceGroupName, resourceName, sharedPrivateLinkResourceName); } - public void delete(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, + public void delete(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, Context context) { - this.serviceClient().delete(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context); + this.serviceClient().delete(resourceGroupName, resourceName, sharedPrivateLinkResourceName, context); + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SharedPrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SharedPrivateLinkResourceImpl(inner1, this.manager())); } public SharedPrivateLinkResource getById(String id) { - String sharedPrivateLinkResourceName - = ResourceManagerUtils.getValueFromIdByName(id, "sharedPrivateLinkResources"); - if (sharedPrivateLinkResourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'sharedPrivateLinkResources'.", id))); - } String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -89,17 +79,17 @@ public SharedPrivateLinkResource getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); } - return this.getWithResponse(sharedPrivateLinkResourceName, resourceGroupName, resourceName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { String sharedPrivateLinkResourceName = ResourceManagerUtils.getValueFromIdByName(id, "sharedPrivateLinkResources"); if (sharedPrivateLinkResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'sharedPrivateLinkResources'.", id))); } + return this.getWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -110,16 +100,16 @@ public Response getByIdWithResponse(String id, Contex throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); } - return this.getWithResponse(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context); - } - - public void deleteById(String id) { String sharedPrivateLinkResourceName = ResourceManagerUtils.getValueFromIdByName(id, "sharedPrivateLinkResources"); if (sharedPrivateLinkResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'sharedPrivateLinkResources'.", id))); } + return this.getWithResponse(resourceGroupName, resourceName, sharedPrivateLinkResourceName, context); + } + + public void deleteById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -130,16 +120,16 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); } - this.delete(sharedPrivateLinkResourceName, resourceGroupName, resourceName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { String sharedPrivateLinkResourceName = ResourceManagerUtils.getValueFromIdByName(id, "sharedPrivateLinkResources"); if (sharedPrivateLinkResourceName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(String .format("The resource ID '%s' is not valid. Missing path segment 'sharedPrivateLinkResources'.", id))); } + this.delete(resourceGroupName, resourceName, sharedPrivateLinkResourceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -150,7 +140,13 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id))); } - this.delete(sharedPrivateLinkResourceName, resourceGroupName, resourceName, context); + String sharedPrivateLinkResourceName + = ResourceManagerUtils.getValueFromIdByName(id, "sharedPrivateLinkResources"); + if (sharedPrivateLinkResourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'sharedPrivateLinkResources'.", id))); + } + this.delete(resourceGroupName, resourceName, sharedPrivateLinkResourceName, context); } private WebPubSubSharedPrivateLinkResourcesClient serviceClient() { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java index cb06c9523042..1c8c7521fd7a 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -29,6 +29,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -38,9 +39,9 @@ import com.azure.resourcemanager.webpubsub.fluent.models.SkuListInner; import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubKeysInner; import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubResourceInner; +import com.azure.resourcemanager.webpubsub.implementation.models.WebPubSubResourceList; import com.azure.resourcemanager.webpubsub.models.NameAvailabilityParameters; import com.azure.resourcemanager.webpubsub.models.RegenerateKeyParameters; -import com.azure.resourcemanager.webpubsub.models.WebPubSubResourceList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -74,623 +75,485 @@ public final class WebPubSubsClientImpl implements WebPubSubsClient { * The interface defining all the services for WebPubSubManagementClientWebPubSubs to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "WebPubSubManagementC") + @Host("{endpoint}") + @ServiceInterface(name = "WebPubSubManagementClientWebPubSubs") public interface WebPubSubsService { @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @PathParam("location") String location, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NameAvailabilityParameters parameters, @HeaderParam("Accept") String accept, - Context context); + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/webPubSub") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WebPubSubResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WebPubSubResourceInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WebPubSubResourceInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") WebPubSubResourceInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") - @ExpectedResponses({ 200, 201, 202 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/webPubSub") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @BodyParam("application/json") WebPubSubResourceInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") - @ExpectedResponses({ 200, 202, 204 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/webPubSub") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}") - @ExpectedResponses({ 200, 202 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @BodyParam("application/json") WebPubSubResourceInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, + Response listKeysSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/regenerateKey") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> regenerateKey(@HostParam("$host") String endpoint, + Mono>> regenerateKey(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateKeyParameters parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/regenerateKey") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response regenerateKeySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateKeyParameters parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/restart") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/restart") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response restartSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @BodyParam("application/json") RegenerateKeyParameters parameters, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/skus") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/skus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listReplicaSkus(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listSkus(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("replicaName") String replicaName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/restart") - @ExpectedResponses({ 202, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/skus") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart(@HostParam("$host") String endpoint, + Response listSkusSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/skus") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/skus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkus(@HostParam("$host") String endpoint, + Mono> listReplicaSkus(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/webPubSub/{resourceName}/replicas/{replicaName}/skus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); + Response listReplicaSkusSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("replicaName") String replicaName, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") NameAvailabilityParameters parameters, + Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") NameAvailabilityParameters parameters, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Checks that the resource name is valid and is not already in use. - * - * @param location the region. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 check name availability along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync(String location, - NameAvailabilityParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), location, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - /** - * Checks that the resource name is valid and is not already in use. - * - * @param location the region. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 check name availability along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync(String location, - NameAvailabilityParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), location, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * Checks that the resource name is valid and is not already in use. - * - * @param location the region. - * @param parameters Parameters supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 check name availability on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync(String location, - NameAvailabilityParameters parameters) { - return checkNameAvailabilityWithResponseAsync(location, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); - /** - * Checks that the resource name is valid and is not already in use. - * - * @param location the region. - * @param parameters Parameters supplied to the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 check name availability along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse(String location, - NameAvailabilityParameters parameters, Context context) { - return checkNameAvailabilityWithResponseAsync(location, parameters, context).block(); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Checks that the resource name is valid and is not already in use. + * Get the resource and its properties. * - * @param location the region. - * @param parameters Parameters supplied to the operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 result of the request to check name availability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NameAvailabilityInner checkNameAvailability(String location, NameAvailabilityParameters parameters) { - return checkNameAvailabilityWithResponse(location, parameters, Context.NONE).getValue(); - } - - /** - * Handles requests to list all resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the resource and its properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String resourceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Handles requests to list all resources in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Handles requests to list all resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Handles requests to list all resources in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Handles requests to list all resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Handles requests to list all resources in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Handles requests to list all resources in a resource group. + * Get the resource and its properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 object that includes an array of resources and a possible link for next set along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the resource and its properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Handles requests to list all resources in a resource group. + * Get the resource and its properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the resource and its properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } + public Response getByResourceGroupWithResponse(String resourceGroupName, + String resourceName, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); } /** - * Handles requests to list all resources in a resource group. + * Get the resource and its properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the 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 object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedFlux}. + * @return the resource and its properties. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public WebPubSubResourceInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); } /** - * Handles requests to list all resources in a resource group. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedFlux}. + * @return a class represent a resource along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, WebPubSubResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Handles requests to list all resources in a resource group. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. + * @return a class represent a resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + Context.NONE); } /** - * Handles requests to list all resources in a resource group. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. + * @return a class represent a resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, context); } /** - * Get the resource and its properties. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of a class represent a resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebPubSubResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WebPubSubResourceInner.class, WebPubSubResourceInner.class, + this.client.getContext()); } /** - * Get the resource and its properties. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param parameters Parameters for the create or update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of a class represent a resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebPubSubResourceInner> + beginCreateOrUpdate(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(response, + WebPubSubResourceInner.class, WebPubSubResourceInner.class, Context.NONE); } /** - * Get the resource and its properties. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of a class represent a resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebPubSubResourceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, WebPubSubResourceInner parameters, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, resourceName, parameters, context); + return this.client.getLroResult(response, + WebPubSubResourceInner.class, WebPubSubResourceInner.class, context); } /** - * Get the resource and its properties. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param parameters Parameters for the create or update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties along with {@link Response}. + * @return a class represent a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String resourceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get the resource and its properties. + * Create or update a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param parameters Parameters for the create or update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties. + * @return a class represent a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WebPubSubResourceInner getByResourceGroup(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + public WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters) { + return beginCreateOrUpdate(resourceGroupName, resourceName, parameters).getFinalResult(); } /** @@ -699,220 +562,181 @@ public WebPubSubResourceInner getByResourceGroup(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource along with {@link Response} on successful completion of {@link Mono}. + * @return a class represent a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, WebPubSubResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, parameters, context).getFinalResult(); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. - * @param context The context to associate with this operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a class represent a resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, WebPubSubResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context); + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a class represent a resource. + * @return a class represent a resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebPubSubResourceInner> - beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WebPubSubResourceInner.class, WebPubSubResourceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + Context.NONE); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a class represent a resource. + * @return a class represent a resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebPubSubResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, WebPubSubResourceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WebPubSubResourceInner.class, WebPubSubResourceInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, context); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a resource. + * @return the {@link PollerFlux} for polling of a class represent a resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebPubSubResourceInner> - beginCreateOrUpdate(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + private PollerFlux, WebPubSubResourceInner> + beginUpdateAsync(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WebPubSubResourceInner.class, WebPubSubResourceInner.class, + this.client.getContext()); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. - * @param context The context to associate with this operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of a class represent a resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebPubSubResourceInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, WebPubSubResourceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + public SyncPoller, WebPubSubResourceInner> beginUpdate(String resourceGroupName, + String resourceName, WebPubSubResourceInner parameters) { + Response response = updateWithResponse(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(response, + WebPubSubResourceInner.class, WebPubSubResourceInner.class, Context.NONE); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of a class represent a resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebPubSubResourceInner> beginUpdate(String resourceGroupName, + String resourceName, WebPubSubResourceInner parameters, Context context) { + Response response = updateWithResponse(resourceGroupName, resourceName, parameters, context); + return this.client.getLroResult(response, + WebPubSubResourceInner.class, WebPubSubResourceInner.class, context); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. - * @param context The context to associate with this operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a class represent a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).last() + private Mono updateAsync(String resourceGroupName, String resourceName, + WebPubSubResourceInner parameters) { + return beginUpdateAsync(resourceGroupName, resourceName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a class represent a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceName, + public WebPubSubResourceInner update(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + return beginUpdate(resourceGroupName, resourceName, parameters).getFinalResult(); } /** - * Create or update a resource. + * Operation to update an exiting resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters Parameters for the create or update operation. + * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -920,9 +744,9 @@ public WebPubSubResourceInner createOrUpdate(String resourceGroupName, String re * @return a class represent a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WebPubSubResourceInner createOrUpdate(String resourceGroupName, String resourceName, + public WebPubSubResourceInner update(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block(); + return beginUpdate(resourceGroupName, resourceName, parameters, context).getFinalResult(); } /** @@ -937,25 +761,9 @@ public WebPubSubResourceInner createOrUpdate(String resourceGroupName, String re */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -964,34 +772,15 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context); + private Response deleteWithResponse(String resourceGroupName, String resourceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, Context.NONE); } /** @@ -999,16 +788,16 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); } /** @@ -1016,19 +805,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1043,7 +829,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { - return this.beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1060,7 +847,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1083,16 +871,13 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public void delete(String resourceGroupName, String resourceName) { + beginDelete(resourceGroupName, resourceName).getFinalResult(); } /** @@ -1100,259 +885,222 @@ private Mono deleteAsync(String resourceGroupName, String resourceName, Co * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName) { - deleteAsync(resourceGroupName, resourceName).block(); + public void delete(String resourceGroupName, String resourceName, Context context) { + beginDelete(resourceGroupName, resourceName, context).getFinalResult(); } /** - * Operation to delete a resource. + * Handles requests to list all resources in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, Context context) { - deleteAsync(resourceGroupName, resourceName, context).block(); + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource along with {@link Response} on successful completion of {@link Mono}. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of resources and a possible link for next set along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource along with {@link Response} on successful completion of {@link Mono}. + * @return object that includes an array of resources and a possible link for next set along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, parameters, accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebPubSubResourceInner> - beginUpdateAsync(String resourceGroupName, String resourceName, WebPubSubResourceInner parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WebPubSubResourceInner.class, WebPubSubResourceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebPubSubResourceInner> beginUpdateAsync( - String resourceGroupName, String resourceName, WebPubSubResourceInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, resourceName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WebPubSubResourceInner.class, WebPubSubResourceInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a resource. + * @return object that includes an array of resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebPubSubResourceInner> beginUpdate(String resourceGroupName, - String resourceName, WebPubSubResourceInner parameters) { - return this.beginUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WebPubSubResourceInner> beginUpdate(String resourceGroupName, - String resourceName, WebPubSubResourceInner parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource on successful completion of {@link Mono}. + * @return object that includes an array of resources and a possible link for next set along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters) { - return beginUpdateAsync(resourceGroupName, resourceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource on successful completion of {@link Mono}. + * @return object that includes an array of resources and a possible link for next set along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, resourceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebPubSubResourceInner update(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters) { - return updateAsync(resourceGroupName, resourceName, parameters).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** - * Operation to update an exiting resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameters for the update operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represent a resource. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebPubSubResourceInner update(String resourceGroupName, String resourceName, - WebPubSubResourceInner parameters, Context context) { - return updateAsync(resourceGroupName, resourceName, parameters, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -1368,21 +1116,6 @@ public WebPubSubResourceInner update(String resourceGroupName, String resourceNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1390,41 +1123,6 @@ private Mono> listKeysWithResponseAsync(String reso .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the access keys of the resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys of the resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context); - } - /** * Get the access keys of the resource. * @@ -1455,7 +1153,9 @@ private Mono listKeysAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse(String resourceGroupName, String resourceName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, resourceName, context).block(); + final String accept = "application/json"; + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); } /** @@ -1488,30 +1188,12 @@ public WebPubSubKeysInner listKeys(String resourceGroupName, String resourceName @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> regenerateKeyWithResponseAsync(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1521,40 +1203,19 @@ private Mono>> regenerateKeyWithResponseAsync(String r * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param parameters Parameter that describes the Regenerate Key Operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represents the access keys of the resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return a class represents the access keys of the resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> regenerateKeyWithResponseAsync(String resourceGroupName, - String resourceName, RegenerateKeyParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response regenerateKeyWithResponse(String resourceGroupName, String resourceName, + RegenerateKeyParameters parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, parameters, accept, context); + return service.regenerateKeySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, + Context.NONE); } /** @@ -1563,18 +1224,19 @@ private Mono>> regenerateKeyWithResponseAsync(String r * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a class represents the access keys of the resource. + * @return a class represents the access keys of the resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebPubSubKeysInner> - beginRegenerateKeyAsync(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { - Mono>> mono - = regenerateKeyWithResponseAsync(resourceGroupName, resourceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WebPubSubKeysInner.class, WebPubSubKeysInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response regenerateKeyWithResponse(String resourceGroupName, String resourceName, + RegenerateKeyParameters parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.regenerateKeySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, parameters, context); } /** @@ -1583,20 +1245,18 @@ private Mono>> regenerateKeyWithResponseAsync(String r * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param parameters Parameter that describes the Regenerate Key Operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of a class represents the access keys of the resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WebPubSubKeysInner> beginRegenerateKeyAsync( - String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, WebPubSubKeysInner> + beginRegenerateKeyAsync(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { Mono>> mono - = regenerateKeyWithResponseAsync(resourceGroupName, resourceName, parameters, context); + = regenerateKeyWithResponseAsync(resourceGroupName, resourceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WebPubSubKeysInner.class, WebPubSubKeysInner.class, context); + WebPubSubKeysInner.class, WebPubSubKeysInner.class, this.client.getContext()); } /** @@ -1613,7 +1273,9 @@ private PollerFlux, WebPubSubKeysInner> beginRege @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WebPubSubKeysInner> beginRegenerateKey(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { - return this.beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + Response response = regenerateKeyWithResponse(resourceGroupName, resourceName, parameters); + return this.client.getLroResult(response, WebPubSubKeysInner.class, + WebPubSubKeysInner.class, Context.NONE); } /** @@ -1631,25 +1293,9 @@ public SyncPoller, WebPubSubKeysInner> beginRegen @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WebPubSubKeysInner> beginRegenerateKey(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { - return this.beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); - } - - /** - * Regenerate the access key for the resource. PrimaryKey and SecondaryKey cannot be regenerated at the same time. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param parameters Parameter that describes the Regenerate Key Operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a class represents the access keys of the resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeyAsync(String resourceGroupName, String resourceName, - RegenerateKeyParameters parameters) { - return beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + Response response = regenerateKeyWithResponse(resourceGroupName, resourceName, parameters, context); + return this.client.getLroResult(response, WebPubSubKeysInner.class, + WebPubSubKeysInner.class, context); } /** @@ -1658,7 +1304,6 @@ private Mono regenerateKeyAsync(String resourceGroupName, St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param parameters Parameter that describes the Regenerate Key Operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1666,8 +1311,8 @@ private Mono regenerateKeyAsync(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono regenerateKeyAsync(String resourceGroupName, String resourceName, - RegenerateKeyParameters parameters, Context context) { - return beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters, context).last() + RegenerateKeyParameters parameters) { + return beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1685,7 +1330,7 @@ private Mono regenerateKeyAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public WebPubSubKeysInner regenerateKey(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { - return regenerateKeyAsync(resourceGroupName, resourceName, parameters).block(); + return beginRegenerateKey(resourceGroupName, resourceName, parameters).getFinalResult(); } /** @@ -1703,136 +1348,91 @@ public WebPubSubKeysInner regenerateKey(String resourceGroupName, String resourc @ServiceMethod(returns = ReturnType.SINGLE) public WebPubSubKeysInner regenerateKey(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { - return regenerateKeyAsync(resourceGroupName, resourceName, parameters, context).block(); + return beginRegenerateKey(resourceGroupName, resourceName, parameters, context).getFinalResult(); } /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listReplicaSkusWithResponseAsync(String resourceGroupName, String resourceName, - String replicaName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - final String accept = "application/json"; + private Mono>> restartWithResponseAsync(String resourceGroupName, String resourceName) { return FluxUtil - .withContext(context -> service.listReplicaSkus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, replicaName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listReplicaSkusWithResponseAsync(String resourceGroupName, String resourceName, - String replicaName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (replicaName == null) { - return Mono.error(new IllegalArgumentException("Parameter replicaName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listReplicaSkus(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, replicaName, this.client.getApiVersion(), accept, context); + private Response restartWithResponse(String resourceGroupName, String resourceName) { + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, Context.NONE); } /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listReplicaSkusAsync(String resourceGroupName, String resourceName, String replicaName) { - return listReplicaSkusWithResponseAsync(resourceGroupName, resourceName, replicaName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Response restartWithResponse(String resourceGroupName, String resourceName, Context context) { + return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); } /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response along with {@link Response}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listReplicaSkusWithResponse(String resourceGroupName, String resourceName, - String replicaName, Context context) { - return listReplicaSkusWithResponseAsync(resourceGroupName, resourceName, replicaName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String resourceName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, resourceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SkuListInner listReplicaSkus(String resourceGroupName, String resourceName, String replicaName) { - return listReplicaSkusWithResponse(resourceGroupName, resourceName, replicaName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName) { + Response response = restartWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1840,33 +1440,17 @@ public SkuListInner listReplicaSkus(String resourceGroupName, String resourceNam * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName, + Context context) { + Response response = restartWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1874,34 +1458,14 @@ private Mono>> restartWithResponseAsync(String resourc * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> restartWithResponseAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.restart(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context); + private Mono restartAsync(String resourceGroupName, String resourceName) { + return beginRestartAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1912,13 +1476,10 @@ private Mono>> restartWithResponseAsync(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String resourceName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, resourceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String resourceName) { + beginRestart(resourceGroupName, resourceName).getFinalResult(); } /** @@ -1930,224 +1491,227 @@ private PollerFlux, Void> beginRestartAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String resourceName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = restartWithResponseAsync(resourceGroupName, resourceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String resourceName, Context context) { + beginRestart(resourceGroupName, resourceName, context).getFinalResult(); } /** - * Operation to restart a resource. + * List all available skus of the resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the list skus operation response along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName) { - return this.beginRestartAsync(resourceGroupName, resourceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkusWithResponseAsync(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSkus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to restart a resource. + * List all available skus of the resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the list skus operation response on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName, - Context context) { - return this.beginRestartAsync(resourceGroupName, resourceName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSkusAsync(String resourceGroupName, String resourceName) { + return listSkusWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Operation to restart a resource. + * List all available skus of the resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the list skus operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String resourceName) { - return beginRestartAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + public Response listSkusWithResponse(String resourceGroupName, String resourceName, Context context) { + final String accept = "application/json"; + return service.listSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); } /** - * Operation to restart a resource. + * List all available skus of the resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the list skus operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono restartAsync(String resourceGroupName, String resourceName, Context context) { - return beginRestartAsync(resourceGroupName, resourceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public SkuListInner listSkus(String resourceGroupName, String resourceName) { + return listSkusWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); } /** - * Operation to restart a resource. + * List all available skus of the replica resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list skus operation response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String resourceName) { - restartAsync(resourceGroupName, resourceName).block(); + private Mono> listReplicaSkusWithResponseAsync(String resourceGroupName, String resourceName, + String replicaName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listReplicaSkus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Operation to restart a resource. + * List all available skus of the replica resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list skus operation response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String resourceName, Context context) { - restartAsync(resourceGroupName, resourceName, context).block(); + private Mono listReplicaSkusAsync(String resourceGroupName, String resourceName, String replicaName) { + return listReplicaSkusWithResponseAsync(resourceGroupName, resourceName, replicaName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all available skus of the resource. + * List all available skus of the replica resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response along with {@link Response} on successful completion of {@link Mono}. + * @return the list skus operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusWithResponseAsync(String resourceGroupName, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } + public Response listReplicaSkusWithResponse(String resourceGroupName, String resourceName, + String replicaName, Context context) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSkus(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.listReplicaSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, replicaName, accept, context); } /** - * List all available skus of the resource. + * List all available skus of the replica resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response along with {@link Response} on successful completion of {@link Mono}. + * @return the list skus operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusWithResponseAsync(String resourceGroupName, String resourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } + public SkuListInner listReplicaSkus(String resourceGroupName, String resourceName, String replicaName) { + return listReplicaSkusWithResponse(resourceGroupName, resourceName, replicaName, Context.NONE).getValue(); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location The location name. + * @param parameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to check name availability along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync(String location, + NameAvailabilityParameters parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listSkus(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context); + return FluxUtil + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all available skus of the resource. + * Checks that the resource name is valid and is not already in use. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. + * @param location The location name. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response on successful completion of {@link Mono}. + * @return result of the request to check name availability on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listSkusAsync(String resourceGroupName, String resourceName) { - return listSkusWithResponseAsync(resourceGroupName, resourceName) + private Mono checkNameAvailabilityAsync(String location, + NameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponseAsync(location, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all available skus of the resource. + * Checks that the resource name is valid and is not already in use. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. + * @param location The location name. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response along with {@link Response}. + * @return result of the request to check name availability along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSkusWithResponse(String resourceGroupName, String resourceName, Context context) { - return listSkusWithResponseAsync(resourceGroupName, resourceName, context).block(); + public Response checkNameAvailabilityWithResponse(String location, + NameAvailabilityParameters parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, parameters, context); } /** - * List all available skus of the resource. + * Checks that the resource name is valid and is not already in use. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. + * @param location The location name. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response. + * @return result of the request to check name availability. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SkuListInner listSkus(String resourceGroupName, String resourceName) { - return listSkusWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + public NameAvailabilityInner checkNameAvailability(String location, NameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponse(location, parameters, Context.NONE).getValue(); } /** @@ -2161,23 +1725,35 @@ public SkuListInner listSkus(String resourceGroupName, String resourceName) { * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of resources and a possible link for next set along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2187,23 +1763,15 @@ private Mono> listBySubscriptionNextSingle * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of resources and a possible link for next set along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2217,23 +1785,35 @@ private Mono> listBySubscriptionNextSingle * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of resources and a possible link for next set along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2243,22 +1823,14 @@ private Mono> listByResourceGroupNextSingl * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of resources and a possible link for next set along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsImpl.java index d57387afa44a..ece306172897 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.implementation; @@ -35,35 +35,29 @@ public WebPubSubsImpl(WebPubSubsClient innerClient, this.serviceManager = serviceManager; } - public Response checkNameAvailabilityWithResponse(String location, - NameAvailabilityParameters parameters, Context context) { - Response inner - = this.serviceClient().checkNameAvailabilityWithResponse(location, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new NameAvailabilityImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WebPubSubResourceImpl(inner.getValue(), this.manager())); } - public NameAvailability checkNameAvailability(String location, NameAvailabilityParameters parameters) { - NameAvailabilityInner inner = this.serviceClient().checkNameAvailability(location, parameters); + public WebPubSubResource getByResourceGroup(String resourceGroupName, String resourceName) { + WebPubSubResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); if (inner != null) { - return new NameAvailabilityImpl(inner, this.manager()); + return new WebPubSubResourceImpl(inner, this.manager()); } else { return null; } } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubResourceImpl(inner1, this.manager())); + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubResourceImpl(inner1, this.manager())); + public void delete(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, context); } public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -77,45 +71,22 @@ public PagedIterable listByResourceGroup(String resourceGroup return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubResourceImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new WebPubSubResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public WebPubSubResource getByResourceGroup(String resourceGroupName, String resourceName) { - WebPubSubResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); - if (inner != null) { - return new WebPubSubResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String resourceName) { - this.serviceClient().delete(resourceGroupName, resourceName); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubResourceImpl(inner1, this.manager())); } - public void delete(String resourceGroupName, String resourceName, Context context) { - this.serviceClient().delete(resourceGroupName, resourceName, context); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new WebPubSubResourceImpl(inner1, this.manager())); } public Response listKeysWithResponse(String resourceGroupName, String resourceName, Context context) { Response inner = this.serviceClient().listKeysWithResponse(resourceGroupName, resourceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new WebPubSubKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new WebPubSubKeysImpl(inner.getValue(), this.manager())); } public WebPubSubKeys listKeys(String resourceGroupName, String resourceName) { @@ -148,27 +119,6 @@ public WebPubSubKeys regenerateKey(String resourceGroupName, String resourceName } } - public Response listReplicaSkusWithResponse(String resourceGroupName, String resourceName, - String replicaName, Context context) { - Response inner - = this.serviceClient().listReplicaSkusWithResponse(resourceGroupName, resourceName, replicaName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SkuListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SkuList listReplicaSkus(String resourceGroupName, String resourceName, String replicaName) { - SkuListInner inner = this.serviceClient().listReplicaSkus(resourceGroupName, resourceName, replicaName); - if (inner != null) { - return new SkuListImpl(inner, this.manager()); - } else { - return null; - } - } - public void restart(String resourceGroupName, String resourceName) { this.serviceClient().restart(resourceGroupName, resourceName); } @@ -180,16 +130,29 @@ public void restart(String resourceGroupName, String resourceName, Context conte public Response listSkusWithResponse(String resourceGroupName, String resourceName, Context context) { Response inner = this.serviceClient().listSkusWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SkuListImpl(inner.getValue(), this.manager())); + } + + public SkuList listSkus(String resourceGroupName, String resourceName) { + SkuListInner inner = this.serviceClient().listSkus(resourceGroupName, resourceName); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SkuListImpl(inner.getValue(), this.manager())); + return new SkuListImpl(inner, this.manager()); } else { return null; } } - public SkuList listSkus(String resourceGroupName, String resourceName) { - SkuListInner inner = this.serviceClient().listSkus(resourceGroupName, resourceName); + public Response listReplicaSkusWithResponse(String resourceGroupName, String resourceName, + String replicaName, Context context) { + Response inner + = this.serviceClient().listReplicaSkusWithResponse(resourceGroupName, resourceName, replicaName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SkuListImpl(inner.getValue(), this.manager())); + } + + public SkuList listReplicaSkus(String resourceGroupName, String resourceName, String replicaName) { + SkuListInner inner = this.serviceClient().listReplicaSkus(resourceGroupName, resourceName, replicaName); if (inner != null) { return new SkuListImpl(inner, this.manager()); } else { @@ -197,6 +160,23 @@ public SkuList listSkus(String resourceGroupName, String resourceName) { } } + public Response checkNameAvailabilityWithResponse(String location, + NameAvailabilityParameters parameters, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(location, parameters, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NameAvailabilityImpl(inner.getValue(), this.manager())); + } + + public NameAvailability checkNameAvailability(String location, NameAvailabilityParameters parameters) { + NameAvailabilityInner inner = this.serviceClient().checkNameAvailability(location, parameters); + if (inner != null) { + return new NameAvailabilityImpl(inner, this.manager()); + } else { + return null; + } + } + public WebPubSubResource getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomCertificateList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/CustomCertificateList.java similarity index 62% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomCertificateList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/CustomCertificateList.java index 5ba9dc8298f8..bf2ad1d46872 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomCertificateList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/CustomCertificateList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * Custom certificates list. */ -@Fluent +@Immutable public final class CustomCertificateList implements JsonSerializable { /* - * List of custom certificates of this resource. + * The CustomCertificate items on this page */ private List value; /* - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of CustomCertificateList class. */ - public CustomCertificateList() { + private CustomCertificateList() { } /** - * Get the value property: List of custom certificates of this resource. + * Get the value property: The CustomCertificate items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: List of custom certificates of this resource. - * - * @param value the value value to set. - * @return the CustomCertificateList object itself. - */ - public CustomCertificateList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the CustomCertificateList object itself. - */ - public CustomCertificateList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of CustomCertificateList if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the CustomCertificateList. */ public static CustomCertificateList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomDomainList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/CustomDomainList.java similarity index 61% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomDomainList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/CustomDomainList.java index 89eb81d05cce..871e104a606d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomDomainList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/CustomDomainList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * Custom domains list. */ -@Fluent +@Immutable public final class CustomDomainList implements JsonSerializable { /* - * List of custom domains that bind to this resource. + * The CustomDomain items on this page */ private List value; /* - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of CustomDomainList class. */ - public CustomDomainList() { + private CustomDomainList() { } /** - * Get the value property: List of custom domains that bind to this resource. + * Get the value property: The CustomDomain items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: List of custom domains that bind to this resource. - * - * @param value the value value to set. - * @return the CustomDomainList object itself. - */ - public CustomDomainList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the CustomDomainList object itself. - */ - public CustomDomainList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of CustomDomainList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the CustomDomainList. */ public static CustomDomainList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/OperationList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/OperationList.java similarity index 59% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/OperationList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/OperationList.java index 2bfa1b249a7c..56b374a50f16 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/OperationList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/OperationList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,29 +14,28 @@ import java.util.List; /** - * Result of the request to list REST API operations. It contains a list of operations. + * Paged collection of Operation items. */ -@Fluent +@Immutable public final class OperationList implements JsonSerializable { /* - * List of operations supported by the resource provider. + * The Operation items on this page */ private List value; /* - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationList class. */ - public OperationList() { + private OperationList() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: List of operations supported by the resource provider. - * - * @param value the value value to set. - * @return the OperationList object itself. - */ - public OperationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the OperationList object itself. - */ - public OperationList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationList. */ public static OperationList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PersistentStorageList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PersistentStorageList.java new file mode 100644 index 000000000000..11aa59dae7ab --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PersistentStorageList.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner; +import java.io.IOException; +import java.util.List; + +/** + * Persistent storages list. + */ +@Immutable +public final class PersistentStorageList implements JsonSerializable { + /* + * The PersistentStorage items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PersistentStorageList class. + */ + private PersistentStorageList() { + } + + /** + * Get the value property: The PersistentStorage items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PersistentStorageList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PersistentStorageList if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PersistentStorageList. + */ + public static PersistentStorageList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PersistentStorageList deserializedPersistentStorageList = new PersistentStorageList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PersistentStorageInner.fromJson(reader1)); + deserializedPersistentStorageList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPersistentStorageList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPersistentStorageList; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointConnectionList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PrivateEndpointConnectionList.java similarity index 60% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointConnectionList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PrivateEndpointConnectionList.java index 18117463dcd8..d63ff2db8dc6 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointConnectionList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PrivateEndpointConnectionList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * A list of private endpoint connections. */ -@Fluent +@Immutable public final class PrivateEndpointConnectionList implements JsonSerializable { /* - * The list of the private endpoint connections + * The PrivateEndpointConnection items on this page */ private List value; /* - * Request URL that can be used to query next page of private endpoint connections. Returned when the total number - * of requested private endpoint connections exceed maximum page size. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PrivateEndpointConnectionList class. */ - public PrivateEndpointConnectionList() { + private PrivateEndpointConnectionList() { } /** - * Get the value property: The list of the private endpoint connections. + * Get the value property: The PrivateEndpointConnection items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: The list of the private endpoint connections. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionList object itself. - */ - public PrivateEndpointConnectionList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Request URL that can be used to query next page of private endpoint connections. - * Returned when the total number of requested private endpoint connections exceed maximum page size. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Request URL that can be used to query next page of private endpoint connections. - * Returned when the total number of requested private endpoint connections exceed maximum page size. - * - * @param nextLink the nextLink value to set. - * @return the PrivateEndpointConnectionList object itself. - */ - public PrivateEndpointConnectionList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PrivateEndpointConnectionList if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the PrivateEndpointConnectionList. */ public static PrivateEndpointConnectionList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkResourceList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PrivateLinkResourceList.java similarity index 63% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkResourceList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PrivateLinkResourceList.java index 09683bcd7771..744bb6022a10 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkResourceList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PrivateLinkResourceList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * Contains a list of PrivateLinkResource and a possible link to query more results. */ -@Fluent +@Immutable public final class PrivateLinkResourceList implements JsonSerializable { /* - * List of PrivateLinkResource + * The PrivateLinkResource items on this page */ private List value; /* - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PrivateLinkResourceList class. */ - public PrivateLinkResourceList() { + private PrivateLinkResourceList() { } /** - * Get the value property: List of PrivateLinkResource. + * Get the value property: The PrivateLinkResource items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: List of PrivateLinkResource. - * - * @param value the value value to set. - * @return the PrivateLinkResourceList object itself. - */ - public PrivateLinkResourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the PrivateLinkResourceList object itself. - */ - public PrivateLinkResourceList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PrivateLinkResourceList if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the PrivateLinkResourceList. */ public static PrivateLinkResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ReplicaList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/ReplicaList.java similarity index 61% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ReplicaList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/ReplicaList.java index aa872ab69c66..fefecd27c2e0 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ReplicaList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/ReplicaList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,29 +14,28 @@ import java.util.List; /** - * The ReplicaList model. + * Paged collection of Replica items. */ -@Fluent +@Immutable public final class ReplicaList implements JsonSerializable { /* - * List of the replica + * The Replica items on this page */ private List value; /* - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ReplicaList class. */ - public ReplicaList() { + private ReplicaList() { } /** - * Get the value property: List of the replica. + * Get the value property: The Replica items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: List of the replica. - * - * @param value the value value to set. - * @return the ReplicaList object itself. - */ - public ReplicaList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the ReplicaList object itself. - */ - public ReplicaList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ReplicaList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ReplicaList. */ public static ReplicaList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResourceList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/SharedPrivateLinkResourceList.java similarity index 60% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResourceList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/SharedPrivateLinkResourceList.java index a9d33c8cd4ad..2b28c764ceeb 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResourceList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/SharedPrivateLinkResourceList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * A list of shared private link resources. */ -@Fluent +@Immutable public final class SharedPrivateLinkResourceList implements JsonSerializable { /* - * The list of the shared private link resources + * The SharedPrivateLinkResource items on this page */ private List value; /* - * Request URL that can be used to query next page of private endpoint connections. Returned when the total number - * of requested private endpoint connections exceed maximum page size. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of SharedPrivateLinkResourceList class. */ - public SharedPrivateLinkResourceList() { + private SharedPrivateLinkResourceList() { } /** - * Get the value property: The list of the shared private link resources. + * Get the value property: The SharedPrivateLinkResource items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: The list of the shared private link resources. - * - * @param value the value value to set. - * @return the SharedPrivateLinkResourceList object itself. - */ - public SharedPrivateLinkResourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Request URL that can be used to query next page of private endpoint connections. - * Returned when the total number of requested private endpoint connections exceed maximum page size. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Request URL that can be used to query next page of private endpoint connections. - * Returned when the total number of requested private endpoint connections exceed maximum page size. - * - * @param nextLink the nextLink value to set. - * @return the SharedPrivateLinkResourceList object itself. - */ - public SharedPrivateLinkResourceList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of SharedPrivateLinkResourceList if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the SharedPrivateLinkResourceList. */ public static SharedPrivateLinkResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsageList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/SignalRServiceUsageList.java similarity index 63% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsageList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/SignalRServiceUsageList.java index ae2a0c44200e..21ad0e5c3ea7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsageList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/SignalRServiceUsageList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * Object that includes an array of the resource usages and a possible link for next set. */ -@Fluent +@Immutable public final class SignalRServiceUsageList implements JsonSerializable { /* - * List of the resource usages + * The SignalRServiceUsage items on this page */ private List value; /* - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of SignalRServiceUsageList class. */ - public SignalRServiceUsageList() { + private SignalRServiceUsageList() { } /** - * Get the value property: List of the resource usages. + * Get the value property: The SignalRServiceUsage items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: List of the resource usages. - * - * @param value the value value to set. - * @return the SignalRServiceUsageList object itself. - */ - public SignalRServiceUsageList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the SignalRServiceUsageList object itself. - */ - public SignalRServiceUsageList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of SignalRServiceUsageList if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the SignalRServiceUsageList. */ public static SignalRServiceUsageList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/WebPubSubHubList.java similarity index 68% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/WebPubSubHubList.java index 16490160fc69..450c2b5a6030 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/WebPubSubHubList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * Hub setting list. */ -@Fluent +@Immutable public final class WebPubSubHubList implements JsonSerializable { /* - * List of hub settings to this resource. + * The WebPubSubHub items on this page */ private List value; /* - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of WebPubSubHubList class. */ - public WebPubSubHubList() { + private WebPubSubHubList() { } /** - * Get the value property: List of hub settings to this resource. + * Get the value property: The WebPubSubHub items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: List of hub settings to this resource. - * - * @param value the value value to set. - * @return the WebPubSubHubList object itself. - */ - public WebPubSubHubList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,17 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -83,6 +59,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -92,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of WebPubSubHubList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the WebPubSubHubList. */ public static WebPubSubHubList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubResourceList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/WebPubSubResourceList.java similarity index 63% rename from sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubResourceList.java rename to sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/WebPubSubResourceList.java index 854e4c046200..3066a4a49756 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubResourceList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/WebPubSubResourceList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.webpubsub.models; +package com.azure.resourcemanager.webpubsub.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +16,26 @@ /** * Object that includes an array of resources and a possible link for next set. */ -@Fluent +@Immutable public final class WebPubSubResourceList implements JsonSerializable { /* - * List of the resources + * The WebPubSubResource items on this page */ private List value; /* - * The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of WebPubSubResourceList class. */ - public WebPubSubResourceList() { + private WebPubSubResourceList() { } /** - * Get the value property: List of the resources. + * Get the value property: The WebPubSubResource items on this page. * * @return the value value. */ @@ -45,19 +44,7 @@ public List value() { } /** - * Set the value property: List of the resources. - * - * @param value the value value to set. - * @return the WebPubSubResourceList object itself. - */ - public WebPubSubResourceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,29 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the WebPubSubResourceList object itself. - */ - public WebPubSubResourceList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of WebPubSubResourceList if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the WebPubSubResourceList. */ public static WebPubSubResourceList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/package-info.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/package-info.java index 20a6d6b7f145..c0562950f78c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/package-info.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for WebPubSubManagementClient. + * Package containing the implementations for WebPubSub. * REST API for Azure WebPubSub Service. */ package com.azure.resourcemanager.webpubsub.implementation; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/AclAction.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/AclAction.java index 77039306ce7e..5f58f2d6de15 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/AclAction.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/AclAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ApplicationFirewallSettings.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ApplicationFirewallSettings.java new file mode 100644 index 000000000000..4a71b3809681 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ApplicationFirewallSettings.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Application firewall settings for the resource. + */ +@Fluent +public final class ApplicationFirewallSettings implements JsonSerializable { + /* + * Rules to control the client connection count + */ + private List clientConnectionCountRules; + + /* + * Rules to control the client traffic + */ + private List clientTrafficControlRules; + + /* + * Config to control the client connection lifetime in seconds, can be set to 0 to disable the config + */ + private Long maxClientConnectionLifetimeInSeconds; + + /** + * Creates an instance of ApplicationFirewallSettings class. + */ + public ApplicationFirewallSettings() { + } + + /** + * Get the clientConnectionCountRules property: Rules to control the client connection count. + * + * @return the clientConnectionCountRules value. + */ + public List clientConnectionCountRules() { + return this.clientConnectionCountRules; + } + + /** + * Set the clientConnectionCountRules property: Rules to control the client connection count. + * + * @param clientConnectionCountRules the clientConnectionCountRules value to set. + * @return the ApplicationFirewallSettings object itself. + */ + public ApplicationFirewallSettings + withClientConnectionCountRules(List clientConnectionCountRules) { + this.clientConnectionCountRules = clientConnectionCountRules; + return this; + } + + /** + * Get the clientTrafficControlRules property: Rules to control the client traffic. + * + * @return the clientTrafficControlRules value. + */ + public List clientTrafficControlRules() { + return this.clientTrafficControlRules; + } + + /** + * Set the clientTrafficControlRules property: Rules to control the client traffic. + * + * @param clientTrafficControlRules the clientTrafficControlRules value to set. + * @return the ApplicationFirewallSettings object itself. + */ + public ApplicationFirewallSettings + withClientTrafficControlRules(List clientTrafficControlRules) { + this.clientTrafficControlRules = clientTrafficControlRules; + return this; + } + + /** + * Get the maxClientConnectionLifetimeInSeconds property: Config to control the client connection lifetime in + * seconds, can be set to 0 to disable the config. + * + * @return the maxClientConnectionLifetimeInSeconds value. + */ + public Long maxClientConnectionLifetimeInSeconds() { + return this.maxClientConnectionLifetimeInSeconds; + } + + /** + * Set the maxClientConnectionLifetimeInSeconds property: Config to control the client connection lifetime in + * seconds, can be set to 0 to disable the config. + * + * @param maxClientConnectionLifetimeInSeconds the maxClientConnectionLifetimeInSeconds value to set. + * @return the ApplicationFirewallSettings object itself. + */ + public ApplicationFirewallSettings + withMaxClientConnectionLifetimeInSeconds(Long maxClientConnectionLifetimeInSeconds) { + this.maxClientConnectionLifetimeInSeconds = maxClientConnectionLifetimeInSeconds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("clientConnectionCountRules", this.clientConnectionCountRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("clientTrafficControlRules", this.clientTrafficControlRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("maxClientConnectionLifetimeInSeconds", this.maxClientConnectionLifetimeInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationFirewallSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationFirewallSettings if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationFirewallSettings. + */ + public static ApplicationFirewallSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationFirewallSettings deserializedApplicationFirewallSettings = new ApplicationFirewallSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientConnectionCountRules".equals(fieldName)) { + List clientConnectionCountRules + = reader.readArray(reader1 -> ClientConnectionCountRule.fromJson(reader1)); + deserializedApplicationFirewallSettings.clientConnectionCountRules = clientConnectionCountRules; + } else if ("clientTrafficControlRules".equals(fieldName)) { + List clientTrafficControlRules + = reader.readArray(reader1 -> ClientTrafficControlRule.fromJson(reader1)); + deserializedApplicationFirewallSettings.clientTrafficControlRules = clientTrafficControlRules; + } else if ("maxClientConnectionLifetimeInSeconds".equals(fieldName)) { + deserializedApplicationFirewallSettings.maxClientConnectionLifetimeInSeconds + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationFirewallSettings; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ChatSettings.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ChatSettings.java new file mode 100644 index 000000000000..ce1e000da689 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ChatSettings.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Chat settings. + */ +@Fluent +public final class ChatSettings implements JsonSerializable { + /* + * Enable or disable the chat feature. + */ + private String mode; + + /* + * Reference to the the persistent storage for perisisting chat states. + */ + private ResourceReference persistentStorage; + + /** + * Creates an instance of ChatSettings class. + */ + public ChatSettings() { + } + + /** + * Get the mode property: Enable or disable the chat feature. + * + * @return the mode value. + */ + public String mode() { + return this.mode; + } + + /** + * Set the mode property: Enable or disable the chat feature. + * + * @param mode the mode value to set. + * @return the ChatSettings object itself. + */ + public ChatSettings withMode(String mode) { + this.mode = mode; + return this; + } + + /** + * Get the persistentStorage property: Reference to the the persistent storage for perisisting chat states. + * + * @return the persistentStorage value. + */ + public ResourceReference persistentStorage() { + return this.persistentStorage; + } + + /** + * Set the persistentStorage property: Reference to the the persistent storage for perisisting chat states. + * + * @param persistentStorage the persistentStorage value to set. + * @return the ChatSettings object itself. + */ + public ChatSettings withPersistentStorage(ResourceReference persistentStorage) { + this.persistentStorage = persistentStorage; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode); + jsonWriter.writeJsonField("persistentStorage", this.persistentStorage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChatSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChatSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ChatSettings. + */ + public static ChatSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChatSettings deserializedChatSettings = new ChatSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedChatSettings.mode = reader.getString(); + } else if ("persistentStorage".equals(fieldName)) { + deserializedChatSettings.persistentStorage = ResourceReference.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedChatSettings; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientConnectionCountRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientConnectionCountRule.java new file mode 100644 index 000000000000..1a69830f33df --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientConnectionCountRule.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A base class for client connection count rules. + */ +@Immutable +public class ClientConnectionCountRule implements JsonSerializable { + /* + * The type property. + */ + private ClientConnectionCountRuleDiscriminator type + = ClientConnectionCountRuleDiscriminator.fromString("ClientConnectionCountRule"); + + /** + * Creates an instance of ClientConnectionCountRule class. + */ + public ClientConnectionCountRule() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public ClientConnectionCountRuleDiscriminator type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientConnectionCountRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientConnectionCountRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientConnectionCountRule. + */ + public static ClientConnectionCountRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ThrottleByJwtCustomClaimRule".equals(discriminatorValue)) { + return ThrottleByJwtCustomClaimRule.fromJson(readerToUse.reset()); + } else if ("ThrottleByJwtSignatureRule".equals(discriminatorValue)) { + return ThrottleByJwtSignatureRule.fromJson(readerToUse.reset()); + } else if ("ThrottleByUserIdRule".equals(discriminatorValue)) { + return ThrottleByUserIdRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClientConnectionCountRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientConnectionCountRule deserializedClientConnectionCountRule = new ClientConnectionCountRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedClientConnectionCountRule.type + = ClientConnectionCountRuleDiscriminator.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClientConnectionCountRule; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientConnectionCountRuleDiscriminator.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientConnectionCountRuleDiscriminator.java new file mode 100644 index 000000000000..32edbfb31f59 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientConnectionCountRuleDiscriminator.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ClientConnectionCountRuleDiscriminator. + */ +public final class ClientConnectionCountRuleDiscriminator + extends ExpandableStringEnum { + /** + * Static value ThrottleByJwtSignatureRule for ClientConnectionCountRuleDiscriminator. + */ + public static final ClientConnectionCountRuleDiscriminator THROTTLE_BY_JWT_SIGNATURE_RULE + = fromString("ThrottleByJwtSignatureRule"); + + /** + * Static value ThrottleByUserIdRule for ClientConnectionCountRuleDiscriminator. + */ + public static final ClientConnectionCountRuleDiscriminator THROTTLE_BY_USER_ID_RULE + = fromString("ThrottleByUserIdRule"); + + /** + * Static value ThrottleByJwtCustomClaimRule for ClientConnectionCountRuleDiscriminator. + */ + public static final ClientConnectionCountRuleDiscriminator THROTTLE_BY_JWT_CUSTOM_CLAIM_RULE + = fromString("ThrottleByJwtCustomClaimRule"); + + /** + * Creates a new instance of ClientConnectionCountRuleDiscriminator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClientConnectionCountRuleDiscriminator() { + } + + /** + * Creates or finds a ClientConnectionCountRuleDiscriminator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClientConnectionCountRuleDiscriminator. + */ + public static ClientConnectionCountRuleDiscriminator fromString(String name) { + return fromString(name, ClientConnectionCountRuleDiscriminator.class); + } + + /** + * Gets known ClientConnectionCountRuleDiscriminator values. + * + * @return known ClientConnectionCountRuleDiscriminator values. + */ + public static Collection values() { + return values(ClientConnectionCountRuleDiscriminator.class); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientTrafficControlRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientTrafficControlRule.java new file mode 100644 index 000000000000..9b8e872754f8 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientTrafficControlRule.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A base class for client traffic control rules. + */ +@Immutable +public class ClientTrafficControlRule implements JsonSerializable { + /* + * The type property. + */ + private ClientTrafficControlRuleDiscriminator type + = ClientTrafficControlRuleDiscriminator.fromString("ClientTrafficControlRule"); + + /** + * Creates an instance of ClientTrafficControlRule class. + */ + public ClientTrafficControlRule() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + public ClientTrafficControlRuleDiscriminator type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClientTrafficControlRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClientTrafficControlRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClientTrafficControlRule. + */ + public static ClientTrafficControlRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("TrafficThrottleByJwtCustomClaimRule".equals(discriminatorValue)) { + return TrafficThrottleByJwtCustomClaimRule.fromJson(readerToUse.reset()); + } else if ("TrafficThrottleByJwtSignatureRule".equals(discriminatorValue)) { + return TrafficThrottleByJwtSignatureRule.fromJson(readerToUse.reset()); + } else if ("TrafficThrottleByUserIdRule".equals(discriminatorValue)) { + return TrafficThrottleByUserIdRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ClientTrafficControlRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClientTrafficControlRule deserializedClientTrafficControlRule = new ClientTrafficControlRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedClientTrafficControlRule.type + = ClientTrafficControlRuleDiscriminator.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedClientTrafficControlRule; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientTrafficControlRuleDiscriminator.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientTrafficControlRuleDiscriminator.java new file mode 100644 index 000000000000..1a631eeebcc8 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ClientTrafficControlRuleDiscriminator.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ClientTrafficControlRuleDiscriminator. + */ +public final class ClientTrafficControlRuleDiscriminator + extends ExpandableStringEnum { + /** + * Static value TrafficThrottleByJwtSignatureRule for ClientTrafficControlRuleDiscriminator. + */ + public static final ClientTrafficControlRuleDiscriminator TRAFFIC_THROTTLE_BY_JWT_SIGNATURE_RULE + = fromString("TrafficThrottleByJwtSignatureRule"); + + /** + * Static value TrafficThrottleByUserIdRule for ClientTrafficControlRuleDiscriminator. + */ + public static final ClientTrafficControlRuleDiscriminator TRAFFIC_THROTTLE_BY_USER_ID_RULE + = fromString("TrafficThrottleByUserIdRule"); + + /** + * Static value TrafficThrottleByJwtCustomClaimRule for ClientTrafficControlRuleDiscriminator. + */ + public static final ClientTrafficControlRuleDiscriminator TRAFFIC_THROTTLE_BY_JWT_CUSTOM_CLAIM_RULE + = fromString("TrafficThrottleByJwtCustomClaimRule"); + + /** + * Creates a new instance of ClientTrafficControlRuleDiscriminator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClientTrafficControlRuleDiscriminator() { + } + + /** + * Creates or finds a ClientTrafficControlRuleDiscriminator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClientTrafficControlRuleDiscriminator. + */ + public static ClientTrafficControlRuleDiscriminator fromString(String name) { + return fromString(name, ClientTrafficControlRuleDiscriminator.class); + } + + /** + * Gets known ClientTrafficControlRuleDiscriminator values. + * + * @return known ClientTrafficControlRuleDiscriminator values. + */ + public static Collection values() { + return values(ClientTrafficControlRuleDiscriminator.class); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomCertificate.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomCertificate.java index 9e0c1ce46339..a6509d7691ed 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomCertificate.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomCertificate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomDomain.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomDomain.java index 26caa91060bb..41220a77bbe9 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomDomain.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/CustomDomain.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Dimension.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Dimension.java index e32509b66848..29b1e139669d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Dimension.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Dimension.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Specifications of the Dimension of metrics. */ -@Fluent +@Immutable public final class Dimension implements JsonSerializable { /* * The public facing name of the dimension. @@ -39,7 +39,7 @@ public final class Dimension implements JsonSerializable { /** * Creates an instance of Dimension class. */ - public Dimension() { + private Dimension() { } /** @@ -51,17 +51,6 @@ public String name() { return this.name; } - /** - * Set the name property: The public facing name of the dimension. - * - * @param name the name value to set. - * @return the Dimension object itself. - */ - public Dimension withName(String name) { - this.name = name; - return this; - } - /** * Get the displayName property: Localized friendly display name of the dimension. * @@ -71,17 +60,6 @@ public String displayName() { return this.displayName; } - /** - * Set the displayName property: Localized friendly display name of the dimension. - * - * @param displayName the displayName value to set. - * @return the Dimension object itself. - */ - public Dimension withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - /** * Get the internalName property: Name of the dimension as it appears in MDM. * @@ -91,17 +69,6 @@ public String internalName() { return this.internalName; } - /** - * Set the internalName property: Name of the dimension as it appears in MDM. - * - * @param internalName the internalName value to set. - * @return the Dimension object itself. - */ - public Dimension withInternalName(String internalName) { - this.internalName = internalName; - return this; - } - /** * Get the toBeExportedForShoebox property: A Boolean flag indicating whether this dimension should be included for * the shoebox export scenario. @@ -112,26 +79,6 @@ public Boolean toBeExportedForShoebox() { return this.toBeExportedForShoebox; } - /** - * Set the toBeExportedForShoebox property: A Boolean flag indicating whether this dimension should be included for - * the shoebox export scenario. - * - * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. - * @return the Dimension object itself. - */ - public Dimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { - this.toBeExportedForShoebox = toBeExportedForShoebox; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventHandler.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventHandler.java index dc68d6aa40b5..9ea8c5b35c61 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventHandler.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventHandler.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -19,9 +18,14 @@ @Fluent public final class EventHandler implements JsonSerializable { /* - * Gets or sets the EventHandler URL template. You can use a predefined parameter {hub} and {event} inside the - * template, the value of the EventHandler URL is dynamically calculated when the client request comes in. - * For example, UrlTemplate can be `http://example.com/api/{hub}/{event}`. The host part can't contains parameters. + * Gets or sets the URL template for the event handler. The actual URL is calculated when the corresponding event is + * triggered. + * The template supports predefined parameters syntax: `{event}`, `{hub}`, and KeyVault reference syntax + * `{@Microsoft.KeyVault(SecretUri=_your_secret_identifier_)}` + * For example, if the template is `http://example.com/api/{event}`, when `connect` event is triggered, a POST + * request will be sent to the URL `http://example.com/chat/api/connect`. + * Note: Parameters are not allowed in the hostname of the URL, and curly brackets `{}` are reserved for parameter + * syntax only. If your URL path contains literal curly brackets, please URL-encode them to ensure proper handling. */ private String urlTemplate; @@ -44,6 +48,13 @@ public final class EventHandler implements JsonSerializable { */ private UpstreamAuthSettings auth; + /* + * The group presence events that this event handler is concerned with. Group presence events are triggered when + * connections join or leave groups in the hub. If the value is null, no presence events will be sent to this event + * handler. + */ + private GroupPresenceEventFilters groupPresenceEvents; + /** * Creates an instance of EventHandler class. */ @@ -51,10 +62,14 @@ public EventHandler() { } /** - * Get the urlTemplate property: Gets or sets the EventHandler URL template. You can use a predefined parameter - * {hub} and {event} inside the template, the value of the EventHandler URL is dynamically calculated when the - * client request comes in. - * For example, UrlTemplate can be `http://example.com/api/{hub}/{event}`. The host part can't contains parameters. + * Get the urlTemplate property: Gets or sets the URL template for the event handler. The actual URL is calculated + * when the corresponding event is triggered. + * The template supports predefined parameters syntax: `{event}`, `{hub}`, and KeyVault reference syntax + * `{&#64;Microsoft.KeyVault(SecretUri=_your_secret_identifier_)}` + * For example, if the template is `http://example.com/api/{event}`, when `connect` event is triggered, a POST + * request will be sent to the URL `http://example.com/chat/api/connect`. + * Note: Parameters are not allowed in the hostname of the URL, and curly brackets `{}` are reserved for parameter + * syntax only. If your URL path contains literal curly brackets, please URL-encode them to ensure proper handling. * * @return the urlTemplate value. */ @@ -63,10 +78,14 @@ public String urlTemplate() { } /** - * Set the urlTemplate property: Gets or sets the EventHandler URL template. You can use a predefined parameter - * {hub} and {event} inside the template, the value of the EventHandler URL is dynamically calculated when the - * client request comes in. - * For example, UrlTemplate can be `http://example.com/api/{hub}/{event}`. The host part can't contains parameters. + * Set the urlTemplate property: Gets or sets the URL template for the event handler. The actual URL is calculated + * when the corresponding event is triggered. + * The template supports predefined parameters syntax: `{event}`, `{hub}`, and KeyVault reference syntax + * `{&#64;Microsoft.KeyVault(SecretUri=_your_secret_identifier_)}` + * For example, if the template is `http://example.com/api/{event}`, when `connect` event is triggered, a POST + * request will be sent to the URL `http://example.com/chat/api/connect`. + * Note: Parameters are not allowed in the hostname of the URL, and curly brackets `{}` are reserved for parameter + * syntax only. If your URL path contains literal curly brackets, please URL-encode them to ensure proper handling. * * @param urlTemplate the urlTemplate value to set. * @return the EventHandler object itself. @@ -145,21 +164,28 @@ public EventHandler withAuth(UpstreamAuthSettings auth) { } /** - * Validates the instance. + * Get the groupPresenceEvents property: The group presence events that this event handler is concerned with. Group + * presence events are triggered when connections join or leave groups in the hub. If the value is null, no presence + * events will be sent to this event handler. * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (urlTemplate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property urlTemplate in model EventHandler")); - } - if (auth() != null) { - auth().validate(); - } + * @return the groupPresenceEvents value. + */ + public GroupPresenceEventFilters groupPresenceEvents() { + return this.groupPresenceEvents; } - private static final ClientLogger LOGGER = new ClientLogger(EventHandler.class); + /** + * Set the groupPresenceEvents property: The group presence events that this event handler is concerned with. Group + * presence events are triggered when connections join or leave groups in the hub. If the value is null, no presence + * events will be sent to this event handler. + * + * @param groupPresenceEvents the groupPresenceEvents value to set. + * @return the EventHandler object itself. + */ + public EventHandler withGroupPresenceEvents(GroupPresenceEventFilters groupPresenceEvents) { + this.groupPresenceEvents = groupPresenceEvents; + return this; + } /** * {@inheritDoc} @@ -171,6 +197,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("userEventPattern", this.userEventPattern); jsonWriter.writeArrayField("systemEvents", this.systemEvents, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("auth", this.auth); + jsonWriter.writeJsonField("groupPresenceEvents", this.groupPresenceEvents); return jsonWriter.writeEndObject(); } @@ -199,6 +226,8 @@ public static EventHandler fromJson(JsonReader jsonReader) throws IOException { deserializedEventHandler.systemEvents = systemEvents; } else if ("auth".equals(fieldName)) { deserializedEventHandler.auth = UpstreamAuthSettings.fromJson(reader); + } else if ("groupPresenceEvents".equals(fieldName)) { + deserializedEventHandler.groupPresenceEvents = GroupPresenceEventFilters.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventHubEndpoint.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventHubEndpoint.java index c3d5abc14db2..864fc9681382 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventHubEndpoint.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventHubEndpoint.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -24,7 +23,7 @@ public final class EventHubEndpoint extends EventListenerEndpoint { private EventListenerEndpointDiscriminator type = EventListenerEndpointDiscriminator.EVENT_HUB; /* - * The fully qualified namespace name of the Event Hub resource. For example, "example.servicebus.windows.net". + * The fully qualified namespace name of the Event Hub resource. */ private String fullyQualifiedNamespace; @@ -50,8 +49,7 @@ public EventListenerEndpointDiscriminator type() { } /** - * Get the fullyQualifiedNamespace property: The fully qualified namespace name of the Event Hub resource. For - * example, "example.servicebus.windows.net". + * Get the fullyQualifiedNamespace property: The fully qualified namespace name of the Event Hub resource. * * @return the fullyQualifiedNamespace value. */ @@ -60,8 +58,7 @@ public String fullyQualifiedNamespace() { } /** - * Set the fullyQualifiedNamespace property: The fully qualified namespace name of the Event Hub resource. For - * example, "example.servicebus.windows.net". + * Set the fullyQualifiedNamespace property: The fully qualified namespace name of the Event Hub resource. * * @param fullyQualifiedNamespace the fullyQualifiedNamespace value to set. * @return the EventHubEndpoint object itself. @@ -91,26 +88,6 @@ public EventHubEndpoint withEventHubName(String eventHubName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (fullyQualifiedNamespace() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property fullyQualifiedNamespace in model EventHubEndpoint")); - } - if (eventHubName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property eventHubName in model EventHubEndpoint")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(EventHubEndpoint.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListener.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListener.java index 36c2a37b3273..39492803538d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListener.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListener.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -75,28 +74,6 @@ public EventListener withEndpoint(EventListenerEndpoint endpoint) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (filter() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property filter in model EventListener")); - } else { - filter().validate(); - } - if (endpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property endpoint in model EventListener")); - } else { - endpoint().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(EventListener.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpoint.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpoint.java index 8d381f1498fe..23a9956a9895 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpoint.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpoint.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -37,14 +37,6 @@ public EventListenerEndpointDiscriminator type() { return this.type; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpointDiscriminator.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpointDiscriminator.java index 353ed2eb4b0c..193d30d1d151 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpointDiscriminator.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpointDiscriminator.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilter.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilter.java index 1ef0b94e368e..26352d3be0bb 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilter.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -36,14 +36,6 @@ public EventListenerFilterDiscriminator type() { return this.type; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilterDiscriminator.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilterDiscriminator.java index 8abf12203deb..bbeff7ce4a1e 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilterDiscriminator.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilterDiscriminator.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventNameFilter.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventNameFilter.java index cf31610ac9c0..52937fae571c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventNameFilter.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/EventNameFilter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -102,15 +102,6 @@ public EventNameFilter withUserEventPattern(String userEventPattern) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/GroupPresenceEventFilters.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/GroupPresenceEventFilters.java new file mode 100644 index 000000000000..5ff49ba1d076 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/GroupPresenceEventFilters.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents presence event filters for event handler configuration. + */ +@Fluent +public final class GroupPresenceEventFilters implements JsonSerializable { + /* + * The concerning event names. Valid values are "joined", "left". If the value is null or empty, no presence events + * will be sent to the event handler. + */ + private List eventNames; + + /* + * The group filters. Only events from these groups will be sent to the event handler. Each element is a pattern + * that may match multiple groups. If null or empty, events from all groups will be sent (subject to eventNames). + */ + private List groupFilters; + + /** + * Creates an instance of GroupPresenceEventFilters class. + */ + public GroupPresenceEventFilters() { + } + + /** + * Get the eventNames property: The concerning event names. Valid values are "joined", "left". If the value is null + * or empty, no presence events will be sent to the event handler. + * + * @return the eventNames value. + */ + public List eventNames() { + return this.eventNames; + } + + /** + * Set the eventNames property: The concerning event names. Valid values are "joined", "left". If the value is null + * or empty, no presence events will be sent to the event handler. + * + * @param eventNames the eventNames value to set. + * @return the GroupPresenceEventFilters object itself. + */ + public GroupPresenceEventFilters withEventNames(List eventNames) { + this.eventNames = eventNames; + return this; + } + + /** + * Get the groupFilters property: The group filters. Only events from these groups will be sent to the event + * handler. Each element is a pattern that may match multiple groups. If null or empty, events from all groups will + * be sent (subject to eventNames). + * + * @return the groupFilters value. + */ + public List groupFilters() { + return this.groupFilters; + } + + /** + * Set the groupFilters property: The group filters. Only events from these groups will be sent to the event + * handler. Each element is a pattern that may match multiple groups. If null or empty, events from all groups will + * be sent (subject to eventNames). + * + * @param groupFilters the groupFilters value to set. + * @return the GroupPresenceEventFilters object itself. + */ + public GroupPresenceEventFilters withGroupFilters(List groupFilters) { + this.groupFilters = groupFilters; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("eventNames", this.eventNames, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("groupFilters", this.groupFilters, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupPresenceEventFilters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupPresenceEventFilters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GroupPresenceEventFilters. + */ + public static GroupPresenceEventFilters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupPresenceEventFilters deserializedGroupPresenceEventFilters = new GroupPresenceEventFilters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("eventNames".equals(fieldName)) { + List eventNames + = reader.readArray(reader1 -> GroupPresenceEventName.fromString(reader1.getString())); + deserializedGroupPresenceEventFilters.eventNames = eventNames; + } else if ("groupFilters".equals(fieldName)) { + List groupFilters = reader.readArray(reader1 -> reader1.getString()); + deserializedGroupPresenceEventFilters.groupFilters = groupFilters; + } else { + reader.skipChildren(); + } + } + + return deserializedGroupPresenceEventFilters; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/GroupPresenceEventName.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/GroupPresenceEventName.java new file mode 100644 index 000000000000..dcf655b4f9cf --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/GroupPresenceEventName.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Allowed event names for group presence events. + */ +public final class GroupPresenceEventName extends ExpandableStringEnum { + /** + * Event triggered when a connection joins a group. + */ + public static final GroupPresenceEventName JOINED = fromString("joined"); + + /** + * Event triggered when a connection leaves a group. + */ + public static final GroupPresenceEventName LEFT = fromString("left"); + + /** + * Creates a new instance of GroupPresenceEventName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GroupPresenceEventName() { + } + + /** + * Creates or finds a GroupPresenceEventName from its string representation. + * + * @param name a name to look for. + * @return the corresponding GroupPresenceEventName. + */ + public static GroupPresenceEventName fromString(String name) { + return fromString(name, GroupPresenceEventName.class); + } + + /** + * Gets known GroupPresenceEventName values. + * + * @return known GroupPresenceEventName values. + */ + public static Collection values() { + return values(GroupPresenceEventName.class); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/IpRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/IpRule.java index 52f7c8c5756a..119797bd7cc8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/IpRule.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/IpRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -72,14 +72,6 @@ public IpRule withAction(AclAction action) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/KeyType.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/KeyType.java index 5f22c5559018..54337beb14ae 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/KeyType.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/KeyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceCategory.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceCategory.java index 1ad5f7fa6737..f098bf6fab03 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceCategory.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceCategory.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -84,14 +84,6 @@ public LiveTraceCategory withEnabled(String enabled) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceConfiguration.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceConfiguration.java index 7831f35c9e22..e492010b075b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceConfiguration.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -88,17 +88,6 @@ public LiveTraceConfiguration withCategories(List categories) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (categories() != null) { - categories().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LogSpecification.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LogSpecification.java index 4578ca3dc44c..9295ddff48ff 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LogSpecification.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/LogSpecification.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Specifications of the Logs for Azure Monitoring. */ -@Fluent +@Immutable public final class LogSpecification implements JsonSerializable { /* * Name of the log. @@ -29,7 +29,7 @@ public final class LogSpecification implements JsonSerializable { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentitySettings.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentitySettings.java index 7f11c282dbc4..21c79a2fcce5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentitySettings.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentitySettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -50,14 +50,6 @@ public ManagedIdentitySettings withResource(String resource) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentityType.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentityType.java index 8b507072b049..92babe0b43b7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentityType.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/MetricSpecification.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/MetricSpecification.java index e9d1dfdfae24..9e8a387b46a0 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/MetricSpecification.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/MetricSpecification.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Specifications of the Metrics for Azure Monitoring. */ -@Fluent +@Immutable public final class MetricSpecification implements JsonSerializable { /* * Name of the metric. @@ -62,7 +62,7 @@ public final class MetricSpecification implements JsonSerializable dimensions() { return this.dimensions; } - /** - * Set the dimensions property: The dimensions of the metrics. - * - * @param dimensions the dimensions value to set. - * @return the MetricSpecification object itself. - */ - public MetricSpecification withDimensions(List dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (dimensions() != null) { - dimensions().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailability.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailability.java index 54f480e0f834..72cb5f4937df 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailability.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailability.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailabilityParameters.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailabilityParameters.java index f2caec385dcc..e0e0acaa33f7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailabilityParameters.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailabilityParameters.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -78,26 +77,6 @@ public NameAvailabilityParameters withName(String name) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property type in model NameAvailabilityParameters")); - } - if (name() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property name in model NameAvailabilityParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NameAvailabilityParameters.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NetworkAcl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NetworkAcl.java index a37ece409fef..0c7dca45441b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NetworkAcl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/NetworkAcl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -77,14 +77,6 @@ public NetworkAcl withDeny(List deny) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Operation.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Operation.java index a3c45ad7841a..81439ed76935 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Operation.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/OperationDisplay.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/OperationDisplay.java index bb5ad3abe91d..92a8ae837555 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/OperationDisplay.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/OperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The object that describes a operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* * Friendly name of the resource provider @@ -39,7 +39,7 @@ public final class OperationDisplay implements JsonSerializable { /* * An object that describes a specification. @@ -24,7 +24,7 @@ public final class OperationProperties implements JsonSerializable list(); /** - * Lists all of the available REST API operations of the Microsoft.SignalRService provider. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list REST API operations as paginated response with {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PersistentStorage.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PersistentStorage.java new file mode 100644 index 000000000000..24db9332b4bb --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PersistentStorage.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner; + +/** + * An immutable client-side representation of PersistentStorage. + */ +public interface PersistentStorage { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the storageAccount property: Reference to the storage account to be used for persistent storage. + * + * @return the storageAccount value. + */ + ResourceReference storageAccount(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner object. + * + * @return the inner object. + */ + PersistentStorageInner innerModel(); + + /** + * The entirety of the PersistentStorage definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * The PersistentStorage definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the PersistentStorage definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the PersistentStorage definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @return the next definition stage. + */ + WithStorageAccount withExistingWebPubSub(String resourceGroupName, String resourceName); + } + + /** + * The stage of the PersistentStorage definition allowing to specify storageAccount. + */ + interface WithStorageAccount { + /** + * Specifies the storageAccount property: Reference to the storage account to be used for persistent + * storage.. + * + * @param storageAccount Reference to the storage account to be used for persistent storage. + * @return the next definition stage. + */ + WithCreate withStorageAccount(ResourceReference storageAccount); + } + + /** + * The stage of the PersistentStorage definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + PersistentStorage create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PersistentStorage create(Context context); + } + } + + /** + * Begins update for the PersistentStorage resource. + * + * @return the stage of resource update. + */ + PersistentStorage.Update update(); + + /** + * The template for PersistentStorage update. + */ + interface Update extends UpdateStages.WithStorageAccount { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PersistentStorage apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PersistentStorage apply(Context context); + } + + /** + * The PersistentStorage update stages. + */ + interface UpdateStages { + /** + * The stage of the PersistentStorage update allowing to specify storageAccount. + */ + interface WithStorageAccount { + /** + * Specifies the storageAccount property: Reference to the storage account to be used for persistent + * storage.. + * + * @param storageAccount Reference to the storage account to be used for persistent storage. + * @return the next definition stage. + */ + Update withStorageAccount(ResourceReference storageAccount); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PersistentStorage refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PersistentStorage refresh(Context context); +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpoint.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpoint.java index b9674b09b1d5..af50f61016c1 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpoint.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpoint.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -47,14 +47,6 @@ public PrivateEndpoint withId(String id) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointAcl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointAcl.java index 64ee7666ad51..0a9ed3cbef60 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointAcl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointAcl.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -66,21 +65,6 @@ public PrivateEndpointAcl withDeny(List deny) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model PrivateEndpointAcl")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointAcl.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointConnection.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointConnection.java index 76dbcee3e139..78daa59795dc 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointConnection.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointConnection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkResource.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkResource.java index 3321fedcaea9..c9b04de83c45 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkResource.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionState.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionState.java index 455ff25dfb81..1a725d540b74 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionState.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -101,14 +101,6 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionStatus.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionStatus.java index 91e0f889c83f..1d386a9be395 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionStatus.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ProvisioningState.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ProvisioningState.java index c47157d86957..0c871677fe0d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ProvisioningState.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -12,42 +12,42 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value Unknown for ProvisioningState. + * Unknown provisioning state. */ public static final ProvisioningState UNKNOWN = fromString("Unknown"); /** - * Static value Succeeded for ProvisioningState. + * Resource successfully provisioned. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ProvisioningState. + * Resource provisioning failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Canceled for ProvisioningState. + * Resource provisioning was canceled. */ public static final ProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Running for ProvisioningState. + * Resource provisioning is running. */ public static final ProvisioningState RUNNING = fromString("Running"); /** - * Static value Creating for ProvisioningState. + * Resource is being created. */ public static final ProvisioningState CREATING = fromString("Creating"); /** - * Static value Updating for ProvisioningState. + * Resource is being updated. */ public static final ProvisioningState UPDATING = fromString("Updating"); /** - * Static value Deleting for ProvisioningState. + * Resource is being deleted. */ public static final ProvisioningState DELETING = fromString("Deleting"); diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/RegenerateKeyParameters.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/RegenerateKeyParameters.java index 3c115fbaa25a..6863a688f3ed 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/RegenerateKeyParameters.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/RegenerateKeyParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -47,14 +47,6 @@ public RegenerateKeyParameters withKeyType(KeyType keyType) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Replica.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Replica.java index 6b8cf899243f..b476000a0a55 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Replica.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Replica.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogCategory.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogCategory.java index afbec925d164..1d608e2122c6 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogCategory.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogCategory.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -84,14 +84,6 @@ public ResourceLogCategory withEnabled(String enabled) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogConfiguration.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogConfiguration.java index c5c4239cd98d..6587da1677fb 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogConfiguration.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -48,17 +48,6 @@ public ResourceLogConfiguration withCategories(List categor return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (categories() != null) { - categories().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceReference.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceReference.java index b739942501ca..ef1b456aae97 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceReference.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceReference.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -47,14 +47,6 @@ public ResourceReference withId(String id) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceSku.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceSku.java index 37e18792d994..7c718357e601 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceSku.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceSku.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -159,20 +158,6 @@ public ResourceSku withCapacity(Integer capacity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model ResourceSku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ResourceSku.class); - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ScaleType.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ScaleType.java index 94d7e1b7793f..c6b92068a0fc 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ScaleType.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ScaleType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceKind.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceKind.java index af111790f30b..1ea1b1722620 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceKind.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceSpecification.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceSpecification.java index e122d6fa248c..56ff8a84214b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceSpecification.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceSpecification.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * An object that describes a specification. */ -@Fluent +@Immutable public final class ServiceSpecification implements JsonSerializable { /* * Specifications of the Metrics for Azure Monitoring. @@ -30,7 +30,7 @@ public final class ServiceSpecification implements JsonSerializable metricSpecifications() { return this.metricSpecifications; } - /** - * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. - * - * @param metricSpecifications the metricSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withMetricSpecifications(List metricSpecifications) { - this.metricSpecifications = metricSpecifications; - return this; - } - /** * Get the logSpecifications property: Specifications of the Logs for Azure Monitoring. * @@ -62,31 +51,6 @@ public List logSpecifications() { return this.logSpecifications; } - /** - * Set the logSpecifications property: Specifications of the Logs for Azure Monitoring. - * - * @param logSpecifications the logSpecifications value to set. - * @return the ServiceSpecification object itself. - */ - public ServiceSpecification withLogSpecifications(List logSpecifications) { - this.logSpecifications = logSpecifications; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metricSpecifications() != null) { - metricSpecifications().forEach(e -> e.validate()); - } - if (logSpecifications() != null) { - logSpecifications().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceProperties.java index 8bd91fae4860..c31c8786bdd2 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceProperties.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Describes the properties of a resource type that has been onboarded to private link service. */ -@Fluent +@Immutable public final class ShareablePrivateLinkResourceProperties implements JsonSerializable { /* @@ -35,7 +35,7 @@ public final class ShareablePrivateLinkResourceProperties /** * Creates an instance of ShareablePrivateLinkResourceProperties class. */ - public ShareablePrivateLinkResourceProperties() { + private ShareablePrivateLinkResourceProperties() { } /** @@ -48,18 +48,6 @@ public String description() { return this.description; } - /** - * Set the description property: The description of the resource type that has been onboarded to private link - * service. - * - * @param description the description value to set. - * @return the ShareablePrivateLinkResourceProperties object itself. - */ - public ShareablePrivateLinkResourceProperties withDescription(String description) { - this.description = description; - return this; - } - /** * Get the groupId property: The resource provider group id for the resource that has been onboarded to private link * service. @@ -70,18 +58,6 @@ public String groupId() { return this.groupId; } - /** - * Set the groupId property: The resource provider group id for the resource that has been onboarded to private link - * service. - * - * @param groupId the groupId value to set. - * @return the ShareablePrivateLinkResourceProperties object itself. - */ - public ShareablePrivateLinkResourceProperties withGroupId(String groupId) { - this.groupId = groupId; - return this; - } - /** * Get the type property: The resource provider type for the resource that has been onboarded to private link * service. @@ -92,26 +68,6 @@ public String type() { return this.type; } - /** - * Set the type property: The resource provider type for the resource that has been onboarded to private link - * service. - * - * @param type the type value to set. - * @return the ShareablePrivateLinkResourceProperties object itself. - */ - public ShareablePrivateLinkResourceProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceType.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceType.java index cb68244bb9e1..588463c5fee8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceType.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceType.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Describes a resource type that has been onboarded to private link service. */ -@Fluent +@Immutable public final class ShareablePrivateLinkResourceType implements JsonSerializable { /* * The name of the resource type that has been onboarded to private link service @@ -29,7 +29,7 @@ public final class ShareablePrivateLinkResourceType implements JsonSerializable< /** * Creates an instance of ShareablePrivateLinkResourceType class. */ - public ShareablePrivateLinkResourceType() { + private ShareablePrivateLinkResourceType() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: The name of the resource type that has been onboarded to private link service. - * - * @param name the name value to set. - * @return the ShareablePrivateLinkResourceType object itself. - */ - public ShareablePrivateLinkResourceType withName(String name) { - this.name = name; - return this; - } - /** * Get the properties property: Describes the properties of a resource type that has been onboarded to private link * service. @@ -62,29 +51,6 @@ public ShareablePrivateLinkResourceProperties properties() { return this.properties; } - /** - * Set the properties property: Describes the properties of a resource type that has been onboarded to private link - * service. - * - * @param properties the properties value to set. - * @return the ShareablePrivateLinkResourceType object itself. - */ - public ShareablePrivateLinkResourceType withProperties(ShareablePrivateLinkResourceProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResource.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResource.java index 545aee86f2a3..72b50129c6f5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResource.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResource.java @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceInner; +import java.util.List; /** * An immutable client-side representation of SharedPrivateLinkResource. @@ -69,6 +70,13 @@ public interface SharedPrivateLinkResource { */ String requestMessage(); + /** + * Gets the fqdns property: A list of FQDNs for third party private link service. + * + * @return the fqdns value. + */ + List fqdns(); + /** * Gets the status property: Status of the shared private link resource. * @@ -126,7 +134,7 @@ interface WithParentResource { * the resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithGroupId, DefinitionStages.WithPrivateLinkResourceId, - DefinitionStages.WithRequestMessage { + DefinitionStages.WithRequestMessage, DefinitionStages.WithFqdns { /** * Executes the create request. * @@ -184,6 +192,19 @@ interface WithRequestMessage { */ WithCreate withRequestMessage(String requestMessage); } + + /** + * The stage of the SharedPrivateLinkResource definition allowing to specify fqdns. + */ + interface WithFqdns { + /** + * Specifies the fqdns property: A list of FQDNs for third party private link service. + * + * @param fqdns A list of FQDNs for third party private link service. + * @return the next definition stage. + */ + WithCreate withFqdns(List fqdns); + } } /** @@ -196,8 +217,8 @@ interface WithRequestMessage { /** * The template for SharedPrivateLinkResource update. */ - interface Update - extends UpdateStages.WithGroupId, UpdateStages.WithPrivateLinkResourceId, UpdateStages.WithRequestMessage { + interface Update extends UpdateStages.WithGroupId, UpdateStages.WithPrivateLinkResourceId, + UpdateStages.WithRequestMessage, UpdateStages.WithFqdns { /** * Executes the update request. * @@ -259,6 +280,19 @@ interface WithRequestMessage { */ Update withRequestMessage(String requestMessage); } + + /** + * The stage of the SharedPrivateLinkResource update allowing to specify fqdns. + */ + interface WithFqdns { + /** + * Specifies the fqdns property: A list of FQDNs for third party private link service. + * + * @param fqdns A list of FQDNs for third party private link service. + * @return the next definition stage. + */ + Update withFqdns(List fqdns); + } } /** diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResourceStatus.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResourceStatus.java index effa1160fad7..908a8f22e477 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResourceStatus.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResourceStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsage.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsage.java index 96d73110dbd5..cffe55cb4f46 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsage.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsageName.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsageName.java index 413d523dbb26..bff733ef23f7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsageName.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsageName.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Localizable String object containing the name and a localized value. */ -@Fluent +@Immutable public final class SignalRServiceUsageName implements JsonSerializable { /* * The identifier of the usage. @@ -29,7 +29,7 @@ public final class SignalRServiceUsageName implements JsonSerializable { /** * Creates an instance of Sku class. */ - public Sku() { + private Sku() { } /** @@ -64,20 +64,6 @@ public SkuCapacity capacity() { return this.capacity; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (capacity() != null) { - capacity().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SkuCapacity.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SkuCapacity.java index b170d247b885..51e375747f75 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SkuCapacity.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SkuCapacity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -45,7 +45,7 @@ public final class SkuCapacity implements JsonSerializable { /** * Creates an instance of SkuCapacity class. */ - public SkuCapacity() { + private SkuCapacity() { } /** @@ -93,14 +93,6 @@ public ScaleType scaleType() { return this.scaleType; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SkuList.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SkuList.java index 2968eedf65b5..9293af4a7082 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SkuList.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/SkuList.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByJwtCustomClaimRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByJwtCustomClaimRule.java new file mode 100644 index 000000000000..3fcee2282672 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByJwtCustomClaimRule.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Throttle the client connection by a custom JWT claim. + */ +@Fluent +public final class ThrottleByJwtCustomClaimRule extends ClientConnectionCountRule { + /* + * The type property. + */ + private ClientConnectionCountRuleDiscriminator type + = ClientConnectionCountRuleDiscriminator.THROTTLE_BY_JWT_CUSTOM_CLAIM_RULE; + + /* + * The name of the claim in the JWT token. The client connection with the same claim value will be aggregated. If + * the claim is not found in the token, the connection will be allowed. + */ + private String claimName; + + /* + * Maximum connection count allowed for the same Jwt claim value. Clients with the same Jwt claim will get rejected + * if the connection count exceeds this value. Default value is 20. + */ + private Integer maxCount; + + /** + * Creates an instance of ThrottleByJwtCustomClaimRule class. + */ + public ThrottleByJwtCustomClaimRule() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Override + public ClientConnectionCountRuleDiscriminator type() { + return this.type; + } + + /** + * Get the claimName property: The name of the claim in the JWT token. The client connection with the same claim + * value will be aggregated. If the claim is not found in the token, the connection will be allowed. + * + * @return the claimName value. + */ + public String claimName() { + return this.claimName; + } + + /** + * Set the claimName property: The name of the claim in the JWT token. The client connection with the same claim + * value will be aggregated. If the claim is not found in the token, the connection will be allowed. + * + * @param claimName the claimName value to set. + * @return the ThrottleByJwtCustomClaimRule object itself. + */ + public ThrottleByJwtCustomClaimRule withClaimName(String claimName) { + this.claimName = claimName; + return this; + } + + /** + * Get the maxCount property: Maximum connection count allowed for the same Jwt claim value. Clients with the same + * Jwt claim will get rejected if the connection count exceeds this value. Default value is 20. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount property: Maximum connection count allowed for the same Jwt claim value. Clients with the same + * Jwt claim will get rejected if the connection count exceeds this value. Default value is 20. + * + * @param maxCount the maxCount value to set. + * @return the ThrottleByJwtCustomClaimRule object itself. + */ + public ThrottleByJwtCustomClaimRule withMaxCount(Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("claimName", this.claimName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("maxCount", this.maxCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThrottleByJwtCustomClaimRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThrottleByJwtCustomClaimRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThrottleByJwtCustomClaimRule. + */ + public static ThrottleByJwtCustomClaimRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThrottleByJwtCustomClaimRule deserializedThrottleByJwtCustomClaimRule = new ThrottleByJwtCustomClaimRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("claimName".equals(fieldName)) { + deserializedThrottleByJwtCustomClaimRule.claimName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedThrottleByJwtCustomClaimRule.type + = ClientConnectionCountRuleDiscriminator.fromString(reader.getString()); + } else if ("maxCount".equals(fieldName)) { + deserializedThrottleByJwtCustomClaimRule.maxCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedThrottleByJwtCustomClaimRule; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByJwtSignatureRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByJwtSignatureRule.java new file mode 100644 index 000000000000..24ed01ad40bf --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByJwtSignatureRule.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Throttle the client connection by the JWT signature. + */ +@Fluent +public final class ThrottleByJwtSignatureRule extends ClientConnectionCountRule { + /* + * The type property. + */ + private ClientConnectionCountRuleDiscriminator type + = ClientConnectionCountRuleDiscriminator.THROTTLE_BY_JWT_SIGNATURE_RULE; + + /* + * Maximum connection count allowed for the same JWT signature. Clients with the same JWT signature will get + * rejected if the connection count exceeds this value. Default value is 20. + */ + private Integer maxCount; + + /** + * Creates an instance of ThrottleByJwtSignatureRule class. + */ + public ThrottleByJwtSignatureRule() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Override + public ClientConnectionCountRuleDiscriminator type() { + return this.type; + } + + /** + * Get the maxCount property: Maximum connection count allowed for the same JWT signature. Clients with the same JWT + * signature will get rejected if the connection count exceeds this value. Default value is 20. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount property: Maximum connection count allowed for the same JWT signature. Clients with the same JWT + * signature will get rejected if the connection count exceeds this value. Default value is 20. + * + * @param maxCount the maxCount value to set. + * @return the ThrottleByJwtSignatureRule object itself. + */ + public ThrottleByJwtSignatureRule withMaxCount(Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("maxCount", this.maxCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThrottleByJwtSignatureRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThrottleByJwtSignatureRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThrottleByJwtSignatureRule. + */ + public static ThrottleByJwtSignatureRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThrottleByJwtSignatureRule deserializedThrottleByJwtSignatureRule = new ThrottleByJwtSignatureRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedThrottleByJwtSignatureRule.type + = ClientConnectionCountRuleDiscriminator.fromString(reader.getString()); + } else if ("maxCount".equals(fieldName)) { + deserializedThrottleByJwtSignatureRule.maxCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedThrottleByJwtSignatureRule; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByUserIdRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByUserIdRule.java new file mode 100644 index 000000000000..1dd37ef5ca5e --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByUserIdRule.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Throttle the client connection by the user ID. + */ +@Fluent +public final class ThrottleByUserIdRule extends ClientConnectionCountRule { + /* + * The type property. + */ + private ClientConnectionCountRuleDiscriminator type + = ClientConnectionCountRuleDiscriminator.THROTTLE_BY_USER_ID_RULE; + + /* + * Maximum connection count allowed for the same user ID. Clients with the same user ID will get rejected if the + * connection count exceeds this value. Default value is 20. + */ + private Integer maxCount; + + /** + * Creates an instance of ThrottleByUserIdRule class. + */ + public ThrottleByUserIdRule() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Override + public ClientConnectionCountRuleDiscriminator type() { + return this.type; + } + + /** + * Get the maxCount property: Maximum connection count allowed for the same user ID. Clients with the same user ID + * will get rejected if the connection count exceeds this value. Default value is 20. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount property: Maximum connection count allowed for the same user ID. Clients with the same user ID + * will get rejected if the connection count exceeds this value. Default value is 20. + * + * @param maxCount the maxCount value to set. + * @return the ThrottleByUserIdRule object itself. + */ + public ThrottleByUserIdRule withMaxCount(Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("maxCount", this.maxCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThrottleByUserIdRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThrottleByUserIdRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThrottleByUserIdRule. + */ + public static ThrottleByUserIdRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThrottleByUserIdRule deserializedThrottleByUserIdRule = new ThrottleByUserIdRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedThrottleByUserIdRule.type + = ClientConnectionCountRuleDiscriminator.fromString(reader.getString()); + } else if ("maxCount".equals(fieldName)) { + deserializedThrottleByUserIdRule.maxCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedThrottleByUserIdRule; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByJwtCustomClaimRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByJwtCustomClaimRule.java new file mode 100644 index 000000000000..71f1dcac8f8c --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByJwtCustomClaimRule.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Throttle the client traffic by a custom JWT claim. + */ +@Fluent +public final class TrafficThrottleByJwtCustomClaimRule extends ClientTrafficControlRule { + /* + * The type property. + */ + private ClientTrafficControlRuleDiscriminator type + = ClientTrafficControlRuleDiscriminator.TRAFFIC_THROTTLE_BY_JWT_CUSTOM_CLAIM_RULE; + + /* + * The name of the claim in the JWT token. The message bytes with the same claim value will be aggregated. If the + * claim is not found in the token, the rule will be skipped. + */ + private String claimName; + + /* + * Maximum accumulated inbound message bytes allowed for the same JWT signature within a time window. Clients with + * the same JWT claim will get disconnected if the message bytes exceeds this value. Default value is 1GB. + */ + private Long maxInboundMessageBytes; + + /* + * The aggregation window for the message bytes. The message bytes will be aggregated in this window and be reset + * after the window. Default value is 60 seconds. + */ + private Integer aggregationWindowInSeconds; + + /** + * Creates an instance of TrafficThrottleByJwtCustomClaimRule class. + */ + public TrafficThrottleByJwtCustomClaimRule() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Override + public ClientTrafficControlRuleDiscriminator type() { + return this.type; + } + + /** + * Get the claimName property: The name of the claim in the JWT token. The message bytes with the same claim value + * will be aggregated. If the claim is not found in the token, the rule will be skipped. + * + * @return the claimName value. + */ + public String claimName() { + return this.claimName; + } + + /** + * Set the claimName property: The name of the claim in the JWT token. The message bytes with the same claim value + * will be aggregated. If the claim is not found in the token, the rule will be skipped. + * + * @param claimName the claimName value to set. + * @return the TrafficThrottleByJwtCustomClaimRule object itself. + */ + public TrafficThrottleByJwtCustomClaimRule withClaimName(String claimName) { + this.claimName = claimName; + return this; + } + + /** + * Get the maxInboundMessageBytes property: Maximum accumulated inbound message bytes allowed for the same JWT + * signature within a time window. Clients with the same JWT claim will get disconnected if the message bytes + * exceeds this value. Default value is 1GB. + * + * @return the maxInboundMessageBytes value. + */ + public Long maxInboundMessageBytes() { + return this.maxInboundMessageBytes; + } + + /** + * Set the maxInboundMessageBytes property: Maximum accumulated inbound message bytes allowed for the same JWT + * signature within a time window. Clients with the same JWT claim will get disconnected if the message bytes + * exceeds this value. Default value is 1GB. + * + * @param maxInboundMessageBytes the maxInboundMessageBytes value to set. + * @return the TrafficThrottleByJwtCustomClaimRule object itself. + */ + public TrafficThrottleByJwtCustomClaimRule withMaxInboundMessageBytes(Long maxInboundMessageBytes) { + this.maxInboundMessageBytes = maxInboundMessageBytes; + return this; + } + + /** + * Get the aggregationWindowInSeconds property: The aggregation window for the message bytes. The message bytes will + * be aggregated in this window and be reset after the window. Default value is 60 seconds. + * + * @return the aggregationWindowInSeconds value. + */ + public Integer aggregationWindowInSeconds() { + return this.aggregationWindowInSeconds; + } + + /** + * Set the aggregationWindowInSeconds property: The aggregation window for the message bytes. The message bytes will + * be aggregated in this window and be reset after the window. Default value is 60 seconds. + * + * @param aggregationWindowInSeconds the aggregationWindowInSeconds value to set. + * @return the TrafficThrottleByJwtCustomClaimRule object itself. + */ + public TrafficThrottleByJwtCustomClaimRule withAggregationWindowInSeconds(Integer aggregationWindowInSeconds) { + this.aggregationWindowInSeconds = aggregationWindowInSeconds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("claimName", this.claimName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("maxInboundMessageBytes", this.maxInboundMessageBytes); + jsonWriter.writeNumberField("aggregationWindowInSeconds", this.aggregationWindowInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrafficThrottleByJwtCustomClaimRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrafficThrottleByJwtCustomClaimRule if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TrafficThrottleByJwtCustomClaimRule. + */ + public static TrafficThrottleByJwtCustomClaimRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrafficThrottleByJwtCustomClaimRule deserializedTrafficThrottleByJwtCustomClaimRule + = new TrafficThrottleByJwtCustomClaimRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("claimName".equals(fieldName)) { + deserializedTrafficThrottleByJwtCustomClaimRule.claimName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTrafficThrottleByJwtCustomClaimRule.type + = ClientTrafficControlRuleDiscriminator.fromString(reader.getString()); + } else if ("maxInboundMessageBytes".equals(fieldName)) { + deserializedTrafficThrottleByJwtCustomClaimRule.maxInboundMessageBytes + = reader.getNullable(JsonReader::getLong); + } else if ("aggregationWindowInSeconds".equals(fieldName)) { + deserializedTrafficThrottleByJwtCustomClaimRule.aggregationWindowInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTrafficThrottleByJwtCustomClaimRule; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByJwtSignatureRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByJwtSignatureRule.java new file mode 100644 index 000000000000..911a09376096 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByJwtSignatureRule.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Throttle the client traffic by the JWT signature. + */ +@Fluent +public final class TrafficThrottleByJwtSignatureRule extends ClientTrafficControlRule { + /* + * The type property. + */ + private ClientTrafficControlRuleDiscriminator type + = ClientTrafficControlRuleDiscriminator.TRAFFIC_THROTTLE_BY_JWT_SIGNATURE_RULE; + + /* + * Maximum accumulated inbound message bytes allowed for the same JWT signature within a time window. Clients with + * the same JWT signature will get disconnected if the message bytes exceeds this value. Default value is 1GB. + */ + private Long maxInboundMessageBytes; + + /* + * The aggregation window for the message bytes. The message bytes will be aggregated in this window and be reset + * after the window. Default value is 60 seconds. + */ + private Integer aggregationWindowInSeconds; + + /** + * Creates an instance of TrafficThrottleByJwtSignatureRule class. + */ + public TrafficThrottleByJwtSignatureRule() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Override + public ClientTrafficControlRuleDiscriminator type() { + return this.type; + } + + /** + * Get the maxInboundMessageBytes property: Maximum accumulated inbound message bytes allowed for the same JWT + * signature within a time window. Clients with the same JWT signature will get disconnected if the message bytes + * exceeds this value. Default value is 1GB. + * + * @return the maxInboundMessageBytes value. + */ + public Long maxInboundMessageBytes() { + return this.maxInboundMessageBytes; + } + + /** + * Set the maxInboundMessageBytes property: Maximum accumulated inbound message bytes allowed for the same JWT + * signature within a time window. Clients with the same JWT signature will get disconnected if the message bytes + * exceeds this value. Default value is 1GB. + * + * @param maxInboundMessageBytes the maxInboundMessageBytes value to set. + * @return the TrafficThrottleByJwtSignatureRule object itself. + */ + public TrafficThrottleByJwtSignatureRule withMaxInboundMessageBytes(Long maxInboundMessageBytes) { + this.maxInboundMessageBytes = maxInboundMessageBytes; + return this; + } + + /** + * Get the aggregationWindowInSeconds property: The aggregation window for the message bytes. The message bytes will + * be aggregated in this window and be reset after the window. Default value is 60 seconds. + * + * @return the aggregationWindowInSeconds value. + */ + public Integer aggregationWindowInSeconds() { + return this.aggregationWindowInSeconds; + } + + /** + * Set the aggregationWindowInSeconds property: The aggregation window for the message bytes. The message bytes will + * be aggregated in this window and be reset after the window. Default value is 60 seconds. + * + * @param aggregationWindowInSeconds the aggregationWindowInSeconds value to set. + * @return the TrafficThrottleByJwtSignatureRule object itself. + */ + public TrafficThrottleByJwtSignatureRule withAggregationWindowInSeconds(Integer aggregationWindowInSeconds) { + this.aggregationWindowInSeconds = aggregationWindowInSeconds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("maxInboundMessageBytes", this.maxInboundMessageBytes); + jsonWriter.writeNumberField("aggregationWindowInSeconds", this.aggregationWindowInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrafficThrottleByJwtSignatureRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrafficThrottleByJwtSignatureRule if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TrafficThrottleByJwtSignatureRule. + */ + public static TrafficThrottleByJwtSignatureRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrafficThrottleByJwtSignatureRule deserializedTrafficThrottleByJwtSignatureRule + = new TrafficThrottleByJwtSignatureRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedTrafficThrottleByJwtSignatureRule.type + = ClientTrafficControlRuleDiscriminator.fromString(reader.getString()); + } else if ("maxInboundMessageBytes".equals(fieldName)) { + deserializedTrafficThrottleByJwtSignatureRule.maxInboundMessageBytes + = reader.getNullable(JsonReader::getLong); + } else if ("aggregationWindowInSeconds".equals(fieldName)) { + deserializedTrafficThrottleByJwtSignatureRule.aggregationWindowInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTrafficThrottleByJwtSignatureRule; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByUserIdRule.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByUserIdRule.java new file mode 100644 index 000000000000..e078a7a86cc3 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByUserIdRule.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Throttle the client traffic by the user ID. + */ +@Fluent +public final class TrafficThrottleByUserIdRule extends ClientTrafficControlRule { + /* + * The type property. + */ + private ClientTrafficControlRuleDiscriminator type + = ClientTrafficControlRuleDiscriminator.TRAFFIC_THROTTLE_BY_USER_ID_RULE; + + /* + * Maximum accumulated inbound message bytes allowed for the same user ID within a time window. Clients with the + * same user ID will get disconnected if the message bytes exceeds this value. Default value is 1GB. + */ + private Long maxInboundMessageBytes; + + /* + * The aggregation window for the message bytes. The message bytes will be aggregated in this window and be reset + * after the window. Default value is 60 seconds. + */ + private Integer aggregationWindowInSeconds; + + /** + * Creates an instance of TrafficThrottleByUserIdRule class. + */ + public TrafficThrottleByUserIdRule() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Override + public ClientTrafficControlRuleDiscriminator type() { + return this.type; + } + + /** + * Get the maxInboundMessageBytes property: Maximum accumulated inbound message bytes allowed for the same user ID + * within a time window. Clients with the same user ID will get disconnected if the message bytes exceeds this + * value. Default value is 1GB. + * + * @return the maxInboundMessageBytes value. + */ + public Long maxInboundMessageBytes() { + return this.maxInboundMessageBytes; + } + + /** + * Set the maxInboundMessageBytes property: Maximum accumulated inbound message bytes allowed for the same user ID + * within a time window. Clients with the same user ID will get disconnected if the message bytes exceeds this + * value. Default value is 1GB. + * + * @param maxInboundMessageBytes the maxInboundMessageBytes value to set. + * @return the TrafficThrottleByUserIdRule object itself. + */ + public TrafficThrottleByUserIdRule withMaxInboundMessageBytes(Long maxInboundMessageBytes) { + this.maxInboundMessageBytes = maxInboundMessageBytes; + return this; + } + + /** + * Get the aggregationWindowInSeconds property: The aggregation window for the message bytes. The message bytes will + * be aggregated in this window and be reset after the window. Default value is 60 seconds. + * + * @return the aggregationWindowInSeconds value. + */ + public Integer aggregationWindowInSeconds() { + return this.aggregationWindowInSeconds; + } + + /** + * Set the aggregationWindowInSeconds property: The aggregation window for the message bytes. The message bytes will + * be aggregated in this window and be reset after the window. Default value is 60 seconds. + * + * @param aggregationWindowInSeconds the aggregationWindowInSeconds value to set. + * @return the TrafficThrottleByUserIdRule object itself. + */ + public TrafficThrottleByUserIdRule withAggregationWindowInSeconds(Integer aggregationWindowInSeconds) { + this.aggregationWindowInSeconds = aggregationWindowInSeconds; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("maxInboundMessageBytes", this.maxInboundMessageBytes); + jsonWriter.writeNumberField("aggregationWindowInSeconds", this.aggregationWindowInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrafficThrottleByUserIdRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrafficThrottleByUserIdRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TrafficThrottleByUserIdRule. + */ + public static TrafficThrottleByUserIdRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrafficThrottleByUserIdRule deserializedTrafficThrottleByUserIdRule = new TrafficThrottleByUserIdRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedTrafficThrottleByUserIdRule.type + = ClientTrafficControlRuleDiscriminator.fromString(reader.getString()); + } else if ("maxInboundMessageBytes".equals(fieldName)) { + deserializedTrafficThrottleByUserIdRule.maxInboundMessageBytes + = reader.getNullable(JsonReader::getLong); + } else if ("aggregationWindowInSeconds".equals(fieldName)) { + deserializedTrafficThrottleByUserIdRule.aggregationWindowInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTrafficThrottleByUserIdRule; + }); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthSettings.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthSettings.java index 6e5679f11c96..25cccaa954bf 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthSettings.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -72,17 +72,6 @@ public UpstreamAuthSettings withManagedIdentity(ManagedIdentitySettings managedI return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (managedIdentity() != null) { - managedIdentity().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthType.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthType.java index ee42105bc3cf..74abc81dd8c8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthType.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Usages.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Usages.java index a07a2eaf6050..311ad6874099 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Usages.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/Usages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -14,7 +14,7 @@ public interface Usages { /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -26,7 +26,7 @@ public interface Usages { /** * List resource usage quotas by location. * - * @param location the location like "eastus". + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UserAssignedIdentityProperty.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UserAssignedIdentityProperty.java index feb34500959f..acbd59fb151b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UserAssignedIdentityProperty.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/UserAssignedIdentityProperty.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -50,14 +50,6 @@ public String clientId() { return this.clientId; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomCertificates.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomCertificates.java index 891c027d963e..cfa0e65e52f8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomCertificates.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomCertificates.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -13,32 +13,35 @@ */ public interface WebPubSubCustomCertificates { /** - * List all custom certificates. + * Get a custom certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param certificateName Custom certificate name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom certificates list as paginated response with {@link PagedIterable}. + * @return a custom certificate along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String resourceName); + Response getWithResponse(String resourceGroupName, String resourceName, String certificateName, + Context context); /** - * List all custom certificates. + * Get a custom certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param certificateName Custom certificate name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom certificates list as paginated response with {@link PagedIterable}. + * @return a custom certificate. */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); + CustomCertificate get(String resourceGroupName, String resourceName, String certificateName); /** - * Get a custom certificate. + * Delete a custom certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. @@ -47,13 +50,13 @@ public interface WebPubSubCustomCertificates { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom certificate along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String resourceName, String certificateName, + Response deleteWithResponse(String resourceGroupName, String resourceName, String certificateName, Context context); /** - * Get a custom certificate. + * Delete a custom certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. @@ -61,36 +64,33 @@ Response getWithResponse(String resourceGroupName, String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom certificate. */ - CustomCertificate get(String resourceGroupName, String resourceName, String certificateName); + void delete(String resourceGroupName, String resourceName, String certificateName); /** - * Delete a custom certificate. + * List all custom certificates. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param certificateName Custom certificate name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return custom certificates list as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String resourceName, String certificateName, - Context context); + PagedIterable list(String resourceGroupName, String resourceName); /** - * Delete a custom certificate. + * List all custom certificates. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param certificateName Custom certificate name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom certificates list as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String resourceName, String certificateName); + PagedIterable list(String resourceGroupName, String resourceName, Context context); /** * Get a custom certificate. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomDomains.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomDomains.java index f64b95b5280c..41cc3bdec096 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomDomains.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomDomains.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -13,81 +13,81 @@ */ public interface WebPubSubCustomDomains { /** - * List all custom domains. + * Get a custom domain. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param name Custom domain name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domains list as paginated response with {@link PagedIterable}. + * @return a custom domain along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String resourceName); + Response getWithResponse(String resourceGroupName, String resourceName, String name, Context context); /** - * List all custom domains. + * Get a custom domain. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param name Custom domain name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom domains list as paginated response with {@link PagedIterable}. + * @return a custom domain. */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); + CustomDomain get(String resourceGroupName, String resourceName, String name); /** - * Get a custom domain. + * Delete a custom domain. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param name Custom domain name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom domain along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String resourceName, String name, Context context); + void delete(String resourceGroupName, String resourceName, String name); /** - * Get a custom domain. + * Delete a custom domain. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param name Custom domain name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a custom domain. */ - CustomDomain get(String resourceGroupName, String resourceName, String name); + void delete(String resourceGroupName, String resourceName, String name, Context context); /** - * Delete a custom domain. + * List all custom domains. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param name Custom domain name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domains list as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String resourceName, String name); + PagedIterable list(String resourceGroupName, String resourceName); /** - * Delete a custom domain. + * List all custom domains. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param name Custom domain name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domains list as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String resourceName, String name, Context context); + PagedIterable list(String resourceGroupName, String resourceName, Context context); /** * Get a custom domain. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHub.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHub.java index e7430d98d238..db8115126141 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHub.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHub.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubProperties.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubProperties.java index 21058d2579f6..fde4bfea8ac7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubProperties.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -44,6 +44,11 @@ public final class WebPubSubHubProperties implements JsonSerializable e.validate()); - } - if (eventListeners() != null) { - eventListeners().forEach(e -> e.validate()); - } + * @return the chat value. + */ + public ChatSettings chat() { + return this.chat; + } + + /** + * Set the chat property: The chat settings for the hub. + * + * @param chat the chat value to set. + * @return the WebPubSubHubProperties object itself. + */ + public WebPubSubHubProperties withChat(ChatSettings chat) { + this.chat = chat; + return this; } /** @@ -169,6 +180,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("anonymousConnectPolicy", this.anonymousConnectPolicy); jsonWriter.writeNumberField("webSocketKeepAliveIntervalInSeconds", this.webSocketKeepAliveIntervalInSeconds); + jsonWriter.writeJsonField("chat", this.chat); return jsonWriter.writeEndObject(); } @@ -198,6 +210,8 @@ public static WebPubSubHubProperties fromJson(JsonReader jsonReader) throws IOEx } else if ("webSocketKeepAliveIntervalInSeconds".equals(fieldName)) { deserializedWebPubSubHubProperties.webSocketKeepAliveIntervalInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("chat".equals(fieldName)) { + deserializedWebPubSubHubProperties.chat = ChatSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubs.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubs.java index 3895a797c3be..e0ba326a6ddf 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubs.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -13,82 +13,82 @@ */ public interface WebPubSubHubs { /** - * List hub settings. + * Get a hub setting. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hub setting list as paginated response with {@link PagedIterable}. + * @return a hub setting along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String resourceName); + Response getWithResponse(String resourceGroupName, String resourceName, String hubName, + Context context); /** - * List hub settings. + * Get a hub setting. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return hub setting list as paginated response with {@link PagedIterable}. + * @return a hub setting. */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); + WebPubSubHub get(String resourceGroupName, String resourceName, String hubName); /** - * Get a hub setting. + * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param hubName The hub name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hub setting along with {@link Response}. */ - Response getWithResponse(String hubName, String resourceGroupName, String resourceName, - Context context); + void delete(String resourceGroupName, String resourceName, String hubName); /** - * Get a hub setting. + * Delete a hub setting. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param hubName The hub name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a hub setting. */ - WebPubSubHub get(String hubName, String resourceGroupName, String resourceName); + void delete(String resourceGroupName, String resourceName, String hubName, Context context); /** - * Delete a hub setting. + * List hub settings. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hub setting list as paginated response with {@link PagedIterable}. */ - void delete(String hubName, String resourceGroupName, String resourceName); + PagedIterable list(String resourceGroupName, String resourceName); /** - * Delete a hub setting. + * List hub settings. * - * @param hubName The hub name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return hub setting list as paginated response with {@link PagedIterable}. */ - void delete(String hubName, String resourceGroupName, String resourceName, Context context); + PagedIterable list(String resourceGroupName, String resourceName, Context context); /** * Get a hub setting. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubKeys.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubKeys.java index ab5ea8831944..bd1d1120fc67 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubKeys.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubKeys.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubNetworkACLs.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubNetworkACLs.java index 28d43dc4cbb7..cc73fa0025b4 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubNetworkACLs.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubNetworkACLs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -123,23 +123,6 @@ public WebPubSubNetworkACLs withIpRules(List ipRules) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publicNetwork() != null) { - publicNetwork().validate(); - } - if (privateEndpoints() != null) { - privateEndpoints().forEach(e -> e.validate()); - } - if (ipRules() != null) { - ipRules().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPersistentStorages.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPersistentStorages.java new file mode 100644 index 000000000000..aeca3e1687b5 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPersistentStorages.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of WebPubSubPersistentStorages. + */ +public interface WebPubSubPersistentStorages { + /** + * Get a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, String name, + Context context); + + /** + * Get a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage. + */ + PersistentStorage get(String resourceGroupName, String resourceName, String name); + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String name); + + /** + * Delete a persistent storage. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param name Persistent storage name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String name, Context context); + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * List all persistent storages. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return persistent storages list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Get a persistent storage. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response}. + */ + PersistentStorage getById(String id); + + /** + * Get a persistent storage. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a persistent storage along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a persistent storage. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a persistent storage. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PersistentStorage resource. + * + * @param name resource name. + * @return the first stage of the new PersistentStorage definition. + */ + PersistentStorage.DefinitionStages.Blank define(String name); +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateEndpointConnections.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateEndpointConnections.java index cf976e792cc1..253ab132d337 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateEndpointConnections.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateEndpointConnections.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -14,117 +14,117 @@ */ public interface WebPubSubPrivateEndpointConnections { /** - * List private endpoint connections. + * Get the specified private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. + * @return the specified private endpoint connection along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String resourceName); + Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context); /** - * List private endpoint connections. + * Get the specified private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. + * @return the specified private endpoint connection. */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); + PrivateEndpointConnection get(String resourceGroupName, String resourceName, String privateEndpointConnectionName); /** - * Get the specified private endpoint connection. + * Update the state of specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param parameters The resource of private endpoint and its properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection along with {@link Response}. + * @return a private endpoint connection to an azure resource along with {@link Response}. */ - Response getWithResponse(String privateEndpointConnectionName, String resourceGroupName, - String resourceName, Context context); + Response updateWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters, Context context); /** - * Get the specified private endpoint connection. + * Update the state of specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param parameters The resource of private endpoint and its properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection. + * @return a private endpoint connection to an azure resource. */ - PrivateEndpointConnection get(String privateEndpointConnectionName, String resourceGroupName, String resourceName); + PrivateEndpointConnection update(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner parameters); /** - * Update the state of specified private endpoint connection. + * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The resource of private endpoint and its properties. - * @param context The context to associate with this operation. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection to an azure resource along with {@link Response}. */ - Response updateWithResponse(String privateEndpointConnectionName, - String resourceGroupName, String resourceName, PrivateEndpointConnectionInner parameters, Context context); + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName); /** - * Update the state of specified private endpoint connection. + * Delete the specified private endpoint connection. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param parameters The resource of private endpoint and its properties. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a private endpoint connection to an azure resource. */ - PrivateEndpointConnection update(String privateEndpointConnectionName, String resourceGroupName, - String resourceName, PrivateEndpointConnectionInner parameters); + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); /** - * Delete the specified private endpoint connection. + * List private endpoint connections. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ - void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName); + PagedIterable list(String resourceGroupName, String resourceName); /** - * Delete the specified private endpoint connection. + * List private endpoint connections. * - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections as paginated response with {@link PagedIterable}. */ - void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context); + PagedIterable list(String resourceGroupName, String resourceName, Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateLinkResources.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateLinkResources.java index 6fedd4d23dce..cf5b9486e9ec 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateLinkResources.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateLinkResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicaSharedPrivateLinkResources.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicaSharedPrivateLinkResources.java index 68a8f515d166..2418d8867afa 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicaSharedPrivateLinkResources.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicaSharedPrivateLinkResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -13,34 +13,6 @@ * Resource collection API of WebPubSubReplicaSharedPrivateLinkResources. */ public interface WebPubSubReplicaSharedPrivateLinkResources { - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName, String replicaName); - - /** - * List shared private link resources. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String resourceName, String replicaName, - Context context); - /** * Get the specified shared private link resource. * @@ -104,4 +76,32 @@ SharedPrivateLinkResource createOrUpdate(String resourceGroupName, String resour */ SharedPrivateLinkResource createOrUpdate(String resourceGroupName, String resourceName, String replicaName, String sharedPrivateLinkResourceName, SharedPrivateLinkResourceInner parameters, Context context); + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, String replicaName); + + /** + * List shared private link resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, String replicaName, + Context context); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicas.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicas.java index d231b576eaaa..640ecb910ac2 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicas.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicas.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -13,32 +13,35 @@ */ public interface WebPubSubReplicas { /** - * List all replicas belong to this resource. + * Get the replica and its properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param replicaName The name of the replica. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the replica and its properties along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String resourceName); + Response getWithResponse(String resourceGroupName, String resourceName, String replicaName, + Context context); /** - * List all replicas belong to this resource. + * Get the replica and its properties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the replica and its properties. */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); + Replica get(String resourceGroupName, String resourceName, String replicaName); /** - * Get the replica and its properties. + * Operation to delete a replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. @@ -47,13 +50,13 @@ public interface WebPubSubReplicas { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replica and its properties along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String resourceName, String replicaName, + Response deleteWithResponse(String resourceGroupName, String resourceName, String replicaName, Context context); /** - * Get the replica and its properties. + * Operation to delete a replica. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. @@ -61,36 +64,33 @@ Response getWithResponse(String resourceGroupName, String resourceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the replica and its properties. */ - Replica get(String resourceGroupName, String resourceName, String replicaName); + void delete(String resourceGroupName, String resourceName, String replicaName); /** - * Operation to delete a replica. + * List all replicas belong to this resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return paged collection of Replica items as paginated response with {@link PagedIterable}. */ - Response deleteWithResponse(String resourceGroupName, String resourceName, String replicaName, - Context context); + PagedIterable list(String resourceGroupName, String resourceName); /** - * Operation to delete a replica. + * List all replicas belong to this resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. + * @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 paged collection of Replica items as paginated response with {@link PagedIterable}. */ - void delete(String resourceGroupName, String resourceName, String replicaName); + PagedIterable list(String resourceGroupName, String resourceName, Context context); /** * Operation to restart a replica. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubRequestType.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubRequestType.java index 63715ee3c7b8..8335a0eed28f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubRequestType.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubRequestType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubResource.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubResource.java index 36150aacf1f3..86260cb51bee 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubResource.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -172,6 +172,13 @@ public interface WebPubSubResource { */ WebPubSubNetworkACLs networkACLs(); + /** + * Gets the applicationFirewall property: Application firewall settings for the resource. + * + * @return the applicationFirewall value. + */ + ApplicationFirewallSettings applicationFirewall(); + /** * Gets the publicNetworkAccess property: Enable or disable public network access. Default to "Enabled". * When it's Enabled, network ACLs still apply. @@ -311,9 +318,10 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithSku, DefinitionStages.WithKind, DefinitionStages.WithIdentity, DefinitionStages.WithTls, DefinitionStages.WithLiveTraceConfiguration, DefinitionStages.WithResourceLogConfiguration, DefinitionStages.WithNetworkACLs, - DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithDisableLocalAuth, - DefinitionStages.WithDisableAadAuth, DefinitionStages.WithRegionEndpointEnabled, - DefinitionStages.WithResourceStopped, DefinitionStages.WithSocketIO { + DefinitionStages.WithApplicationFirewall, DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithDisableLocalAuth, DefinitionStages.WithDisableAadAuth, + DefinitionStages.WithRegionEndpointEnabled, DefinitionStages.WithResourceStopped, + DefinitionStages.WithSocketIO { /** * Executes the create request. * @@ -436,6 +444,19 @@ interface WithNetworkACLs { WithCreate withNetworkACLs(WebPubSubNetworkACLs networkACLs); } + /** + * The stage of the WebPubSubResource definition allowing to specify applicationFirewall. + */ + interface WithApplicationFirewall { + /** + * Specifies the applicationFirewall property: Application firewall settings for the resource. + * + * @param applicationFirewall Application firewall settings for the resource. + * @return the next definition stage. + */ + WithCreate withApplicationFirewall(ApplicationFirewallSettings applicationFirewall); + } + /** * The stage of the WebPubSubResource definition allowing to specify publicNetworkAccess. */ @@ -551,9 +572,9 @@ interface WithSocketIO { */ interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithIdentity, UpdateStages.WithTls, UpdateStages.WithLiveTraceConfiguration, UpdateStages.WithResourceLogConfiguration, - UpdateStages.WithNetworkACLs, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithDisableLocalAuth, - UpdateStages.WithDisableAadAuth, UpdateStages.WithRegionEndpointEnabled, UpdateStages.WithResourceStopped, - UpdateStages.WithSocketIO { + UpdateStages.WithNetworkACLs, UpdateStages.WithApplicationFirewall, UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithDisableLocalAuth, UpdateStages.WithDisableAadAuth, UpdateStages.WithRegionEndpointEnabled, + UpdateStages.WithResourceStopped, UpdateStages.WithSocketIO { /** * Executes the update request. * @@ -667,6 +688,19 @@ interface WithNetworkACLs { Update withNetworkACLs(WebPubSubNetworkACLs networkACLs); } + /** + * The stage of the WebPubSubResource update allowing to specify applicationFirewall. + */ + interface WithApplicationFirewall { + /** + * Specifies the applicationFirewall property: Application firewall settings for the resource. + * + * @param applicationFirewall Application firewall settings for the resource. + * @return the next definition stage. + */ + Update withApplicationFirewall(ApplicationFirewallSettings applicationFirewall); + } + /** * The stage of the WebPubSubResource update allowing to specify publicNetworkAccess. */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSharedPrivateLinkResources.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSharedPrivateLinkResources.java index 04d3faf47f80..e8289b41e755 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSharedPrivateLinkResources.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSharedPrivateLinkResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -13,82 +13,82 @@ */ public interface WebPubSubSharedPrivateLinkResources { /** - * List shared private link resources. + * Get the specified shared private link resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + * @return the specified shared private link resource along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String resourceName); + Response getWithResponse(String resourceGroupName, String resourceName, + String sharedPrivateLinkResourceName, Context context); /** - * List shared private link resources. + * Get the specified shared private link resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of shared private link resources as paginated response with {@link PagedIterable}. + * @return the specified shared private link resource. */ - PagedIterable list(String resourceGroupName, String resourceName, Context context); + SharedPrivateLinkResource get(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName); /** - * Get the specified shared private link resource. + * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified shared private link resource along with {@link Response}. */ - Response getWithResponse(String sharedPrivateLinkResourceName, String resourceGroupName, - String resourceName, Context context); + void delete(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName); /** - * Get the specified shared private link resource. + * Delete the specified shared private link resource. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param sharedPrivateLinkResourceName The name of the shared private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified shared private link resource. */ - SharedPrivateLinkResource get(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName); + void delete(String resourceGroupName, String resourceName, String sharedPrivateLinkResourceName, Context context); /** - * Delete the specified shared private link resource. + * List shared private link resources. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. */ - void delete(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName); + PagedIterable list(String resourceGroupName, String resourceName); /** - * Delete the specified shared private link resource. + * List shared private link resources. * - * @param sharedPrivateLinkResourceName The name of the shared private link resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of shared private link resources as paginated response with {@link PagedIterable}. */ - void delete(String sharedPrivateLinkResourceName, String resourceGroupName, String resourceName, Context context); + PagedIterable list(String resourceGroupName, String resourceName, Context context); /** * Get the specified shared private link resource. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSkuTier.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSkuTier.java index d724844bbb52..b0ebf3f7e399 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSkuTier.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSkuTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -14,22 +14,22 @@ */ public final class WebPubSubSkuTier extends ExpandableStringEnum { /** - * Static value Free for WebPubSubSkuTier. + * Free tier for WebPubSub service. */ public static final WebPubSubSkuTier FREE = fromString("Free"); /** - * Static value Basic for WebPubSubSkuTier. + * Basic tier for WebPubSub service (deprecated, use Standard instead). */ public static final WebPubSubSkuTier BASIC = fromString("Basic"); /** - * Static value Standard for WebPubSubSkuTier. + * Standard tier for WebPubSub service. */ public static final WebPubSubSkuTier STANDARD = fromString("Standard"); /** - * Static value Premium for WebPubSubSkuTier. + * Premium tier for WebPubSub service. */ public static final WebPubSubSkuTier PREMIUM = fromString("Premium"); diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSocketIOSettings.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSocketIOSettings.java index c0433dbcec9e..9bde378c571e 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSocketIOSettings.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSocketIOSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -53,14 +53,6 @@ public WebPubSubSocketIOSettings withServiceMode(String serviceMode) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubTlsSettings.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubTlsSettings.java index f8c131ba5c27..5d9b116ce2f0 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubTlsSettings.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubTlsSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -50,14 +50,6 @@ public WebPubSubTlsSettings withClientCertEnabled(Boolean clientCertEnabled) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubs.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubs.java index 4b9ab6a4f4e4..62f7310440b4 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubs.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubs.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.models; @@ -13,52 +13,53 @@ */ public interface WebPubSubs { /** - * Checks that the resource name is valid and is not already in use. + * Get the resource and its properties. * - * @param location the region. - * @param parameters Parameters supplied to the operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to check name availability along with {@link Response}. + * @return the resource and its properties along with {@link Response}. */ - Response checkNameAvailabilityWithResponse(String location, NameAvailabilityParameters parameters, + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); /** - * Checks that the resource name is valid and is not already in use. + * Get the resource and its properties. * - * @param location the region. - * @param parameters Parameters supplied to the operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to check name availability. + * @return the resource and its properties. */ - NameAvailability checkNameAvailability(String location, NameAvailabilityParameters parameters); + WebPubSubResource getByResourceGroup(String resourceGroupName, String resourceName); /** - * Handles requests to list all resources in a subscription. + * Operation to delete a resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. */ - PagedIterable list(); + void deleteByResourceGroup(String resourceGroupName, String resourceName); /** - * Handles requests to list all resources in a subscription. + * Operation to delete a resource. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that includes an array of resources and a possible link for next set as paginated response with - * {@link PagedIterable}. */ - PagedIterable list(Context context); + void delete(String resourceGroupName, String resourceName, Context context); /** * Handles requests to list all resources in a resource group. @@ -86,53 +87,26 @@ Response checkNameAvailabilityWithResponse(String location, Na PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Get the resource and its properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * Get the resource and its properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource and its properties. - */ - WebPubSubResource getByResourceGroup(String resourceGroupName, String resourceName); - - /** - * Operation to delete a resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - void deleteByResourceGroup(String resourceGroupName, String resourceName); + PagedIterable list(); /** - * Operation to delete a resource. + * Handles requests to list all resources in a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of resources and a possible link for next set as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String resourceName, Context context); + PagedIterable list(Context context); /** * Get the access keys of the resource. @@ -188,80 +162,106 @@ WebPubSubKeys regenerateKey(String resourceGroupName, String resourceName, Regen Context context); /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response along with {@link Response}. */ - Response listReplicaSkusWithResponse(String resourceGroupName, String resourceName, String replicaName, - Context context); + void restart(String resourceGroupName, String resourceName); /** - * List all available skus of the replica resource. + * Operation to restart a resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param replicaName The name of the replica. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list skus operation response. */ - SkuList listReplicaSkus(String resourceGroupName, String resourceName, String replicaName); + void restart(String resourceGroupName, String resourceName, Context context); /** - * Operation to restart a resource. + * List all available skus of the resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list skus operation response along with {@link Response}. */ - void restart(String resourceGroupName, String resourceName); + Response listSkusWithResponse(String resourceGroupName, String resourceName, Context context); /** - * Operation to restart a resource. + * List all available skus of the resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list skus operation response. */ - void restart(String resourceGroupName, String resourceName, Context context); + SkuList listSkus(String resourceGroupName, String resourceName); /** - * List all available skus of the resource. + * List all available skus of the replica resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param replicaName The name of the replica. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list skus operation response along with {@link Response}. */ - Response listSkusWithResponse(String resourceGroupName, String resourceName, Context context); + Response listReplicaSkusWithResponse(String resourceGroupName, String resourceName, String replicaName, + Context context); /** - * List all available skus of the resource. + * List all available skus of the replica resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. + * @param replicaName The name of the replica. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list skus operation response. */ - SkuList listSkus(String resourceGroupName, String resourceName); + SkuList listReplicaSkus(String resourceGroupName, String resourceName, String replicaName); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location The location name. + * @param parameters The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to check name availability along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse(String location, NameAvailabilityParameters parameters, + Context context); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location The location name. + * @param parameters The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to check name availability. + */ + NameAvailability checkNameAvailability(String location, NameAvailabilityParameters parameters); /** * Get the resource and its properties. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/package-info.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/package-info.java index 1f41781aff62..cf6f11d68132 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/package-info.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for WebPubSubManagementClient. + * Package containing the data models for WebPubSub. * REST API for Azure WebPubSub Service. */ package com.azure.resourcemanager.webpubsub.models; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/package-info.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/package-info.java index d22092066c69..6d810f1ad2e1 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/package-info.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for WebPubSubManagementClient. + * Package containing the classes for WebPubSub. * REST API for Azure WebPubSub Service. */ package com.azure.resourcemanager.webpubsub; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/module-info.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/module-info.java index 4cb057fbf0fd..f25934393bd9 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/module-info.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.webpubsub { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.webpubsub.fluent.models to com.azure.core; opens com.azure.resourcemanager.webpubsub.models to com.azure.core; + opens com.azure.resourcemanager.webpubsub.implementation.models to com.azure.core; } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/META-INF/azure-resourcemanager-webpubsub_metadata.json b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/META-INF/azure-resourcemanager-webpubsub_metadata.json new file mode 100644 index 000000000000..5474ca01129d --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/META-INF/azure-resourcemanager-webpubsub_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.SignalRService":"2025-12-01-preview"},"crossLanguagePackageId":"Microsoft.SignalRService","crossLanguageVersion":"90c1f5000bdb","crossLanguageDefinitions":{"com.azure.resourcemanager.webpubsub.fluent.OperationsClient":"Microsoft.SignalRService.Operations","com.azure.resourcemanager.webpubsub.fluent.OperationsClient.list":"Microsoft.SignalRService.Operations.list","com.azure.resourcemanager.webpubsub.fluent.UsagesClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.UsagesClient.list":"Microsoft.SignalRService.UsagesOperationGroup.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient.beginCreateOrUpdate":"Microsoft.SignalRService.CustomCertificates.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient.createOrUpdate":"Microsoft.SignalRService.CustomCertificates.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient.delete":"Microsoft.SignalRService.CustomCertificates.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient.deleteWithResponse":"Microsoft.SignalRService.CustomCertificates.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient.get":"Microsoft.SignalRService.CustomCertificates.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient.getWithResponse":"Microsoft.SignalRService.CustomCertificates.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomCertificatesClient.list":"Microsoft.SignalRService.CustomCertificates.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient.beginCreateOrUpdate":"Microsoft.SignalRService.CustomDomains.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient.beginDelete":"Microsoft.SignalRService.CustomDomains.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient.createOrUpdate":"Microsoft.SignalRService.CustomDomains.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient.delete":"Microsoft.SignalRService.CustomDomains.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient.get":"Microsoft.SignalRService.CustomDomains.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient.getWithResponse":"Microsoft.SignalRService.CustomDomains.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubCustomDomainsClient.list":"Microsoft.SignalRService.CustomDomains.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient":"Microsoft.SignalRService.WebPubSubHubs","com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient.beginCreateOrUpdate":"Microsoft.SignalRService.WebPubSubHubs.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient.beginDelete":"Microsoft.SignalRService.WebPubSubHubs.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient.createOrUpdate":"Microsoft.SignalRService.WebPubSubHubs.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient.delete":"Microsoft.SignalRService.WebPubSubHubs.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient.get":"Microsoft.SignalRService.WebPubSubHubs.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient.getWithResponse":"Microsoft.SignalRService.WebPubSubHubs.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubHubsClient.list":"Microsoft.SignalRService.WebPubSubHubs.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubManagementClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient.beginCreateOrUpdate":"Microsoft.SignalRService.PersistentStorages.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient.beginDelete":"Microsoft.SignalRService.PersistentStorages.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient.createOrUpdate":"Microsoft.SignalRService.PersistentStorages.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient.delete":"Microsoft.SignalRService.PersistentStorages.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient.get":"Microsoft.SignalRService.PersistentStorages.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient.getWithResponse":"Microsoft.SignalRService.PersistentStorages.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPersistentStoragesClient.list":"Microsoft.SignalRService.PersistentStorages.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient.beginDelete":"Microsoft.SignalRService.PrivateEndpointConnections.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient.delete":"Microsoft.SignalRService.PrivateEndpointConnections.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient.get":"Microsoft.SignalRService.PrivateEndpointConnections.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient.getWithResponse":"Microsoft.SignalRService.PrivateEndpointConnections.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient.list":"Microsoft.SignalRService.PrivateEndpointConnections.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient.update":"Microsoft.SignalRService.PrivateEndpointConnections.update","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateEndpointConnectionsClient.updateWithResponse":"Microsoft.SignalRService.PrivateEndpointConnections.update","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateLinkResourcesClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubPrivateLinkResourcesClient.list":"Microsoft.SignalRService.WebPubSubResources.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicaSharedPrivateLinkResourcesClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicaSharedPrivateLinkResourcesClient.beginCreateOrUpdate":"Microsoft.SignalRService.SharedPrivateLinkResources.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicaSharedPrivateLinkResourcesClient.createOrUpdate":"Microsoft.SignalRService.SharedPrivateLinkResources.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicaSharedPrivateLinkResourcesClient.get":"Microsoft.SignalRService.SharedPrivateLinkResources.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicaSharedPrivateLinkResourcesClient.getWithResponse":"Microsoft.SignalRService.SharedPrivateLinkResources.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicaSharedPrivateLinkResourcesClient.list":"Microsoft.SignalRService.SharedPrivateLinkResources.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.beginCreateOrUpdate":"Microsoft.SignalRService.Replicas.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.beginRestart":"Microsoft.SignalRService.Replicas.restart","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.beginUpdate":"Microsoft.SignalRService.Replicas.update","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.createOrUpdate":"Microsoft.SignalRService.Replicas.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.delete":"Microsoft.SignalRService.Replicas.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.deleteWithResponse":"Microsoft.SignalRService.Replicas.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.get":"Microsoft.SignalRService.Replicas.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.getWithResponse":"Microsoft.SignalRService.Replicas.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.list":"Microsoft.SignalRService.Replicas.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.restart":"Microsoft.SignalRService.Replicas.restart","com.azure.resourcemanager.webpubsub.fluent.WebPubSubReplicasClient.update":"Microsoft.SignalRService.Replicas.update","com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient":"Microsoft.SignalRService.WebPubSubSharedPrivateLinkResources","com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient.beginCreateOrUpdate":"Microsoft.SignalRService.WebPubSubSharedPrivateLinkResources.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient.beginDelete":"Microsoft.SignalRService.WebPubSubSharedPrivateLinkResources.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient.createOrUpdate":"Microsoft.SignalRService.WebPubSubSharedPrivateLinkResources.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient.delete":"Microsoft.SignalRService.WebPubSubSharedPrivateLinkResources.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient.get":"Microsoft.SignalRService.WebPubSubSharedPrivateLinkResources.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient.getWithResponse":"Microsoft.SignalRService.WebPubSubSharedPrivateLinkResources.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubSharedPrivateLinkResourcesClient.list":"Microsoft.SignalRService.WebPubSubSharedPrivateLinkResources.list","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.beginCreateOrUpdate":"Microsoft.SignalRService.WebPubSubResources.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.beginDelete":"Microsoft.SignalRService.WebPubSubResources.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.beginRegenerateKey":"Microsoft.SignalRService.WebPubSubResources.regenerateKey","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.beginRestart":"Microsoft.SignalRService.WebPubSubResources.restart","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.beginUpdate":"Microsoft.SignalRService.WebPubSubResources.update","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.checkNameAvailability":"Microsoft.SignalRService.WebPubSubOperationGroup.checkNameAvailability","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.checkNameAvailabilityWithResponse":"Microsoft.SignalRService.WebPubSubOperationGroup.checkNameAvailability","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.createOrUpdate":"Microsoft.SignalRService.WebPubSubResources.createOrUpdate","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.delete":"Microsoft.SignalRService.WebPubSubResources.delete","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.getByResourceGroup":"Microsoft.SignalRService.WebPubSubResources.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.getByResourceGroupWithResponse":"Microsoft.SignalRService.WebPubSubResources.get","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.list":"Microsoft.SignalRService.WebPubSubResources.listBySubscription","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.listByResourceGroup":"Microsoft.SignalRService.WebPubSubResources.listByResourceGroup","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.listKeys":"Microsoft.SignalRService.WebPubSubResources.listKeys","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.listKeysWithResponse":"Microsoft.SignalRService.WebPubSubResources.listKeys","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.listReplicaSkus":"Microsoft.SignalRService.Replicas.listReplicaSkus","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.listReplicaSkusWithResponse":"Microsoft.SignalRService.Replicas.listReplicaSkus","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.listSkus":"Microsoft.SignalRService.WebPubSubResources.listSkus","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.listSkusWithResponse":"Microsoft.SignalRService.WebPubSubResources.listSkus","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.regenerateKey":"Microsoft.SignalRService.WebPubSubResources.regenerateKey","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.restart":"Microsoft.SignalRService.WebPubSubResources.restart","com.azure.resourcemanager.webpubsub.fluent.WebPubSubsClient.update":"Microsoft.SignalRService.WebPubSubResources.update","com.azure.resourcemanager.webpubsub.fluent.models.CustomCertificateInner":"Microsoft.SignalRService.CustomCertificate","com.azure.resourcemanager.webpubsub.fluent.models.CustomCertificateProperties":"Microsoft.SignalRService.CustomCertificateProperties","com.azure.resourcemanager.webpubsub.fluent.models.CustomDomainInner":"Microsoft.SignalRService.CustomDomain","com.azure.resourcemanager.webpubsub.fluent.models.CustomDomainProperties":"Microsoft.SignalRService.CustomDomainProperties","com.azure.resourcemanager.webpubsub.fluent.models.NameAvailabilityInner":"Microsoft.SignalRService.NameAvailability","com.azure.resourcemanager.webpubsub.fluent.models.OperationInner":"Microsoft.SignalRService.Operation","com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner":"Microsoft.SignalRService.PersistentStorage","com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageProperties":"Microsoft.SignalRService.PersistentStorageProperties","com.azure.resourcemanager.webpubsub.fluent.models.PrivateEndpointConnectionInner":"Microsoft.SignalRService.PrivateEndpointConnection","com.azure.resourcemanager.webpubsub.fluent.models.PrivateEndpointConnectionProperties":"Microsoft.SignalRService.PrivateEndpointConnectionProperties","com.azure.resourcemanager.webpubsub.fluent.models.PrivateLinkResourceInner":"Microsoft.SignalRService.PrivateLinkResource","com.azure.resourcemanager.webpubsub.fluent.models.PrivateLinkResourceProperties":"Microsoft.SignalRService.PrivateLinkResourceProperties","com.azure.resourcemanager.webpubsub.fluent.models.ReplicaInner":"Microsoft.SignalRService.Replica","com.azure.resourcemanager.webpubsub.fluent.models.ReplicaProperties":"Microsoft.SignalRService.ReplicaProperties","com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceInner":"Microsoft.SignalRService.SharedPrivateLinkResource","com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceProperties":"Microsoft.SignalRService.SharedPrivateLinkResourceProperties","com.azure.resourcemanager.webpubsub.fluent.models.SignalRServiceUsageInner":"Microsoft.SignalRService.SignalRServiceUsage","com.azure.resourcemanager.webpubsub.fluent.models.SkuListInner":"Microsoft.SignalRService.SkuList","com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubHubInner":"Microsoft.SignalRService.WebPubSubHub","com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubKeysInner":"Microsoft.SignalRService.WebPubSubKeys","com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubProperties":"Microsoft.SignalRService.WebPubSubProperties","com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubResourceInner":"Microsoft.SignalRService.WebPubSubResource","com.azure.resourcemanager.webpubsub.implementation.WebPubSubManagementClientBuilder":"Microsoft.SignalRService","com.azure.resourcemanager.webpubsub.implementation.models.CustomCertificateList":"Microsoft.SignalRService.CustomCertificateList","com.azure.resourcemanager.webpubsub.implementation.models.CustomDomainList":"Microsoft.SignalRService.CustomDomainList","com.azure.resourcemanager.webpubsub.implementation.models.OperationList":"Microsoft.SignalRService.OperationList","com.azure.resourcemanager.webpubsub.implementation.models.PersistentStorageList":"Microsoft.SignalRService.PersistentStorageList","com.azure.resourcemanager.webpubsub.implementation.models.PrivateEndpointConnectionList":"Microsoft.SignalRService.PrivateEndpointConnectionList","com.azure.resourcemanager.webpubsub.implementation.models.PrivateLinkResourceList":"Microsoft.SignalRService.PrivateLinkResourceList","com.azure.resourcemanager.webpubsub.implementation.models.ReplicaList":"Microsoft.SignalRService.ReplicaList","com.azure.resourcemanager.webpubsub.implementation.models.SharedPrivateLinkResourceList":"Microsoft.SignalRService.SharedPrivateLinkResourceList","com.azure.resourcemanager.webpubsub.implementation.models.SignalRServiceUsageList":"Microsoft.SignalRService.SignalRServiceUsageList","com.azure.resourcemanager.webpubsub.implementation.models.WebPubSubHubList":"Microsoft.SignalRService.WebPubSubHubList","com.azure.resourcemanager.webpubsub.implementation.models.WebPubSubResourceList":"Microsoft.SignalRService.WebPubSubResourceList","com.azure.resourcemanager.webpubsub.models.AclAction":"Microsoft.SignalRService.ACLAction","com.azure.resourcemanager.webpubsub.models.ApplicationFirewallSettings":"Microsoft.SignalRService.ApplicationFirewallSettings","com.azure.resourcemanager.webpubsub.models.ChatSettings":"Microsoft.SignalRService.ChatSettings","com.azure.resourcemanager.webpubsub.models.ClientConnectionCountRule":"Microsoft.SignalRService.ClientConnectionCountRule","com.azure.resourcemanager.webpubsub.models.ClientConnectionCountRuleDiscriminator":"Microsoft.SignalRService.ClientConnectionCountRuleDiscriminator","com.azure.resourcemanager.webpubsub.models.ClientTrafficControlRule":"Microsoft.SignalRService.ClientTrafficControlRule","com.azure.resourcemanager.webpubsub.models.ClientTrafficControlRuleDiscriminator":"Microsoft.SignalRService.ClientTrafficControlRuleDiscriminator","com.azure.resourcemanager.webpubsub.models.Dimension":"Microsoft.SignalRService.Dimension","com.azure.resourcemanager.webpubsub.models.EventHandler":"Microsoft.SignalRService.EventHandler","com.azure.resourcemanager.webpubsub.models.EventHubEndpoint":"Microsoft.SignalRService.EventHubEndpoint","com.azure.resourcemanager.webpubsub.models.EventListener":"Microsoft.SignalRService.EventListener","com.azure.resourcemanager.webpubsub.models.EventListenerEndpoint":"Microsoft.SignalRService.EventListenerEndpoint","com.azure.resourcemanager.webpubsub.models.EventListenerEndpointDiscriminator":"Microsoft.SignalRService.EventListenerEndpointDiscriminator","com.azure.resourcemanager.webpubsub.models.EventListenerFilter":"Microsoft.SignalRService.EventListenerFilter","com.azure.resourcemanager.webpubsub.models.EventListenerFilterDiscriminator":"Microsoft.SignalRService.EventListenerFilterDiscriminator","com.azure.resourcemanager.webpubsub.models.EventNameFilter":"Microsoft.SignalRService.EventNameFilter","com.azure.resourcemanager.webpubsub.models.GroupPresenceEventFilters":"Microsoft.SignalRService.GroupPresenceEventFilters","com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName":"Microsoft.SignalRService.GroupPresenceEventName","com.azure.resourcemanager.webpubsub.models.IpRule":"Microsoft.SignalRService.IPRule","com.azure.resourcemanager.webpubsub.models.KeyType":"Microsoft.SignalRService.KeyType","com.azure.resourcemanager.webpubsub.models.LiveTraceCategory":"Microsoft.SignalRService.LiveTraceCategory","com.azure.resourcemanager.webpubsub.models.LiveTraceConfiguration":"Microsoft.SignalRService.LiveTraceConfiguration","com.azure.resourcemanager.webpubsub.models.LogSpecification":"Microsoft.SignalRService.LogSpecification","com.azure.resourcemanager.webpubsub.models.ManagedIdentity":"Microsoft.SignalRService.ManagedIdentity","com.azure.resourcemanager.webpubsub.models.ManagedIdentitySettings":"Microsoft.SignalRService.ManagedIdentitySettings","com.azure.resourcemanager.webpubsub.models.ManagedIdentityType":"Microsoft.SignalRService.ManagedIdentityType","com.azure.resourcemanager.webpubsub.models.MetricSpecification":"Microsoft.SignalRService.MetricSpecification","com.azure.resourcemanager.webpubsub.models.NameAvailabilityParameters":"Microsoft.SignalRService.NameAvailabilityParameters","com.azure.resourcemanager.webpubsub.models.NetworkAcl":"Microsoft.SignalRService.NetworkACL","com.azure.resourcemanager.webpubsub.models.OperationDisplay":"Microsoft.SignalRService.OperationDisplay","com.azure.resourcemanager.webpubsub.models.OperationProperties":"Microsoft.SignalRService.OperationProperties","com.azure.resourcemanager.webpubsub.models.PrivateEndpoint":"Microsoft.SignalRService.PrivateEndpoint","com.azure.resourcemanager.webpubsub.models.PrivateEndpointAcl":"Microsoft.SignalRService.PrivateEndpointACL","com.azure.resourcemanager.webpubsub.models.PrivateLinkServiceConnectionState":"Microsoft.SignalRService.PrivateLinkServiceConnectionState","com.azure.resourcemanager.webpubsub.models.PrivateLinkServiceConnectionStatus":"Microsoft.SignalRService.PrivateLinkServiceConnectionStatus","com.azure.resourcemanager.webpubsub.models.ProvisioningState":"Microsoft.SignalRService.ProvisioningState","com.azure.resourcemanager.webpubsub.models.RegenerateKeyParameters":"Microsoft.SignalRService.RegenerateKeyParameters","com.azure.resourcemanager.webpubsub.models.ResourceLogCategory":"Microsoft.SignalRService.ResourceLogCategory","com.azure.resourcemanager.webpubsub.models.ResourceLogConfiguration":"Microsoft.SignalRService.ResourceLogConfiguration","com.azure.resourcemanager.webpubsub.models.ResourceReference":"Microsoft.SignalRService.ResourceReference","com.azure.resourcemanager.webpubsub.models.ResourceSku":"Microsoft.SignalRService.ResourceSku","com.azure.resourcemanager.webpubsub.models.ScaleType":"Microsoft.SignalRService.ScaleType","com.azure.resourcemanager.webpubsub.models.ServiceKind":"Microsoft.SignalRService.ServiceKind","com.azure.resourcemanager.webpubsub.models.ServiceSpecification":"Microsoft.SignalRService.ServiceSpecification","com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceProperties":"Microsoft.SignalRService.ShareablePrivateLinkResourceProperties","com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceType":"Microsoft.SignalRService.ShareablePrivateLinkResourceType","com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResourceStatus":"Microsoft.SignalRService.SharedPrivateLinkResourceStatus","com.azure.resourcemanager.webpubsub.models.SignalRServiceUsageName":"Microsoft.SignalRService.SignalRServiceUsageName","com.azure.resourcemanager.webpubsub.models.Sku":"Microsoft.SignalRService.Sku","com.azure.resourcemanager.webpubsub.models.SkuCapacity":"Microsoft.SignalRService.SkuCapacity","com.azure.resourcemanager.webpubsub.models.ThrottleByJwtCustomClaimRule":"Microsoft.SignalRService.ThrottleByJwtCustomClaimRule","com.azure.resourcemanager.webpubsub.models.ThrottleByJwtSignatureRule":"Microsoft.SignalRService.ThrottleByJwtSignatureRule","com.azure.resourcemanager.webpubsub.models.ThrottleByUserIdRule":"Microsoft.SignalRService.ThrottleByUserIdRule","com.azure.resourcemanager.webpubsub.models.TrafficThrottleByJwtCustomClaimRule":"Microsoft.SignalRService.TrafficThrottleByJwtCustomClaimRule","com.azure.resourcemanager.webpubsub.models.TrafficThrottleByJwtSignatureRule":"Microsoft.SignalRService.TrafficThrottleByJwtSignatureRule","com.azure.resourcemanager.webpubsub.models.TrafficThrottleByUserIdRule":"Microsoft.SignalRService.TrafficThrottleByUserIdRule","com.azure.resourcemanager.webpubsub.models.UpstreamAuthSettings":"Microsoft.SignalRService.UpstreamAuthSettings","com.azure.resourcemanager.webpubsub.models.UpstreamAuthType":"Microsoft.SignalRService.UpstreamAuthType","com.azure.resourcemanager.webpubsub.models.UserAssignedIdentityProperty":"Microsoft.SignalRService.UserAssignedIdentityProperty","com.azure.resourcemanager.webpubsub.models.WebPubSubHubProperties":"Microsoft.SignalRService.WebPubSubHubProperties","com.azure.resourcemanager.webpubsub.models.WebPubSubNetworkACLs":"Microsoft.SignalRService.WebPubSubNetworkACLs","com.azure.resourcemanager.webpubsub.models.WebPubSubRequestType":"Microsoft.SignalRService.WebPubSubRequestType","com.azure.resourcemanager.webpubsub.models.WebPubSubSkuTier":"Microsoft.SignalRService.WebPubSubSkuTier","com.azure.resourcemanager.webpubsub.models.WebPubSubSocketIOSettings":"Microsoft.SignalRService.WebPubSubSocketIOSettings","com.azure.resourcemanager.webpubsub.models.WebPubSubTlsSettings":"Microsoft.SignalRService.WebPubSubTlsSettings"},"generatedFiles":["src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/UsagesClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomCertificatesClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubCustomDomainsClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubHubsClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubManagementClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPersistentStoragesClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubPrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicaSharedPrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubReplicasClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubSharedPrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/WebPubSubsClient.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomCertificateProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/CustomDomainProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/NameAvailabilityInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PersistentStorageInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PersistentStorageProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/ReplicaProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SharedPrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SignalRServiceUsageInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/SkuListInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubHubInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubKeysInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/WebPubSubResourceInner.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/webpubsub/fluent/package-info.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomCertificateImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/CustomDomainImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/NameAvailabilityImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/PersistentStorageImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/PrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/ReplicaImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/SharedPrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/SignalRServiceUsageImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/SkuListImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/UsagesImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomCertificatesImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubCustomDomainsImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubKeysImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubManagementClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPersistentStoragesClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPersistentStoragesImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicaSharedPrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsImpl.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/CustomCertificateList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/CustomDomainList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/OperationList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PersistentStorageList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PrivateEndpointConnectionList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/PrivateLinkResourceList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/ReplicaList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/SharedPrivateLinkResourceList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/SignalRServiceUsageList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/WebPubSubHubList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/models/WebPubSubResourceList.java","src/main/java/com/azure/resourcemanager/webpubsub/implementation/package-info.java","src/main/java/com/azure/resourcemanager/webpubsub/models/AclAction.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ApplicationFirewallSettings.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ChatSettings.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ClientConnectionCountRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ClientConnectionCountRuleDiscriminator.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ClientTrafficControlRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ClientTrafficControlRuleDiscriminator.java","src/main/java/com/azure/resourcemanager/webpubsub/models/CustomCertificate.java","src/main/java/com/azure/resourcemanager/webpubsub/models/CustomDomain.java","src/main/java/com/azure/resourcemanager/webpubsub/models/Dimension.java","src/main/java/com/azure/resourcemanager/webpubsub/models/EventHandler.java","src/main/java/com/azure/resourcemanager/webpubsub/models/EventHubEndpoint.java","src/main/java/com/azure/resourcemanager/webpubsub/models/EventListener.java","src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpoint.java","src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerEndpointDiscriminator.java","src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilter.java","src/main/java/com/azure/resourcemanager/webpubsub/models/EventListenerFilterDiscriminator.java","src/main/java/com/azure/resourcemanager/webpubsub/models/EventNameFilter.java","src/main/java/com/azure/resourcemanager/webpubsub/models/GroupPresenceEventFilters.java","src/main/java/com/azure/resourcemanager/webpubsub/models/GroupPresenceEventName.java","src/main/java/com/azure/resourcemanager/webpubsub/models/IpRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/KeyType.java","src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceCategory.java","src/main/java/com/azure/resourcemanager/webpubsub/models/LiveTraceConfiguration.java","src/main/java/com/azure/resourcemanager/webpubsub/models/LogSpecification.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentity.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentitySettings.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ManagedIdentityType.java","src/main/java/com/azure/resourcemanager/webpubsub/models/MetricSpecification.java","src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailability.java","src/main/java/com/azure/resourcemanager/webpubsub/models/NameAvailabilityParameters.java","src/main/java/com/azure/resourcemanager/webpubsub/models/NetworkAcl.java","src/main/java/com/azure/resourcemanager/webpubsub/models/Operation.java","src/main/java/com/azure/resourcemanager/webpubsub/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/webpubsub/models/OperationProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/models/Operations.java","src/main/java/com/azure/resourcemanager/webpubsub/models/PersistentStorage.java","src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointAcl.java","src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/webpubsub/models/PrivateLinkServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/webpubsub/models/RegenerateKeyParameters.java","src/main/java/com/azure/resourcemanager/webpubsub/models/Replica.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogCategory.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceLogConfiguration.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceReference.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ResourceSku.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ScaleType.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceKind.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ServiceSpecification.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ShareablePrivateLinkResourceType.java","src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResource.java","src/main/java/com/azure/resourcemanager/webpubsub/models/SharedPrivateLinkResourceStatus.java","src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsage.java","src/main/java/com/azure/resourcemanager/webpubsub/models/SignalRServiceUsageName.java","src/main/java/com/azure/resourcemanager/webpubsub/models/Sku.java","src/main/java/com/azure/resourcemanager/webpubsub/models/SkuCapacity.java","src/main/java/com/azure/resourcemanager/webpubsub/models/SkuList.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByJwtCustomClaimRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByJwtSignatureRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/ThrottleByUserIdRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByJwtCustomClaimRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByJwtSignatureRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/TrafficThrottleByUserIdRule.java","src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthSettings.java","src/main/java/com/azure/resourcemanager/webpubsub/models/UpstreamAuthType.java","src/main/java/com/azure/resourcemanager/webpubsub/models/Usages.java","src/main/java/com/azure/resourcemanager/webpubsub/models/UserAssignedIdentityProperty.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomCertificates.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubCustomDomains.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHub.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubProperties.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubHubs.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubKeys.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubNetworkACLs.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPersistentStorages.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubPrivateLinkResources.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicaSharedPrivateLinkResources.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubReplicas.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubRequestType.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubResource.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSharedPrivateLinkResources.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSkuTier.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubSocketIOSettings.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubTlsSettings.java","src/main/java/com/azure/resourcemanager/webpubsub/models/WebPubSubs.java","src/main/java/com/azure/resourcemanager/webpubsub/models/package-info.java","src/main/java/com/azure/resourcemanager/webpubsub/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-webpubsub/proxy-config.json b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-webpubsub/proxy-config.json index 60136caca4bc..cea55fee71aa 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-webpubsub/proxy-config.json +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-webpubsub/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.webpubsub.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.webpubsub.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubCustomCertificatesClientImpl$WebPubSubCustomCertificatesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubCustomDomainsClientImpl$WebPubSubCustomDomainsService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubHubsClientImpl$WebPubSubHubsService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubPrivateEndpointConnectionsClientImpl$WebPubSubPrivateEndpointConnectionsService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubPrivateLinkResourcesClientImpl$WebPubSubPrivateLinkResourcesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubReplicaSharedPrivateLinkResourcesClientImpl$WebPubSubReplicaSharedPrivateLinkResourcesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubReplicasClientImpl$WebPubSubReplicasService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubSharedPrivateLinkResourcesClientImpl$WebPubSubSharedPrivateLinkResourcesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubsClientImpl$WebPubSubsService"]] \ No newline at end of file +[["com.azure.resourcemanager.webpubsub.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.webpubsub.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubCustomCertificatesClientImpl$WebPubSubCustomCertificatesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubCustomDomainsClientImpl$WebPubSubCustomDomainsService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubHubsClientImpl$WebPubSubHubsService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubPersistentStoragesClientImpl$WebPubSubPersistentStoragesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubPrivateEndpointConnectionsClientImpl$WebPubSubPrivateEndpointConnectionsService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubPrivateLinkResourcesClientImpl$WebPubSubPrivateLinkResourcesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubReplicaSharedPrivateLinkResourcesClientImpl$WebPubSubReplicaSharedPrivateLinkResourcesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubReplicasClientImpl$WebPubSubReplicasService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubSharedPrivateLinkResourcesClientImpl$WebPubSubSharedPrivateLinkResourcesService"],["com.azure.resourcemanager.webpubsub.implementation.WebPubSubsClientImpl$WebPubSubsService"]] \ No newline at end of file diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/azure-resourcemanager-webpubsub.properties b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/azure-resourcemanager-webpubsub.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/resources/azure-resourcemanager-webpubsub.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/OperationsListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/OperationsListSamples.java index 89931d80587e..281f6ea2e864 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/OperationsListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/Operations_List.json + * x-ms-original-file: 2025-12-01-preview/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/UsagesListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/UsagesListSamples.java index bf3ccaa517fd..e0b76d0c9419 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/UsagesListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/UsagesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class UsagesListSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/Usages_List.json + * x-ms-original-file: 2025-12-01-preview/Usages_List.json */ /** * Sample code: Usages_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCheckNameAvailabilitySamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCheckNameAvailabilitySamples.java index 8cd48f3542b9..d229b21aff2f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCheckNameAvailabilitySamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCheckNameAvailabilitySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,8 +11,7 @@ */ public final class WebPubSubCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_CheckNameAvailability.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_CheckNameAvailability.json */ /** * Sample code: WebPubSub_CheckNameAvailability. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCreateOrUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCreateOrUpdateSamples.java index d58e3e966a6a..8be8d0421c0e 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCreateOrUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -27,8 +27,7 @@ */ public final class WebPubSubCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_CreateOrUpdate.json */ /** * Sample code: WebPubSub_CreateOrUpdate. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesCreateOrUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesCreateOrUpdateSamples.java index 06355decb81f..7009e166ecf7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesCreateOrUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubCustomCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomCertificates_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomCertificates_CreateOrUpdate.json */ /** * Sample code: WebPubSubCustomCertificates_CreateOrUpdate. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesDeleteSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesDeleteSamples.java index 03675b4f927a..40ec7b3076de 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesDeleteSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubCustomCertificatesDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomCertificates_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomCertificates_Delete.json */ /** * Sample code: WebPubSubCustomCertificates_Delete. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesGetSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesGetSamples.java index 2923ba57afe5..cc8a2866d524 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesGetSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubCustomCertificatesGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomCertificates_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomCertificates_Get.json */ /** * Sample code: WebPubSubCustomCertificates_Get. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesListSamples.java index c642cfb8058d..d9242debc210 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubCustomCertificatesListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomCertificates_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomCertificates_List.json */ /** * Sample code: WebPubSubCustomCertificates_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsCreateOrUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsCreateOrUpdateSamples.java index e3bf161d3ebf..94a36f36bbb4 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsCreateOrUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,8 +11,7 @@ */ public final class WebPubSubCustomDomainsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomDomains_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomDomains_CreateOrUpdate.json */ /** * Sample code: WebPubSubCustomDomains_CreateOrUpdate. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsDeleteSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsDeleteSamples.java index d94850a0feac..19352f05ff90 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsDeleteSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubCustomDomainsDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomDomains_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomDomains_Delete.json */ /** * Sample code: WebPubSubCustomDomains_Delete. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsGetSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsGetSamples.java index a6edc4379104..b177579f12cb 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsGetSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubCustomDomainsGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomDomains_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomDomains_Get.json */ /** * Sample code: WebPubSubCustomDomains_Get. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsListSamples.java index 63ef6c666441..89b442445586 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubCustomDomainsListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubCustomDomains_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubCustomDomains_List.json */ /** * Sample code: WebPubSubCustomDomains_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubDeleteSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubDeleteSamples.java index 2f300464583a..b62274b4b0bf 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubDeleteSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,9 +9,7 @@ */ public final class WebPubSubDeleteSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_Delete. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_Delete.json */ /** * Sample code: WebPubSub_Delete. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubGetByResourceGroupSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubGetByResourceGroupSamples.java index b62da6c4e10c..3b99c033bbc6 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubGetByResourceGroupSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_Get.json */ /** * Sample code: WebPubSub_Get. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsCreateOrUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsCreateOrUpdateSamples.java index 029e5af3e65c..c1997fb24c1f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsCreateOrUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsCreateOrUpdateSamples.java @@ -1,14 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; +import com.azure.resourcemanager.webpubsub.models.ChatSettings; import com.azure.resourcemanager.webpubsub.models.EventHandler; import com.azure.resourcemanager.webpubsub.models.EventHubEndpoint; import com.azure.resourcemanager.webpubsub.models.EventListener; import com.azure.resourcemanager.webpubsub.models.EventNameFilter; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventFilters; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; import com.azure.resourcemanager.webpubsub.models.ManagedIdentitySettings; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthSettings; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthType; import com.azure.resourcemanager.webpubsub.models.WebPubSubHubProperties; @@ -19,8 +23,7 @@ */ public final class WebPubSubHubsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubHubs_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubHubs_CreateOrUpdate.json */ /** * Sample code: WebPubSubHubs_CreateOrUpdate. @@ -36,14 +39,20 @@ public static void webPubSubHubsCreateOrUpdate(com.azure.resourcemanager.webpubs .withUserEventPattern("*") .withSystemEvents(Arrays.asList("connect", "connected")) .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.MANAGED_IDENTITY) - .withManagedIdentity(new ManagedIdentitySettings().withResource("abc"))))) + .withManagedIdentity(new ManagedIdentitySettings().withResource("abc"))) + .withGroupPresenceEvents(new GroupPresenceEventFilters() + .withEventNames(Arrays.asList(GroupPresenceEventName.JOINED, GroupPresenceEventName.LEFT)) + .withGroupFilters(Arrays.asList("chat*"))))) .withEventListeners(Arrays.asList(new EventListener() .withFilter(new EventNameFilter().withSystemEvents(Arrays.asList("connected", "disconnected")) .withUserEventPattern("*")) .withEndpoint(new EventHubEndpoint().withFullyQualifiedNamespace("example.servicebus.windows.net") .withEventHubName("eventHubName1")))) .withAnonymousConnectPolicy("allow") - .withWebSocketKeepAliveIntervalInSeconds(50)) + .withWebSocketKeepAliveIntervalInSeconds(50) + .withChat(new ChatSettings().withMode("Enabled") + .withPersistentStorage(new ResourceReference().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/WebPubSub/myWebPubSubService/persistentStorages/myStor")))) .create(); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsDeleteSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsDeleteSamples.java index ee75d8822adb..b1dca3a0c10d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsDeleteSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,9 +9,7 @@ */ public final class WebPubSubHubsDeleteSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSubHubs_Delete - * .json + * x-ms-original-file: 2025-12-01-preview/WebPubSubHubs_Delete.json */ /** * Sample code: WebPubSubHubs_Delete. @@ -20,6 +18,6 @@ public final class WebPubSubHubsDeleteSamples { */ public static void webPubSubHubsDelete(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubHubs() - .delete("exampleHub", "myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + .delete("myResourceGroup", "myWebPubSubService", "exampleHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsGetSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsGetSamples.java index c6d53c255834..c2f8e2ac4281 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsGetSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,9 +9,7 @@ */ public final class WebPubSubHubsGetSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSubHubs_Get. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSubHubs_Get.json */ /** * Sample code: WebPubSubHubs_Get. @@ -20,6 +18,6 @@ public final class WebPubSubHubsGetSamples { */ public static void webPubSubHubsGet(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubHubs() - .getWithResponse("exampleHub", "myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + .getWithResponse("myResourceGroup", "myWebPubSubService", "exampleHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsListSamples.java index 28c7311bcc55..3bc682c99549 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,9 +9,7 @@ */ public final class WebPubSubHubsListSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSubHubs_List. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSubHubs_List.json */ /** * Sample code: WebPubSubHubs_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListByResourceGroupSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListByResourceGroupSamples.java index 4a30035b0265..f8fca90e2511 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListByResourceGroupSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubListByResourceGroupSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_ListByResourceGroup.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListByResourceGroup.json */ /** * Sample code: WebPubSub_ListByResourceGroup. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListKeysSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListKeysSamples.java index 4b997d07a3c6..1f74c1f8b833 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListKeysSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListKeysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,9 +9,7 @@ */ public final class WebPubSubListKeysSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_ListKeys. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListKeys.json */ /** * Sample code: WebPubSub_ListKeys. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListReplicaSkusSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListReplicaSkusSamples.java index 86bda164ac74..3bda58332496 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListReplicaSkusSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListReplicaSkusSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubListReplicaSkusSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_ListReplicaSkus.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListReplicaSkus.json */ /** * Sample code: WebPubSub_ListReplicaSkus. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListSamples.java index 50114aad5a53..3a8bb1d72e70 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_ListBySubscription.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListBySubscription.json */ /** * Sample code: WebPubSub_ListBySubscription. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListSkusSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListSkusSamples.java index c6a6a368e6f4..5d5ea5373dba 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListSkusSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubListSkusSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,9 +9,7 @@ */ public final class WebPubSubListSkusSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_ListSkus. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_ListSkus.json */ /** * Sample code: WebPubSub_ListSkus. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesCreateOrUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..e42134d25bdc --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.resourcemanager.webpubsub.models.ResourceReference; + +/** + * Samples for WebPubSubPersistentStorages CreateOrUpdate. + */ +public final class WebPubSubPersistentStoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-12-01-preview/WebPubSubPersistentStorages_CreateOrUpdate.json + */ + /** + * Sample code: WebPubSubPersistentStorages_CreateOrUpdate. + * + * @param manager Entry point to WebPubSubManager. + */ + public static void + webPubSubPersistentStoragesCreateOrUpdate(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { + manager.webPubSubPersistentStorages() + .define("myStor") + .withExistingWebPubSub("myResourceGroup", "myWebPubSubService") + .withStorageAccount(new ResourceReference().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")) + .create(); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesDeleteSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesDeleteSamples.java new file mode 100644 index 000000000000..c5bfafa8db8a --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +/** + * Samples for WebPubSubPersistentStorages Delete. + */ +public final class WebPubSubPersistentStoragesDeleteSamples { + /* + * x-ms-original-file: 2025-12-01-preview/WebPubSubPersistentStorages_Delete.json + */ + /** + * Sample code: WebPubSubPersistentStorages_Delete. + * + * @param manager Entry point to WebPubSubManager. + */ + public static void webPubSubPersistentStoragesDelete(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { + manager.webPubSubPersistentStorages() + .delete("myResourceGroup", "myWebPubSubService", "example", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesGetSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesGetSamples.java new file mode 100644 index 000000000000..72d6f7fdc240 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +/** + * Samples for WebPubSubPersistentStorages Get. + */ +public final class WebPubSubPersistentStoragesGetSamples { + /* + * x-ms-original-file: 2025-12-01-preview/WebPubSubPersistentStorages_Get.json + */ + /** + * Sample code: WebPubSubPersistentStorages_Get. + * + * @param manager Entry point to WebPubSubManager. + */ + public static void webPubSubPersistentStoragesGet(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { + manager.webPubSubPersistentStorages() + .getWithResponse("myResourceGroup", "myWebPubSubService", "example", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesListSamples.java new file mode 100644 index 000000000000..98554145089d --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +/** + * Samples for WebPubSubPersistentStorages List. + */ +public final class WebPubSubPersistentStoragesListSamples { + /* + * x-ms-original-file: 2025-12-01-preview/WebPubSubPersistentStorages_List.json + */ + /** + * Sample code: WebPubSubPersistentStorages_List. + * + * @param manager Entry point to WebPubSubManager. + */ + public static void webPubSubPersistentStoragesList(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { + manager.webPubSubPersistentStorages() + .list("myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsDeleteSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsDeleteSamples.java index d6737cfba7d2..05ce7c87feb5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubPrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateEndpointConnections_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateEndpointConnections_Delete.json */ /** * Sample code: WebPubSubPrivateEndpointConnections_Delete. @@ -20,7 +19,7 @@ public final class WebPubSubPrivateEndpointConnectionsDeleteSamples { public static void webPubSubPrivateEndpointConnectionsDelete(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubPrivateEndpointConnections() - .delete("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", "myWebPubSubService", + .delete("myResourceGroup", "myWebPubSubService", "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsGetSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsGetSamples.java index 8d5ca78c681d..4102d6218e32 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsGetSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubPrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateEndpointConnections_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateEndpointConnections_Get.json */ /** * Sample code: WebPubSubPrivateEndpointConnections_Get. @@ -20,7 +19,7 @@ public final class WebPubSubPrivateEndpointConnectionsGetSamples { public static void webPubSubPrivateEndpointConnectionsGet(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubPrivateEndpointConnections() - .getWithResponse("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", - "myWebPubSubService", com.azure.core.util.Context.NONE); + .getWithResponse("myResourceGroup", "myWebPubSubService", + "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsListSamples.java index 8ea969920653..c9b3644dc6f0 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubPrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateEndpointConnections_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateEndpointConnections_List.json */ /** * Sample code: WebPubSubPrivateEndpointConnections_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsUpdateSamples.java index a65d4d7c4768..519d72c4a1a8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -14,8 +14,7 @@ */ public final class WebPubSubPrivateEndpointConnectionsUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateEndpointConnections_Update.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateEndpointConnections_Update.json */ /** * Sample code: WebPubSubPrivateEndpointConnections_Update. @@ -25,8 +24,8 @@ public final class WebPubSubPrivateEndpointConnectionsUpdateSamples { public static void webPubSubPrivateEndpointConnectionsUpdate(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubPrivateEndpointConnections() - .updateWithResponse("mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "myResourceGroup", - "myWebPubSubService", + .updateWithResponse("myResourceGroup", "myWebPubSubService", + "mywebpubsubservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateLinkResourcesListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateLinkResourcesListSamples.java index c4faa60f9597..76706cd2a9a5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateLinkResourcesListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateLinkResourcesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubPrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubPrivateLinkResources_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubPrivateLinkResources_List.json */ /** * Sample code: WebPubSubPrivateLinkResources_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubRegenerateKeySamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubRegenerateKeySamples.java index 8fc5f73f6d03..082df0492298 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubRegenerateKeySamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubRegenerateKeySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,8 +12,7 @@ */ public final class WebPubSubRegenerateKeySamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSub_RegenerateKey.json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_RegenerateKey.json */ /** * Sample code: WebPubSub_RegenerateKey. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateSamples.java index 3b85adb4218c..e183d3814372 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,8 +11,7 @@ */ public final class WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicaSharedPrivateLinkResources_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicaSharedPrivateLinkResources_CreateOrUpdate.json */ /** * Sample code: WebPubSubReplicaSharedPrivateLinkResources_CreateOrUpdate. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesGetSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesGetSamples.java index 755dfd4f4f63..e73dbd8a99c7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesGetSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubReplicaSharedPrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicaSharedPrivateLinkResources_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicaSharedPrivateLinkResources_Get.json */ /** * Sample code: WebPubSubReplicaSharedPrivateLinkResources_Get. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesListSamples.java index b3c04653398d..2e1297fd1645 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubReplicaSharedPrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicaSharedPrivateLinkResources_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicaSharedPrivateLinkResources_List.json */ /** * Sample code: WebPubSubReplicaSharedPrivateLinkResources_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasCreateOrUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasCreateOrUpdateSamples.java index e7e7a14572e5..0ddd3e3012f9 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasCreateOrUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -14,8 +14,7 @@ */ public final class WebPubSubReplicasCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_CreateOrUpdate.json */ /** * Sample code: WebPubSubReplicas_CreateOrUpdate. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasDeleteSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasDeleteSamples.java index 6df627b20433..02cd00aa8e85 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasDeleteSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubReplicasDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_Delete.json */ /** * Sample code: WebPubSubReplicas_Delete. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasGetSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasGetSamples.java index 143b22b56b47..1f1c5acb0719 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasGetSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubReplicasGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_Get.json */ /** * Sample code: WebPubSubReplicas_Get. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasListSamples.java index 79ca6a34f0fd..70ce56da8375 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubReplicasListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_List.json */ /** * Sample code: WebPubSubReplicas_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasRestartSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasRestartSamples.java index c1ebbfd889f1..7ad892be7d20 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasRestartSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasRestartSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubReplicasRestartSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_Restart.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_Restart.json */ /** * Sample code: WebPubSubReplicas_Restart. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasUpdateSamples.java index b300dcfcec87..d1bbb5fadcd7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -15,8 +15,7 @@ */ public final class WebPubSubReplicasUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubReplicas_Update.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubReplicas_Update.json */ /** * Sample code: WebPubSubReplicas_Update. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubRestartSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubRestartSamples.java index 903486222709..779719e29360 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubRestartSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubRestartSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,9 +9,7 @@ */ public final class WebPubSubRestartSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_Restart. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_Restart.json */ /** * Sample code: WebPubSub_Restart. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesCreateOrUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesCreateOrUpdateSamples.java index da1cc5367243..bcfb0b8adce8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesCreateOrUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubSharedPrivateLinkResourcesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubSharedPrivateLinkResources_CreateOrUpdate.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubSharedPrivateLinkResources_CreateOrUpdate.json */ /** * Sample code: WebPubSubSharedPrivateLinkResources_CreateOrUpdate. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesDeleteSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesDeleteSamples.java index e8ffcefc0dbb..293b92171eb1 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesDeleteSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubSharedPrivateLinkResourcesDeleteSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubSharedPrivateLinkResources_Delete.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubSharedPrivateLinkResources_Delete.json */ /** * Sample code: WebPubSubSharedPrivateLinkResources_Delete. @@ -20,6 +19,6 @@ public final class WebPubSubSharedPrivateLinkResourcesDeleteSamples { public static void webPubSubSharedPrivateLinkResourcesDelete(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubSharedPrivateLinkResources() - .delete("upstream", "myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + .delete("myResourceGroup", "myWebPubSubService", "upstream", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesGetSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesGetSamples.java index 80dd32882a58..e3cf4b8dc1b1 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesGetSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubSharedPrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubSharedPrivateLinkResources_Get.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubSharedPrivateLinkResources_Get.json */ /** * Sample code: WebPubSubSharedPrivateLinkResources_Get. @@ -20,6 +19,6 @@ public final class WebPubSubSharedPrivateLinkResourcesGetSamples { public static void webPubSubSharedPrivateLinkResourcesGet(com.azure.resourcemanager.webpubsub.WebPubSubManager manager) { manager.webPubSubSharedPrivateLinkResources() - .getWithResponse("upstream", "myResourceGroup", "myWebPubSubService", com.azure.core.util.Context.NONE); + .getWithResponse("myResourceGroup", "myWebPubSubService", "upstream", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesListSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesListSamples.java index ab924767cac4..2e8494621a98 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesListSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -9,8 +9,7 @@ */ public final class WebPubSubSharedPrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/ - * WebPubSubSharedPrivateLinkResources_List.json + * x-ms-original-file: 2025-12-01-preview/WebPubSubSharedPrivateLinkResources_List.json */ /** * Sample code: WebPubSubSharedPrivateLinkResources_List. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubUpdateSamples.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubUpdateSamples.java index f4525706d8d1..fa8f016b9b80 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubUpdateSamples.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/samples/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -27,9 +27,7 @@ */ public final class WebPubSubUpdateSamples { /* - * x-ms-original-file: - * specification/webpubsub/resource-manager/Microsoft.SignalRService/stable/2024-03-01/examples/WebPubSub_Update. - * json + * x-ms-original-file: 2025-12-01-preview/WebPubSub_Update.json */ /** * Sample code: WebPubSub_Update. diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ApplicationFirewallSettingsTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ApplicationFirewallSettingsTests.java new file mode 100644 index 000000000000..466e9834cedd --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ApplicationFirewallSettingsTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.ApplicationFirewallSettings; +import com.azure.resourcemanager.webpubsub.models.ClientConnectionCountRule; +import com.azure.resourcemanager.webpubsub.models.ClientTrafficControlRule; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ApplicationFirewallSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ApplicationFirewallSettings model = BinaryData.fromString( + "{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":4135366560886200302}") + .toObject(ApplicationFirewallSettings.class); + Assertions.assertEquals(4135366560886200302L, model.maxClientConnectionLifetimeInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ApplicationFirewallSettings model = new ApplicationFirewallSettings() + .withClientConnectionCountRules(Arrays.asList(new ClientConnectionCountRule(), + new ClientConnectionCountRule(), new ClientConnectionCountRule(), new ClientConnectionCountRule())) + .withClientTrafficControlRules(Arrays.asList(new ClientTrafficControlRule())) + .withMaxClientConnectionLifetimeInSeconds(4135366560886200302L); + model = BinaryData.fromObject(model).toObject(ApplicationFirewallSettings.class); + Assertions.assertEquals(4135366560886200302L, model.maxClientConnectionLifetimeInSeconds()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ChatSettingsTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ChatSettingsTests.java new file mode 100644 index 000000000000..08d8b05786be --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ChatSettingsTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.ChatSettings; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; +import org.junit.jupiter.api.Assertions; + +public final class ChatSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ChatSettings model + = BinaryData.fromString("{\"mode\":\"yvdcsitynnaa\",\"persistentStorage\":{\"id\":\"ctehfiqscjey\"}}") + .toObject(ChatSettings.class); + Assertions.assertEquals("yvdcsitynnaa", model.mode()); + Assertions.assertEquals("ctehfiqscjey", model.persistentStorage().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ChatSettings model = new ChatSettings().withMode("yvdcsitynnaa") + .withPersistentStorage(new ResourceReference().withId("ctehfiqscjey")); + model = BinaryData.fromObject(model).toObject(ChatSettings.class); + Assertions.assertEquals("yvdcsitynnaa", model.mode()); + Assertions.assertEquals("ctehfiqscjey", model.persistentStorage().id()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ClientConnectionCountRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ClientConnectionCountRuleTests.java new file mode 100644 index 000000000000..0dda1b5828bd --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ClientConnectionCountRuleTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.ClientConnectionCountRule; + +public final class ClientConnectionCountRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClientConnectionCountRule model = BinaryData.fromString("{\"type\":\"ClientConnectionCountRule\"}") + .toObject(ClientConnectionCountRule.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClientConnectionCountRule model = new ClientConnectionCountRule(); + model = BinaryData.fromObject(model).toObject(ClientConnectionCountRule.class); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ClientTrafficControlRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ClientTrafficControlRuleTests.java new file mode 100644 index 000000000000..d2d3dda6447a --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ClientTrafficControlRuleTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.ClientTrafficControlRule; + +public final class ClientTrafficControlRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClientTrafficControlRule model + = BinaryData.fromString("{\"type\":\"ClientTrafficControlRule\"}").toObject(ClientTrafficControlRule.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClientTrafficControlRule model = new ClientTrafficControlRule(); + model = BinaryData.fromObject(model).toObject(ClientTrafficControlRule.class); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainInnerTests.java index a762ae8190c8..22a1e9c52d73 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -13,18 +13,18 @@ public final class CustomDomainInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomDomainInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Updating\",\"domainName\":\"fbgofeljagrqmqh\",\"customCertificate\":{\"id\":\"vriiio\"}},\"id\":\"al\",\"name\":\"hfkvtvsexsowuel\",\"type\":\"qhhahhxvrhmzkwpj\"}") + "{\"properties\":{\"provisioningState\":\"Creating\",\"domainName\":\"x\",\"customCertificate\":{\"id\":\"npirgnepttw\"}},\"id\":\"sniffc\",\"name\":\"mqnrojlpijnkr\",\"type\":\"frddhcrati\"}") .toObject(CustomDomainInner.class); - Assertions.assertEquals("fbgofeljagrqmqh", model.domainName()); - Assertions.assertEquals("vriiio", model.customCertificate().id()); + Assertions.assertEquals("x", model.domainName()); + Assertions.assertEquals("npirgnepttw", model.customCertificate().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomDomainInner model = new CustomDomainInner().withDomainName("fbgofeljagrqmqh") - .withCustomCertificate(new ResourceReference().withId("vriiio")); + CustomDomainInner model = new CustomDomainInner().withDomainName("x") + .withCustomCertificate(new ResourceReference().withId("npirgnepttw")); model = BinaryData.fromObject(model).toObject(CustomDomainInner.class); - Assertions.assertEquals("fbgofeljagrqmqh", model.domainName()); - Assertions.assertEquals("vriiio", model.customCertificate().id()); + Assertions.assertEquals("x", model.domainName()); + Assertions.assertEquals("npirgnepttw", model.customCertificate().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainListTests.java index c84f0700d438..07ff6841c7d5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainListTests.java @@ -1,42 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.CustomDomainInner; -import com.azure.resourcemanager.webpubsub.models.CustomDomainList; -import com.azure.resourcemanager.webpubsub.models.ResourceReference; -import java.util.Arrays; +import com.azure.resourcemanager.webpubsub.implementation.models.CustomDomainList; import org.junit.jupiter.api.Assertions; public final class CustomDomainListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomDomainList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"domainName\":\"kvpbjxbkzbz\",\"customCertificate\":{\"id\":\"vncjabudurgk\"}},\"id\":\"mokzhjjklf\",\"name\":\"hmouwqlgzrfze\",\"type\":\"yebizikayuh\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"domainName\":\"jbsybbqw\",\"customCertificate\":{\"id\":\"t\"}},\"id\":\"gmfpgvmp\",\"name\":\"paslthaqfxssmwu\",\"type\":\"wbdsr\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"domainName\":\"drhneuyow\",\"customCertificate\":{\"id\":\"d\"}},\"id\":\"t\",\"name\":\"sibircgpi\",\"type\":\"pzimejzanlfzxi\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"domainName\":\"mbzonokix\",\"customCertificate\":{\"id\":\"q\"}},\"id\":\"rgz\",\"name\":\"frl\",\"type\":\"zszrnwoiindfpw\"}],\"nextLink\":\"ylwbtlhflsjcdhsz\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Moving\",\"domainName\":\"krlgnyhm\",\"customCertificate\":{\"id\":\"sxkkg\"}},\"id\":\"rrghxjbdhqxvcxgf\",\"name\":\"pdso\",\"type\":\"bshrnsvbuswd\"}],\"nextLink\":\"yybyc\"}") .toObject(CustomDomainList.class); - Assertions.assertEquals("kvpbjxbkzbz", model.value().get(0).domainName()); - Assertions.assertEquals("vncjabudurgk", model.value().get(0).customCertificate().id()); - Assertions.assertEquals("ylwbtlhflsjcdhsz", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomDomainList model = new CustomDomainList().withValue(Arrays.asList( - new CustomDomainInner().withDomainName("kvpbjxbkzbz") - .withCustomCertificate(new ResourceReference().withId("vncjabudurgk")), - new CustomDomainInner().withDomainName("jbsybbqw") - .withCustomCertificate(new ResourceReference().withId("t")), - new CustomDomainInner().withDomainName("drhneuyow") - .withCustomCertificate(new ResourceReference().withId("d")), - new CustomDomainInner().withDomainName("mbzonokix") - .withCustomCertificate(new ResourceReference().withId("q")))) - .withNextLink("ylwbtlhflsjcdhsz"); - model = BinaryData.fromObject(model).toObject(CustomDomainList.class); - Assertions.assertEquals("kvpbjxbkzbz", model.value().get(0).domainName()); - Assertions.assertEquals("vncjabudurgk", model.value().get(0).customCertificate().id()); - Assertions.assertEquals("ylwbtlhflsjcdhsz", model.nextLink()); + Assertions.assertEquals("krlgnyhm", model.value().get(0).domainName()); + Assertions.assertEquals("sxkkg", model.value().get(0).customCertificate().id()); + Assertions.assertEquals("yybyc", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainPropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainPropertiesTests.java index 05851eb4f1ef..504cf494ad9a 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainPropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/CustomDomainPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -13,18 +13,18 @@ public final class CustomDomainPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomDomainProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"domainName\":\"spughftqsxhq\",\"customCertificate\":{\"id\":\"j\"}}") + "{\"provisioningState\":\"Succeeded\",\"domainName\":\"onasxifto\",\"customCertificate\":{\"id\":\"yzhftwesgogczh\"}}") .toObject(CustomDomainProperties.class); - Assertions.assertEquals("spughftqsxhq", model.domainName()); - Assertions.assertEquals("j", model.customCertificate().id()); + Assertions.assertEquals("onasxifto", model.domainName()); + Assertions.assertEquals("yzhftwesgogczh", model.customCertificate().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomDomainProperties model = new CustomDomainProperties().withDomainName("spughftqsxhq") - .withCustomCertificate(new ResourceReference().withId("j")); + CustomDomainProperties model = new CustomDomainProperties().withDomainName("onasxifto") + .withCustomCertificate(new ResourceReference().withId("yzhftwesgogczh")); model = BinaryData.fromObject(model).toObject(CustomDomainProperties.class); - Assertions.assertEquals("spughftqsxhq", model.domainName()); - Assertions.assertEquals("j", model.customCertificate().id()); + Assertions.assertEquals("onasxifto", model.domainName()); + Assertions.assertEquals("yzhftwesgogczh", model.customCertificate().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/DimensionTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/DimensionTests.java index 9d087a11567c..e07dce3fe5fc 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/DimensionTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/DimensionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,24 +12,11 @@ public final class DimensionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Dimension model = BinaryData.fromString( - "{\"name\":\"alhbx\",\"displayName\":\"e\",\"internalName\":\"zzvdudgwds\",\"toBeExportedForShoebox\":true}") + "{\"name\":\"nbdxk\",\"displayName\":\"xo\",\"internalName\":\"jionpimexgstxgc\",\"toBeExportedForShoebox\":false}") .toObject(Dimension.class); - Assertions.assertEquals("alhbx", model.name()); - Assertions.assertEquals("e", model.displayName()); - Assertions.assertEquals("zzvdudgwds", model.internalName()); - Assertions.assertEquals(true, model.toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Dimension model = new Dimension().withName("alhbx") - .withDisplayName("e") - .withInternalName("zzvdudgwds") - .withToBeExportedForShoebox(true); - model = BinaryData.fromObject(model).toObject(Dimension.class); - Assertions.assertEquals("alhbx", model.name()); - Assertions.assertEquals("e", model.displayName()); - Assertions.assertEquals("zzvdudgwds", model.internalName()); - Assertions.assertEquals(true, model.toBeExportedForShoebox()); + Assertions.assertEquals("nbdxk", model.name()); + Assertions.assertEquals("xo", model.displayName()); + Assertions.assertEquals("jionpimexgstxgc", model.internalName()); + Assertions.assertFalse(model.toBeExportedForShoebox()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventHandlerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventHandlerTests.java index fced69d78b03..9506a2b6db5c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventHandlerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventHandlerTests.java @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.models.EventHandler; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventFilters; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; import com.azure.resourcemanager.webpubsub.models.ManagedIdentitySettings; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthSettings; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthType; @@ -16,27 +18,34 @@ public final class EventHandlerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EventHandler model = BinaryData.fromString( - "{\"urlTemplate\":\"coolsttpkiwkkb\",\"userEventPattern\":\"jrywvtylbfpnc\",\"systemEvents\":[\"oiwiithtywub\",\"cbihwqk\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{\"resource\":\"jchrdgoihxumw\"}}}") + "{\"urlTemplate\":\"ochcbonqvpkvl\",\"userEventPattern\":\"njeaseipheofloke\",\"systemEvents\":[\"enjbdlwtgrhp\",\"jp\",\"umasxazjpq\"],\"auth\":{\"type\":\"ManagedIdentity\",\"managedIdentity\":{\"resource\":\"hb\"}},\"groupPresenceEvents\":{\"eventNames\":[\"joined\",\"joined\"],\"groupFilters\":[\"zvdudgwdslfhotwm\",\"ynpwlbj\",\"pgacftadehxnlty\"]}}") .toObject(EventHandler.class); - Assertions.assertEquals("coolsttpkiwkkb", model.urlTemplate()); - Assertions.assertEquals("jrywvtylbfpnc", model.userEventPattern()); - Assertions.assertEquals("oiwiithtywub", model.systemEvents().get(0)); - Assertions.assertEquals(UpstreamAuthType.NONE, model.auth().type()); - Assertions.assertEquals("jchrdgoihxumw", model.auth().managedIdentity().resource()); + Assertions.assertEquals("ochcbonqvpkvl", model.urlTemplate()); + Assertions.assertEquals("njeaseipheofloke", model.userEventPattern()); + Assertions.assertEquals("enjbdlwtgrhp", model.systemEvents().get(0)); + Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, model.auth().type()); + Assertions.assertEquals("hb", model.auth().managedIdentity().resource()); + Assertions.assertEquals(GroupPresenceEventName.JOINED, model.groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("zvdudgwdslfhotwm", model.groupPresenceEvents().groupFilters().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EventHandler model = new EventHandler().withUrlTemplate("coolsttpkiwkkb") - .withUserEventPattern("jrywvtylbfpnc") - .withSystemEvents(Arrays.asList("oiwiithtywub", "cbihwqk")) - .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) - .withManagedIdentity(new ManagedIdentitySettings().withResource("jchrdgoihxumw"))); + EventHandler model = new EventHandler().withUrlTemplate("ochcbonqvpkvl") + .withUserEventPattern("njeaseipheofloke") + .withSystemEvents(Arrays.asList("enjbdlwtgrhp", "jp", "umasxazjpq")) + .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.MANAGED_IDENTITY) + .withManagedIdentity(new ManagedIdentitySettings().withResource("hb"))) + .withGroupPresenceEvents(new GroupPresenceEventFilters() + .withEventNames(Arrays.asList(GroupPresenceEventName.JOINED, GroupPresenceEventName.JOINED)) + .withGroupFilters(Arrays.asList("zvdudgwdslfhotwm", "ynpwlbj", "pgacftadehxnlty"))); model = BinaryData.fromObject(model).toObject(EventHandler.class); - Assertions.assertEquals("coolsttpkiwkkb", model.urlTemplate()); - Assertions.assertEquals("jrywvtylbfpnc", model.userEventPattern()); - Assertions.assertEquals("oiwiithtywub", model.systemEvents().get(0)); - Assertions.assertEquals(UpstreamAuthType.NONE, model.auth().type()); - Assertions.assertEquals("jchrdgoihxumw", model.auth().managedIdentity().resource()); + Assertions.assertEquals("ochcbonqvpkvl", model.urlTemplate()); + Assertions.assertEquals("njeaseipheofloke", model.userEventPattern()); + Assertions.assertEquals("enjbdlwtgrhp", model.systemEvents().get(0)); + Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, model.auth().type()); + Assertions.assertEquals("hb", model.auth().managedIdentity().resource()); + Assertions.assertEquals(GroupPresenceEventName.JOINED, model.groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("zvdudgwdslfhotwm", model.groupPresenceEvents().groupFilters().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventHubEndpointTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventHubEndpointTests.java index fd171f3bb412..0bc1b5f782f4 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventHubEndpointTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventHubEndpointTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -13,18 +13,18 @@ public final class EventHubEndpointTests { public void testDeserialize() throws Exception { EventHubEndpoint model = BinaryData .fromString( - "{\"type\":\"EventHub\",\"fullyQualifiedNamespace\":\"ayzri\",\"eventHubName\":\"khyawfvjlboxqv\"}") + "{\"type\":\"EventHub\",\"fullyQualifiedNamespace\":\"kh\",\"eventHubName\":\"enevfyexfwhybci\"}") .toObject(EventHubEndpoint.class); - Assertions.assertEquals("ayzri", model.fullyQualifiedNamespace()); - Assertions.assertEquals("khyawfvjlboxqv", model.eventHubName()); + Assertions.assertEquals("kh", model.fullyQualifiedNamespace()); + Assertions.assertEquals("enevfyexfwhybci", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { EventHubEndpoint model - = new EventHubEndpoint().withFullyQualifiedNamespace("ayzri").withEventHubName("khyawfvjlboxqv"); + = new EventHubEndpoint().withFullyQualifiedNamespace("kh").withEventHubName("enevfyexfwhybci"); model = BinaryData.fromObject(model).toObject(EventHubEndpoint.class); - Assertions.assertEquals("ayzri", model.fullyQualifiedNamespace()); - Assertions.assertEquals("khyawfvjlboxqv", model.eventHubName()); + Assertions.assertEquals("kh", model.fullyQualifiedNamespace()); + Assertions.assertEquals("enevfyexfwhybci", model.eventHubName()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerEndpointTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerEndpointTests.java index f7968c8c691b..3f86f6e2b8d7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerEndpointTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerEndpointTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerFilterTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerFilterTests.java index b46a26dd6f0e..fca2d9a05cd3 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerFilterTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerFilterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerTests.java index 3c5f3af63d96..4c327728dbbd 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventListenerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventNameFilterTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventNameFilterTests.java index 12bfae400f53..ff9f7914a55f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventNameFilterTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/EventNameFilterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,19 +12,20 @@ public final class EventNameFilterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - EventNameFilter model = BinaryData.fromString( - "{\"type\":\"EventName\",\"systemEvents\":[\"mxho\",\"dynhdwdigum\",\"nraauzz\"],\"userEventPattern\":\"jazysdzhezwwvaiq\"}") + EventNameFilter model = BinaryData + .fromString( + "{\"type\":\"EventName\",\"systemEvents\":[\"zj\",\"yggdtjixh\"],\"userEventPattern\":\"uofqwe\"}") .toObject(EventNameFilter.class); - Assertions.assertEquals("mxho", model.systemEvents().get(0)); - Assertions.assertEquals("jazysdzhezwwvaiq", model.userEventPattern()); + Assertions.assertEquals("zj", model.systemEvents().get(0)); + Assertions.assertEquals("uofqwe", model.userEventPattern()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EventNameFilter model = new EventNameFilter().withSystemEvents(Arrays.asList("mxho", "dynhdwdigum", "nraauzz")) - .withUserEventPattern("jazysdzhezwwvaiq"); + EventNameFilter model + = new EventNameFilter().withSystemEvents(Arrays.asList("zj", "yggdtjixh")).withUserEventPattern("uofqwe"); model = BinaryData.fromObject(model).toObject(EventNameFilter.class); - Assertions.assertEquals("mxho", model.systemEvents().get(0)); - Assertions.assertEquals("jazysdzhezwwvaiq", model.userEventPattern()); + Assertions.assertEquals("zj", model.systemEvents().get(0)); + Assertions.assertEquals("uofqwe", model.userEventPattern()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/GroupPresenceEventFiltersTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/GroupPresenceEventFiltersTests.java new file mode 100644 index 000000000000..b483d79b84a8 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/GroupPresenceEventFiltersTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventFilters; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GroupPresenceEventFiltersTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GroupPresenceEventFilters model = BinaryData.fromString( + "{\"eventNames\":[\"joined\",\"joined\",\"left\"],\"groupFilters\":[\"tbqvudw\",\"dndnvow\",\"ujjugwdkcglh\"]}") + .toObject(GroupPresenceEventFilters.class); + Assertions.assertEquals(GroupPresenceEventName.JOINED, model.eventNames().get(0)); + Assertions.assertEquals("tbqvudw", model.groupFilters().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GroupPresenceEventFilters model = new GroupPresenceEventFilters() + .withEventNames(Arrays.asList(GroupPresenceEventName.JOINED, GroupPresenceEventName.JOINED, + GroupPresenceEventName.LEFT)) + .withGroupFilters(Arrays.asList("tbqvudw", "dndnvow", "ujjugwdkcglh")); + model = BinaryData.fromObject(model).toObject(GroupPresenceEventFilters.class); + Assertions.assertEquals(GroupPresenceEventName.JOINED, model.eventNames().get(0)); + Assertions.assertEquals("tbqvudw", model.groupFilters().get(0)); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/IpRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/IpRuleTests.java index fd655f9205e8..b2faec9c7834 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/IpRuleTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/IpRuleTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -13,16 +13,16 @@ public final class IpRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IpRule model - = BinaryData.fromString("{\"value\":\"ypbsfgytguslfead\",\"action\":\"Allow\"}").toObject(IpRule.class); - Assertions.assertEquals("ypbsfgytguslfead", model.value()); + = BinaryData.fromString("{\"value\":\"hqkvpuvksgplsak\",\"action\":\"Allow\"}").toObject(IpRule.class); + Assertions.assertEquals("hqkvpuvksgplsak", model.value()); Assertions.assertEquals(AclAction.ALLOW, model.action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IpRule model = new IpRule().withValue("ypbsfgytguslfead").withAction(AclAction.ALLOW); + IpRule model = new IpRule().withValue("hqkvpuvksgplsak").withAction(AclAction.ALLOW); model = BinaryData.fromObject(model).toObject(IpRule.class); - Assertions.assertEquals("ypbsfgytguslfead", model.value()); + Assertions.assertEquals("hqkvpuvksgplsak", model.value()); Assertions.assertEquals(AclAction.ALLOW, model.action()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LiveTraceCategoryTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LiveTraceCategoryTests.java index 38f925934f56..ed52736e48a3 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LiveTraceCategoryTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LiveTraceCategoryTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,17 +11,17 @@ public final class LiveTraceCategoryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LiveTraceCategory model = BinaryData.fromString("{\"name\":\"hrskdsnfd\",\"enabled\":\"oakgtdlmkkzev\"}") + LiveTraceCategory model = BinaryData.fromString("{\"name\":\"xpbtgiwbwo\",\"enabled\":\"washr\"}") .toObject(LiveTraceCategory.class); - Assertions.assertEquals("hrskdsnfd", model.name()); - Assertions.assertEquals("oakgtdlmkkzev", model.enabled()); + Assertions.assertEquals("xpbtgiwbwo", model.name()); + Assertions.assertEquals("washr", model.enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LiveTraceCategory model = new LiveTraceCategory().withName("hrskdsnfd").withEnabled("oakgtdlmkkzev"); + LiveTraceCategory model = new LiveTraceCategory().withName("xpbtgiwbwo").withEnabled("washr"); model = BinaryData.fromObject(model).toObject(LiveTraceCategory.class); - Assertions.assertEquals("hrskdsnfd", model.name()); - Assertions.assertEquals("oakgtdlmkkzev", model.enabled()); + Assertions.assertEquals("xpbtgiwbwo", model.name()); + Assertions.assertEquals("washr", model.enabled()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LiveTraceConfigurationTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LiveTraceConfigurationTests.java index 782895c943d8..8d717885145d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LiveTraceConfigurationTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LiveTraceConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -14,22 +14,21 @@ public final class LiveTraceConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LiveTraceConfiguration model = BinaryData.fromString( - "{\"enabled\":\"sfraoyzko\",\"categories\":[{\"name\":\"mnguxawqaldsyu\",\"enabled\":\"imerqfobwyznk\"},{\"name\":\"kutwpf\",\"enabled\":\"a\"}]}") + "{\"enabled\":\"dqrhzoymib\",\"categories\":[{\"name\":\"ibahwflus\",\"enabled\":\"tmhrkwofyyvoqacp\"}]}") .toObject(LiveTraceConfiguration.class); - Assertions.assertEquals("sfraoyzko", model.enabled()); - Assertions.assertEquals("mnguxawqaldsyu", model.categories().get(0).name()); - Assertions.assertEquals("imerqfobwyznk", model.categories().get(0).enabled()); + Assertions.assertEquals("dqrhzoymib", model.enabled()); + Assertions.assertEquals("ibahwflus", model.categories().get(0).name()); + Assertions.assertEquals("tmhrkwofyyvoqacp", model.categories().get(0).enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LiveTraceConfiguration model = new LiveTraceConfiguration().withEnabled("sfraoyzko") + LiveTraceConfiguration model = new LiveTraceConfiguration().withEnabled("dqrhzoymib") .withCategories( - Arrays.asList(new LiveTraceCategory().withName("mnguxawqaldsyu").withEnabled("imerqfobwyznk"), - new LiveTraceCategory().withName("kutwpf").withEnabled("a"))); + Arrays.asList(new LiveTraceCategory().withName("ibahwflus").withEnabled("tmhrkwofyyvoqacp"))); model = BinaryData.fromObject(model).toObject(LiveTraceConfiguration.class); - Assertions.assertEquals("sfraoyzko", model.enabled()); - Assertions.assertEquals("mnguxawqaldsyu", model.categories().get(0).name()); - Assertions.assertEquals("imerqfobwyznk", model.categories().get(0).enabled()); + Assertions.assertEquals("dqrhzoymib", model.enabled()); + Assertions.assertEquals("ibahwflus", model.categories().get(0).name()); + Assertions.assertEquals("tmhrkwofyyvoqacp", model.categories().get(0).enabled()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LogSpecificationTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LogSpecificationTests.java index e990be680e3b..1f459c97b685 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LogSpecificationTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/LogSpecificationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,17 +11,10 @@ public final class LogSpecificationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LogSpecification model = BinaryData.fromString("{\"name\":\"twmcynpwlb\",\"displayName\":\"pgacftadehxnlty\"}") - .toObject(LogSpecification.class); - Assertions.assertEquals("twmcynpwlb", model.name()); - Assertions.assertEquals("pgacftadehxnlty", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogSpecification model = new LogSpecification().withName("twmcynpwlb").withDisplayName("pgacftadehxnlty"); - model = BinaryData.fromObject(model).toObject(LogSpecification.class); - Assertions.assertEquals("twmcynpwlb", model.name()); - Assertions.assertEquals("pgacftadehxnlty", model.displayName()); + LogSpecification model + = BinaryData.fromString("{\"name\":\"maajrmvdjwzrlo\",\"displayName\":\"clwhijcoejctbz\"}") + .toObject(LogSpecification.class); + Assertions.assertEquals("maajrmvdjwzrlo", model.name()); + Assertions.assertEquals("clwhijcoejctbz", model.displayName()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ManagedIdentitySettingsTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ManagedIdentitySettingsTests.java index 81fe50f944de..d7f2f3a4b90f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ManagedIdentitySettingsTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ManagedIdentitySettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,14 +12,14 @@ public final class ManagedIdentitySettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedIdentitySettings model - = BinaryData.fromString("{\"resource\":\"udfdlwgg\"}").toObject(ManagedIdentitySettings.class); - Assertions.assertEquals("udfdlwgg", model.resource()); + = BinaryData.fromString("{\"resource\":\"zwdejbavor\"}").toObject(ManagedIdentitySettings.class); + Assertions.assertEquals("zwdejbavor", model.resource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedIdentitySettings model = new ManagedIdentitySettings().withResource("udfdlwgg"); + ManagedIdentitySettings model = new ManagedIdentitySettings().withResource("zwdejbavor"); model = BinaryData.fromObject(model).toObject(ManagedIdentitySettings.class); - Assertions.assertEquals("udfdlwgg", model.resource()); + Assertions.assertEquals("zwdejbavor", model.resource()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ManagedIdentityTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ManagedIdentityTests.java index ffe4189e5370..3938c0401772 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ManagedIdentityTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ManagedIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -16,19 +16,18 @@ public final class ManagedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedIdentity model = BinaryData.fromString( - "{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wib\":{\"principalId\":\"olppvksrpqvujz\",\"clientId\":\"ehtwdwrft\"},\"hevxcced\":{\"principalId\":\"cdl\",\"clientId\":\"shfwpracstwity\"},\"navvwx\":{\"principalId\":\"nmdyodnwzxl\",\"clientId\":\"cvnhltiugc\"},\"daciz\":{\"principalId\":\"byqunyow\",\"clientId\":\"lmdjrkvfgbvfvpdb\"}},\"principalId\":\"q\",\"tenantId\":\"krribdeibqi\"}") + "{\"type\":\"None\",\"userAssignedIdentities\":{\"vokotllxdyh\":{\"principalId\":\"orgjhxbldt\",\"clientId\":\"wrlkdmtn\"},\"ocrkvcikh\":{\"principalId\":\"y\",\"clientId\":\"ogjltdtbnnhad\"},\"gxk\":{\"principalId\":\"p\",\"clientId\":\"qgxqquezikyw\"}},\"principalId\":\"la\",\"tenantId\":\"elwuipi\"}") .toObject(ManagedIdentity.class); - Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedIdentityType.NONE, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedIdentity model = new ManagedIdentity().withType(ManagedIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("wib", new UserAssignedIdentityProperty(), "hevxcced", new UserAssignedIdentityProperty(), - "navvwx", new UserAssignedIdentityProperty(), "daciz", new UserAssignedIdentityProperty())); + ManagedIdentity model = new ManagedIdentity().withType(ManagedIdentityType.NONE) + .withUserAssignedIdentities(mapOf("vokotllxdyh", new UserAssignedIdentityProperty(), "ocrkvcikh", + new UserAssignedIdentityProperty(), "gxk", new UserAssignedIdentityProperty())); model = BinaryData.fromObject(model).toObject(ManagedIdentity.class); - Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedIdentityType.NONE, model.type()); } // Use "Map.of" if available diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/MetricSpecificationTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/MetricSpecificationTests.java index 3e36646fceb3..4cbb581c868b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/MetricSpecificationTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/MetricSpecificationTests.java @@ -1,67 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.models.Dimension; import com.azure.resourcemanager.webpubsub.models.MetricSpecification; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class MetricSpecificationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricSpecification model = BinaryData.fromString( - "{\"name\":\"cgyncocpecf\",\"displayName\":\"mcoo\",\"displayDescription\":\"xlzevgbmqjqabcy\",\"unit\":\"ivkwlzuvccfwnfnb\",\"aggregationType\":\"fionl\",\"fillGapWithZero\":\"x\",\"category\":\"qgtz\",\"dimensions\":[{\"name\":\"qbqqwxr\",\"displayName\":\"eallnwsubisnj\",\"internalName\":\"pmng\",\"toBeExportedForShoebox\":false},{\"name\":\"xaqwoochcbonqv\",\"displayName\":\"vlrxnjeaseiph\",\"internalName\":\"f\",\"toBeExportedForShoebox\":false},{\"name\":\"yyien\",\"displayName\":\"dlwtgrhpdj\",\"internalName\":\"umasxazjpq\",\"toBeExportedForShoebox\":false}]}") + "{\"name\":\"ckwhds\",\"displayName\":\"fiyipjxsqwpgrj\",\"displayDescription\":\"norcjxvsnbyxqab\",\"unit\":\"ocpcy\",\"aggregationType\":\"urzafb\",\"fillGapWithZero\":\"j\",\"category\":\"btoqcjmkljavbqid\",\"dimensions\":[{\"name\":\"zyulp\",\"displayName\":\"dj\",\"internalName\":\"lkhbz\",\"toBeExportedForShoebox\":true},{\"name\":\"gzgqexzlo\",\"displayName\":\"scpai\",\"internalName\":\"hhbcsglummajtjao\",\"toBeExportedForShoebox\":true}]}") .toObject(MetricSpecification.class); - Assertions.assertEquals("cgyncocpecf", model.name()); - Assertions.assertEquals("mcoo", model.displayName()); - Assertions.assertEquals("xlzevgbmqjqabcy", model.displayDescription()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.unit()); - Assertions.assertEquals("fionl", model.aggregationType()); - Assertions.assertEquals("x", model.fillGapWithZero()); - Assertions.assertEquals("qgtz", model.category()); - Assertions.assertEquals("qbqqwxr", model.dimensions().get(0).name()); - Assertions.assertEquals("eallnwsubisnj", model.dimensions().get(0).displayName()); - Assertions.assertEquals("pmng", model.dimensions().get(0).internalName()); - Assertions.assertEquals(false, model.dimensions().get(0).toBeExportedForShoebox()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricSpecification model = new MetricSpecification().withName("cgyncocpecf") - .withDisplayName("mcoo") - .withDisplayDescription("xlzevgbmqjqabcy") - .withUnit("ivkwlzuvccfwnfnb") - .withAggregationType("fionl") - .withFillGapWithZero("x") - .withCategory("qgtz") - .withDimensions(Arrays.asList( - new Dimension().withName("qbqqwxr") - .withDisplayName("eallnwsubisnj") - .withInternalName("pmng") - .withToBeExportedForShoebox(false), - new Dimension().withName("xaqwoochcbonqv") - .withDisplayName("vlrxnjeaseiph") - .withInternalName("f") - .withToBeExportedForShoebox(false), - new Dimension().withName("yyien") - .withDisplayName("dlwtgrhpdj") - .withInternalName("umasxazjpq") - .withToBeExportedForShoebox(false))); - model = BinaryData.fromObject(model).toObject(MetricSpecification.class); - Assertions.assertEquals("cgyncocpecf", model.name()); - Assertions.assertEquals("mcoo", model.displayName()); - Assertions.assertEquals("xlzevgbmqjqabcy", model.displayDescription()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.unit()); - Assertions.assertEquals("fionl", model.aggregationType()); - Assertions.assertEquals("x", model.fillGapWithZero()); - Assertions.assertEquals("qgtz", model.category()); - Assertions.assertEquals("qbqqwxr", model.dimensions().get(0).name()); - Assertions.assertEquals("eallnwsubisnj", model.dimensions().get(0).displayName()); - Assertions.assertEquals("pmng", model.dimensions().get(0).internalName()); - Assertions.assertEquals(false, model.dimensions().get(0).toBeExportedForShoebox()); + Assertions.assertEquals("ckwhds", model.name()); + Assertions.assertEquals("fiyipjxsqwpgrj", model.displayName()); + Assertions.assertEquals("norcjxvsnbyxqab", model.displayDescription()); + Assertions.assertEquals("ocpcy", model.unit()); + Assertions.assertEquals("urzafb", model.aggregationType()); + Assertions.assertEquals("j", model.fillGapWithZero()); + Assertions.assertEquals("btoqcjmkljavbqid", model.category()); + Assertions.assertEquals("zyulp", model.dimensions().get(0).name()); + Assertions.assertEquals("dj", model.dimensions().get(0).displayName()); + Assertions.assertEquals("lkhbz", model.dimensions().get(0).internalName()); + Assertions.assertTrue(model.dimensions().get(0).toBeExportedForShoebox()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NameAvailabilityInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NameAvailabilityInnerTests.java index 23101619a0aa..d313d520329d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NameAvailabilityInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NameAvailabilityInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,20 +12,10 @@ public final class NameAvailabilityInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NameAvailabilityInner model - = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"dejbavo\",\"message\":\"zdmohctbqvu\"}") + = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"psvuoymgc\",\"message\":\"lvez\"}") .toObject(NameAvailabilityInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("dejbavo", model.reason()); - Assertions.assertEquals("zdmohctbqvu", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NameAvailabilityInner model - = new NameAvailabilityInner().withNameAvailable(true).withReason("dejbavo").withMessage("zdmohctbqvu"); - model = BinaryData.fromObject(model).toObject(NameAvailabilityInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals("dejbavo", model.reason()); - Assertions.assertEquals("zdmohctbqvu", model.message()); + Assertions.assertTrue(model.nameAvailable()); + Assertions.assertEquals("psvuoymgc", model.reason()); + Assertions.assertEquals("lvez", model.message()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NameAvailabilityParametersTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NameAvailabilityParametersTests.java index a45dee914c5a..0460a6f9bdf8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NameAvailabilityParametersTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NameAvailabilityParametersTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,16 +12,18 @@ public final class NameAvailabilityParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NameAvailabilityParameters model - = BinaryData.fromString("{\"type\":\"sop\",\"name\":\"usue\"}").toObject(NameAvailabilityParameters.class); - Assertions.assertEquals("sop", model.type()); - Assertions.assertEquals("usue", model.name()); + = BinaryData.fromString("{\"type\":\"fhwygzlvdnkfxus\",\"name\":\"mdwzrmuhapfcqdps\"}") + .toObject(NameAvailabilityParameters.class); + Assertions.assertEquals("fhwygzlvdnkfxus", model.type()); + Assertions.assertEquals("mdwzrmuhapfcqdps", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NameAvailabilityParameters model = new NameAvailabilityParameters().withType("sop").withName("usue"); + NameAvailabilityParameters model + = new NameAvailabilityParameters().withType("fhwygzlvdnkfxus").withName("mdwzrmuhapfcqdps"); model = BinaryData.fromObject(model).toObject(NameAvailabilityParameters.class); - Assertions.assertEquals("sop", model.type()); - Assertions.assertEquals("usue", model.name()); + Assertions.assertEquals("fhwygzlvdnkfxus", model.type()); + Assertions.assertEquals("mdwzrmuhapfcqdps", model.name()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NetworkAclTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NetworkAclTests.java index b792979e603d..c290e73d6700 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NetworkAclTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/NetworkAclTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -13,20 +13,19 @@ public final class NetworkAclTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NetworkAcl model = BinaryData.fromString( - "{\"allow\":[\"ClientConnection\"],\"deny\":[\"ServerConnection\",\"ClientConnection\",\"RESTAPI\",\"ServerConnection\"]}") + NetworkAcl model = BinaryData.fromString("{\"allow\":[\"Trace\",\"Trace\"],\"deny\":[\"ServerConnection\"]}") .toObject(NetworkAcl.class); - Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.TRACE, model.allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.deny().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - NetworkAcl model = new NetworkAcl().withAllow(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.CLIENT_CONNECTION, - WebPubSubRequestType.RESTAPI, WebPubSubRequestType.SERVER_CONNECTION)); + NetworkAcl model + = new NetworkAcl().withAllow(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.TRACE)) + .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION)); model = BinaryData.fromObject(model).toObject(NetworkAcl.class); - Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.TRACE, model.allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.deny().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationDisplayTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationDisplayTests.java index 63a3ff6aaaa6..6f8f663376c1 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationDisplayTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,24 +12,11 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"ozkrwfndiodjpslw\",\"resource\":\"dpvwryoqpsoaccta\",\"operation\":\"kljla\",\"description\":\"cr\"}") + "{\"provider\":\"kljla\",\"resource\":\"cr\",\"operation\":\"fdfdosygexpa\",\"description\":\"akhmsbzjhcrz\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("ozkrwfndiodjpslw", model.provider()); - Assertions.assertEquals("dpvwryoqpsoaccta", model.resource()); - Assertions.assertEquals("kljla", model.operation()); - Assertions.assertEquals("cr", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("ozkrwfndiodjpslw") - .withResource("dpvwryoqpsoaccta") - .withOperation("kljla") - .withDescription("cr"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("ozkrwfndiodjpslw", model.provider()); - Assertions.assertEquals("dpvwryoqpsoaccta", model.resource()); - Assertions.assertEquals("kljla", model.operation()); - Assertions.assertEquals("cr", model.description()); + Assertions.assertEquals("kljla", model.provider()); + Assertions.assertEquals("cr", model.resource()); + Assertions.assertEquals("fdfdosygexpa", model.operation()); + Assertions.assertEquals("akhmsbzjhcrz", model.description()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationInnerTests.java index a86bad95d46b..3844e73596d2 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationInnerTests.java @@ -1,109 +1,41 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.OperationInner; -import com.azure.resourcemanager.webpubsub.models.Dimension; -import com.azure.resourcemanager.webpubsub.models.LogSpecification; -import com.azure.resourcemanager.webpubsub.models.MetricSpecification; -import com.azure.resourcemanager.webpubsub.models.OperationDisplay; -import com.azure.resourcemanager.webpubsub.models.OperationProperties; -import com.azure.resourcemanager.webpubsub.models.ServiceSpecification; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"fcqhsmyurkd\",\"isDataAction\":false,\"display\":{\"provider\":\"ekuksjtx\",\"resource\":\"cdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"kknryrtihf\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"zvgnwzs\",\"displayName\":\"glzufc\",\"displayDescription\":\"kohdbiha\",\"unit\":\"fhfcb\",\"aggregationType\":\"s\",\"fillGapWithZero\":\"ithxqhabifpi\",\"category\":\"wczbys\",\"dimensions\":[{}]},{\"name\":\"x\",\"displayName\":\"ivyqniwbybrkxvd\",\"displayDescription\":\"jgrtfwvukxga\",\"unit\":\"ccsnhsjc\",\"aggregationType\":\"ejhkry\",\"fillGapWithZero\":\"napczwlokjy\",\"category\":\"kkvnipjox\",\"dimensions\":[{},{}]}],\"logSpecifications\":[{\"name\":\"ejspodmail\",\"displayName\":\"deh\"},{\"name\":\"wyahuxinpmqnja\",\"displayName\":\"ixjsprozvcputeg\"},{\"name\":\"wmfdatscmdvpjhul\",\"displayName\":\"uvm\"}]}}}") + "{\"name\":\"my\",\"isDataAction\":true,\"display\":{\"provider\":\"mlxhekuksjtxukcd\",\"resource\":\"arcryuanzwuxzdxt\",\"operation\":\"rlhm\",\"description\":\"fp\"},\"origin\":\"qobmtukk\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"hfx\",\"displayName\":\"jbpzvgnwzsymg\",\"displayDescription\":\"uf\",\"unit\":\"zk\",\"aggregationType\":\"dbihanufhfcbj\",\"fillGapWithZero\":\"a\",\"category\":\"th\",\"dimensions\":[{}]},{\"name\":\"bifpikxwczb\",\"displayName\":\"cnpqxuhivyqniwby\",\"displayDescription\":\"k\",\"unit\":\"dumjgrtfwvuk\",\"aggregationType\":\"audccsnhs\",\"fillGapWithZero\":\"nyejhkryhtnap\",\"category\":\"wlokjyem\",\"dimensions\":[{},{}]}],\"logSpecifications\":[{\"name\":\"joxzjnchgejspodm\",\"displayName\":\"lzydehojwyahux\"},{\"name\":\"pmqnja\",\"displayName\":\"ixjsprozvcputeg\"},{\"name\":\"wmfdatscmdvpjhul\",\"displayName\":\"uvm\"},{\"name\":\"ozkrwfndiodjpslw\",\"displayName\":\"dpvwryoqpsoaccta\"}]}}}") .toObject(OperationInner.class); - Assertions.assertEquals("fcqhsmyurkd", model.name()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("ekuksjtx", model.display().provider()); - Assertions.assertEquals("cdm", model.display().resource()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.display().operation()); - Assertions.assertEquals("lhmwhfpmrqobm", model.display().description()); - Assertions.assertEquals("kknryrtihf", model.origin()); - Assertions.assertEquals("zvgnwzs", - model.properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("glzufc", + Assertions.assertEquals("my", model.name()); + Assertions.assertTrue(model.isDataAction()); + Assertions.assertEquals("mlxhekuksjtxukcd", model.display().provider()); + Assertions.assertEquals("arcryuanzwuxzdxt", model.display().resource()); + Assertions.assertEquals("rlhm", model.display().operation()); + Assertions.assertEquals("fp", model.display().description()); + Assertions.assertEquals("qobmtukk", model.origin()); + Assertions.assertEquals("hfx", model.properties().serviceSpecification().metricSpecifications().get(0).name()); + Assertions.assertEquals("jbpzvgnwzsymg", model.properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("kohdbiha", + Assertions.assertEquals("uf", model.properties().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("fhfcb", - model.properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("s", + Assertions.assertEquals("zk", model.properties().serviceSpecification().metricSpecifications().get(0).unit()); + Assertions.assertEquals("dbihanufhfcbj", model.properties().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("ithxqhabifpi", + Assertions.assertEquals("a", model.properties().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("wczbys", + Assertions.assertEquals("th", model.properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("ejspodmail", + Assertions.assertEquals("joxzjnchgejspodm", model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("deh", - model.properties().serviceSpecification().logSpecifications().get(0).displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("fcqhsmyurkd") - .withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("ekuksjtx") - .withResource("cdm") - .withOperation("rcryuanzwuxzdxta") - .withDescription("lhmwhfpmrqobm")) - .withOrigin("kknryrtihf") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withMetricSpecifications(Arrays.asList( - new MetricSpecification().withName("zvgnwzs") - .withDisplayName("glzufc") - .withDisplayDescription("kohdbiha") - .withUnit("fhfcb") - .withAggregationType("s") - .withFillGapWithZero("ithxqhabifpi") - .withCategory("wczbys") - .withDimensions(Arrays.asList(new Dimension())), - new MetricSpecification().withName("x") - .withDisplayName("ivyqniwbybrkxvd") - .withDisplayDescription("jgrtfwvukxga") - .withUnit("ccsnhsjc") - .withAggregationType("ejhkry") - .withFillGapWithZero("napczwlokjy") - .withCategory("kkvnipjox") - .withDimensions(Arrays.asList(new Dimension(), new Dimension())))) - .withLogSpecifications( - Arrays.asList(new LogSpecification().withName("ejspodmail").withDisplayName("deh"), - new LogSpecification().withName("wyahuxinpmqnja").withDisplayName("ixjsprozvcputeg"), - new LogSpecification().withName("wmfdatscmdvpjhul").withDisplayName("uvm"))))); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("fcqhsmyurkd", model.name()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("ekuksjtx", model.display().provider()); - Assertions.assertEquals("cdm", model.display().resource()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.display().operation()); - Assertions.assertEquals("lhmwhfpmrqobm", model.display().description()); - Assertions.assertEquals("kknryrtihf", model.origin()); - Assertions.assertEquals("zvgnwzs", - model.properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("glzufc", - model.properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("kohdbiha", - model.properties().serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("fhfcb", - model.properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("s", - model.properties().serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("ithxqhabifpi", - model.properties().serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("wczbys", - model.properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("ejspodmail", - model.properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("deh", + Assertions.assertEquals("lzydehojwyahux", model.properties().serviceSpecification().logSpecifications().get(0).displayName()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationListTests.java index 335aa64f0014..ef18415a4909 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationListTests.java @@ -1,80 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.OperationInner; -import com.azure.resourcemanager.webpubsub.models.LogSpecification; -import com.azure.resourcemanager.webpubsub.models.MetricSpecification; -import com.azure.resourcemanager.webpubsub.models.OperationDisplay; -import com.azure.resourcemanager.webpubsub.models.OperationList; -import com.azure.resourcemanager.webpubsub.models.OperationProperties; -import com.azure.resourcemanager.webpubsub.models.ServiceSpecification; -import java.util.Arrays; +import com.azure.resourcemanager.webpubsub.implementation.models.OperationList; import org.junit.jupiter.api.Assertions; public final class OperationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationList model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"ownoizhw\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{}],\"logSpecifications\":[{},{}]}}},{\"name\":\"qijgkd\",\"isDataAction\":true,\"display\":{\"provider\":\"lobcufpdznrbtcq\",\"resource\":\"nq\",\"operation\":\"hqgnufooojywif\",\"description\":\"esaagdfm\"},\"origin\":\"zlhjxrifkwmrvkt\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{}],\"logSpecifications\":[{},{}]}}},{\"name\":\"pa\",\"isDataAction\":false,\"display\":{\"provider\":\"s\",\"resource\":\"cmpoyfdkfogkny\",\"operation\":\"ofjdde\",\"description\":\"rd\"},\"origin\":\"pewnw\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{}],\"logSpecifications\":[{},{},{}]}}}],\"nextLink\":\"lusarh\"}") + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"tbmufpo\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{}],\"logSpecifications\":[{},{}]}}},{\"name\":\"rxybqsoq\",\"isDataAction\":false,\"display\":{\"provider\":\"mbpazlobcufpdzn\",\"resource\":\"t\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"lhjxr\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{},{}],\"logSpecifications\":[{},{},{},{}]}}},{\"name\":\"tsizntocipaoua\",\"isDataAction\":false,\"display\":{\"provider\":\"cmpoyfdkfogkny\",\"resource\":\"ofjdde\",\"operation\":\"rd\",\"description\":\"pewnw\"},\"origin\":\"itjz\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{},{}],\"logSpecifications\":[{}]}}}],\"nextLink\":\"mofcq\"}") .toObject(OperationList.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("pbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals("ownoizhw", model.value().get(0).origin()); - Assertions.assertEquals("lusarh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = new OperationList() - .withValue(Arrays.asList( - new OperationInner().withName("quvgjxpybczme") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("pbsphrupidgs") - .withResource("bejhphoycmsxa") - .withOperation("hdxbmtqio") - .withDescription("zehtbmu")) - .withOrigin("ownoizhw") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withMetricSpecifications(Arrays.asList(new MetricSpecification(), new MetricSpecification())) - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())))), - new OperationInner().withName("qijgkd") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("lobcufpdznrbtcq") - .withResource("nq") - .withOperation("hqgnufooojywif") - .withDescription("esaagdfm")) - .withOrigin("zlhjxrifkwmrvkt") - .withProperties(new OperationProperties().withServiceSpecification( - new ServiceSpecification().withMetricSpecifications(Arrays.asList(new MetricSpecification())) - .withLogSpecifications(Arrays.asList(new LogSpecification(), new LogSpecification())))), - new OperationInner().withName("pa") - .withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("s") - .withResource("cmpoyfdkfogkny") - .withOperation("ofjdde") - .withDescription("rd")) - .withOrigin("pewnw") - .withProperties(new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withMetricSpecifications(Arrays.asList(new MetricSpecification(), new MetricSpecification())) - .withLogSpecifications( - Arrays.asList(new LogSpecification(), new LogSpecification(), new LogSpecification())))))) - .withNextLink("lusarh"); - model = BinaryData.fromObject(model).toObject(OperationList.class); - Assertions.assertEquals("quvgjxpybczme", model.value().get(0).name()); - Assertions.assertEquals(true, model.value().get(0).isDataAction()); - Assertions.assertEquals("pbsphrupidgs", model.value().get(0).display().provider()); - Assertions.assertEquals("bejhphoycmsxa", model.value().get(0).display().resource()); - Assertions.assertEquals("hdxbmtqio", model.value().get(0).display().operation()); - Assertions.assertEquals("zehtbmu", model.value().get(0).display().description()); - Assertions.assertEquals("ownoizhw", model.value().get(0).origin()); - Assertions.assertEquals("lusarh", model.nextLink()); + Assertions.assertEquals("hq", model.value().get(0).name()); + Assertions.assertTrue(model.value().get(0).isDataAction()); + Assertions.assertEquals("pybczmehmtzopb", model.value().get(0).display().provider()); + Assertions.assertEquals("h", model.value().get(0).display().resource()); + Assertions.assertEquals("pidgsybbejhphoyc", model.value().get(0).display().operation()); + Assertions.assertEquals("xaobhdxbmtqioqjz", model.value().get(0).display().description()); + Assertions.assertEquals("tbmufpo", model.value().get(0).origin()); + Assertions.assertEquals("mofcq", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationPropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationPropertiesTests.java index b5735658d2d4..1411906a27ef 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationPropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationPropertiesTests.java @@ -1,145 +1,39 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.models.Dimension; -import com.azure.resourcemanager.webpubsub.models.LogSpecification; -import com.azure.resourcemanager.webpubsub.models.MetricSpecification; import com.azure.resourcemanager.webpubsub.models.OperationProperties; -import com.azure.resourcemanager.webpubsub.models.ServiceSpecification; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class OperationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationProperties model = BinaryData.fromString( - "{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"dosyg\",\"displayName\":\"paojakhmsbzjh\",\"displayDescription\":\"zevdphlx\",\"unit\":\"lthqtrgqjbp\",\"aggregationType\":\"fsinzgvfcjrwzoxx\",\"fillGapWithZero\":\"felluwfzitonpe\",\"category\":\"pjkjlxofpdv\",\"dimensions\":[{\"name\":\"xypininmayhuybbk\",\"displayName\":\"depoog\",\"internalName\":\"uvamiheognarxzxt\",\"toBeExportedForShoebox\":false},{\"name\":\"usivye\",\"displayName\":\"ciqihnhung\",\"internalName\":\"jzrnf\",\"toBeExportedForShoebox\":true},{\"name\":\"ispe\",\"displayName\":\"tzfkufubl\",\"internalName\":\"fxqeof\",\"toBeExportedForShoebox\":false},{\"name\":\"jhqjbasvmsmjqul\",\"displayName\":\"sntnbybkzgcw\",\"internalName\":\"clxxwrljdo\",\"toBeExportedForShoebox\":true}]},{\"name\":\"qvkoc\",\"displayName\":\"jdkwtnhxbnjb\",\"displayDescription\":\"sqrglssainq\",\"unit\":\"wnzlljfmppeeb\",\"aggregationType\":\"gxsabkyq\",\"fillGapWithZero\":\"ujitcjcz\",\"category\":\"evndh\",\"dimensions\":[{\"name\":\"d\",\"displayName\":\"p\",\"internalName\":\"bdkvwrwjf\",\"toBeExportedForShoebox\":false},{\"name\":\"hutje\",\"displayName\":\"mrldhu\",\"internalName\":\"zzd\",\"toBeExportedForShoebox\":true},{\"name\":\"hocdgeab\",\"displayName\":\"phut\",\"internalName\":\"ndv\",\"toBeExportedForShoebox\":true}]},{\"name\":\"wyiftyhxhur\",\"displayName\":\"ftyxolniw\",\"displayDescription\":\"cukjf\",\"unit\":\"iawxklry\",\"aggregationType\":\"wckbasyypnd\",\"fillGapWithZero\":\"sgcbac\",\"category\":\"ejk\",\"dimensions\":[{\"name\":\"qgoulznd\",\"displayName\":\"kwy\",\"internalName\":\"gfgibm\",\"toBeExportedForShoebox\":false},{\"name\":\"keqsrxybzqqedq\",\"displayName\":\"bciqfouflm\",\"internalName\":\"kzsmodm\",\"toBeExportedForShoebox\":false},{\"name\":\"gpbkwtmut\",\"displayName\":\"qktapspwgcuert\",\"internalName\":\"kdosvqw\",\"toBeExportedForShoebox\":true},{\"name\":\"gbbjfddgmbmbe\",\"displayName\":\"pbhtqqrolfpfpsa\",\"internalName\":\"bquxigjy\",\"toBeExportedForShoebox\":true}]}],\"logSpecifications\":[{\"name\":\"yfhrtxilnerkujy\",\"displayName\":\"l\"},{\"name\":\"uvfqawrlyxwj\",\"displayName\":\"prbnwbxgjvtbv\"},{\"name\":\"sszdnru\",\"displayName\":\"guhmuouqfpr\"},{\"name\":\"wbnguitnwui\",\"displayName\":\"a\"}]}}") + "{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"lxaolthqtrgqjbp\",\"displayName\":\"fsinzgvfcjrwzoxx\",\"displayDescription\":\"felluwfzitonpe\",\"unit\":\"pjkjlxofpdv\",\"aggregationType\":\"fxxypininmayhuy\",\"fillGapWithZero\":\"kpode\",\"category\":\"oginuvamiheognar\",\"dimensions\":[{\"name\":\"heotusiv\",\"displayName\":\"v\",\"internalName\":\"iqihn\",\"toBeExportedForShoebox\":false}]},{\"name\":\"bwjzr\",\"displayName\":\"ygxgispemvtz\",\"displayDescription\":\"ufubl\",\"unit\":\"fxqeof\",\"aggregationType\":\"e\",\"fillGapWithZero\":\"hqjbasvmsmj\",\"category\":\"lngsntnbybkzgcwr\",\"dimensions\":[{\"name\":\"xwrljdouskcqvkoc\",\"displayName\":\"jdkwtnhxbnjb\",\"internalName\":\"sqrglssainq\",\"toBeExportedForShoebox\":true},{\"name\":\"zlljfmppeebvm\",\"displayName\":\"sabkyqduujitcjcz\",\"internalName\":\"evndh\",\"toBeExportedForShoebox\":true},{\"name\":\"d\",\"displayName\":\"p\",\"internalName\":\"bdkvwrwjf\",\"toBeExportedForShoebox\":false},{\"name\":\"hutje\",\"displayName\":\"mrldhu\",\"internalName\":\"zzd\",\"toBeExportedForShoebox\":true}]}],\"logSpecifications\":[{\"name\":\"cdgea\",\"displayName\":\"gphuticndvka\"},{\"name\":\"wyiftyhxhur\",\"displayName\":\"ftyxolniw\"}]}}") .toObject(OperationProperties.class); - Assertions.assertEquals("dosyg", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("paojakhmsbzjh", - model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("zevdphlx", - model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("lthqtrgqjbp", model.serviceSpecification().metricSpecifications().get(0).unit()); + Assertions.assertEquals("lxaolthqtrgqjbp", model.serviceSpecification().metricSpecifications().get(0).name()); Assertions.assertEquals("fsinzgvfcjrwzoxx", - model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("felluwfzitonpe", - model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("pjkjlxofpdv", model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("xypininmayhuybbk", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("depoog", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("uvamiheognarxzxt", - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(false, - model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("yfhrtxilnerkujy", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("l", model.serviceSpecification().logSpecifications().get(0).displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationProperties model = new OperationProperties().withServiceSpecification(new ServiceSpecification() - .withMetricSpecifications(Arrays.asList( - new MetricSpecification().withName("dosyg") - .withDisplayName("paojakhmsbzjh") - .withDisplayDescription("zevdphlx") - .withUnit("lthqtrgqjbp") - .withAggregationType("fsinzgvfcjrwzoxx") - .withFillGapWithZero("felluwfzitonpe") - .withCategory("pjkjlxofpdv") - .withDimensions(Arrays.asList( - new Dimension().withName("xypininmayhuybbk") - .withDisplayName("depoog") - .withInternalName("uvamiheognarxzxt") - .withToBeExportedForShoebox(false), - new Dimension().withName("usivye") - .withDisplayName("ciqihnhung") - .withInternalName("jzrnf") - .withToBeExportedForShoebox(true), - new Dimension().withName("ispe") - .withDisplayName("tzfkufubl") - .withInternalName("fxqeof") - .withToBeExportedForShoebox(false), - new Dimension().withName("jhqjbasvmsmjqul") - .withDisplayName("sntnbybkzgcw") - .withInternalName("clxxwrljdo") - .withToBeExportedForShoebox(true))), - new MetricSpecification().withName("qvkoc") - .withDisplayName("jdkwtnhxbnjb") - .withDisplayDescription("sqrglssainq") - .withUnit("wnzlljfmppeeb") - .withAggregationType("gxsabkyq") - .withFillGapWithZero("ujitcjcz") - .withCategory("evndh") - .withDimensions(Arrays.asList( - new Dimension().withName("d") - .withDisplayName("p") - .withInternalName("bdkvwrwjf") - .withToBeExportedForShoebox(false), - new Dimension().withName("hutje") - .withDisplayName("mrldhu") - .withInternalName("zzd") - .withToBeExportedForShoebox(true), - new Dimension().withName("hocdgeab") - .withDisplayName("phut") - .withInternalName("ndv") - .withToBeExportedForShoebox(true))), - new MetricSpecification().withName("wyiftyhxhur") - .withDisplayName("ftyxolniw") - .withDisplayDescription("cukjf") - .withUnit("iawxklry") - .withAggregationType("wckbasyypnd") - .withFillGapWithZero("sgcbac") - .withCategory("ejk") - .withDimensions(Arrays.asList( - new Dimension().withName("qgoulznd") - .withDisplayName("kwy") - .withInternalName("gfgibm") - .withToBeExportedForShoebox(false), - new Dimension().withName("keqsrxybzqqedq") - .withDisplayName("bciqfouflm") - .withInternalName("kzsmodm") - .withToBeExportedForShoebox(false), - new Dimension().withName("gpbkwtmut") - .withDisplayName("qktapspwgcuert") - .withInternalName("kdosvqw") - .withToBeExportedForShoebox(true), - new Dimension().withName("gbbjfddgmbmbe") - .withDisplayName("pbhtqqrolfpfpsa") - .withInternalName("bquxigjy") - .withToBeExportedForShoebox(true))))) - .withLogSpecifications( - Arrays.asList(new LogSpecification().withName("yfhrtxilnerkujy").withDisplayName("l"), - new LogSpecification().withName("uvfqawrlyxwj").withDisplayName("prbnwbxgjvtbv"), - new LogSpecification().withName("sszdnru").withDisplayName("guhmuouqfpr"), - new LogSpecification().withName("wbnguitnwui").withDisplayName("a")))); - model = BinaryData.fromObject(model).toObject(OperationProperties.class); - Assertions.assertEquals("dosyg", model.serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("paojakhmsbzjh", model.serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("zevdphlx", + Assertions.assertEquals("felluwfzitonpe", model.serviceSpecification().metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("lthqtrgqjbp", model.serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("fsinzgvfcjrwzoxx", + Assertions.assertEquals("pjkjlxofpdv", model.serviceSpecification().metricSpecifications().get(0).unit()); + Assertions.assertEquals("fxxypininmayhuy", model.serviceSpecification().metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("felluwfzitonpe", - model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("pjkjlxofpdv", model.serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("xypininmayhuybbk", + Assertions.assertEquals("kpode", model.serviceSpecification().metricSpecifications().get(0).fillGapWithZero()); + Assertions.assertEquals("oginuvamiheognar", + model.serviceSpecification().metricSpecifications().get(0).category()); + Assertions.assertEquals("heotusiv", model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("depoog", + Assertions.assertEquals("v", model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("uvamiheognarxzxt", + Assertions.assertEquals("iqihn", model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(false, + Assertions.assertFalse( model.serviceSpecification().metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("yfhrtxilnerkujy", model.serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("l", model.serviceSpecification().logSpecifications().get(0).displayName()); + Assertions.assertEquals("cdgea", model.serviceSpecification().logSpecifications().get(0).name()); + Assertions.assertEquals("gphuticndvka", model.serviceSpecification().logSpecifications().get(0).displayName()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationsListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationsListMockTests.java index e1d7f27daefd..4dc3089e4048 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationsListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.Operation; @@ -22,29 +22,29 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"vv\",\"isDataAction\":false,\"display\":{\"provider\":\"hhqyi\",\"resource\":\"y\",\"operation\":\"uyav\",\"description\":\"wmn\"},\"origin\":\"ttijfybvpoekrs\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"uzqgnjdgkynsc\",\"displayName\":\"qhzvhxnkomt\",\"displayDescription\":\"bo\",\"unit\":\"pnvdxz\",\"aggregationType\":\"ihfrbbcevqa\",\"fillGapWithZero\":\"ltd\",\"category\":\"fkqojpy\",\"dimensions\":[{}]},{\"name\":\"rdcnifmzzsdy\",\"displayName\":\"rnysux\",\"displayDescription\":\"rafwgckhocxvdf\",\"unit\":\"wafqroud\",\"aggregationType\":\"pavehhr\",\"fillGapWithZero\":\"bunzozudh\",\"category\":\"gkmoyxcdyuibhmfd\",\"dimensions\":[{},{}]},{\"name\":\"dvfvfcjnaeoi\",\"displayName\":\"vhmgorffukis\",\"displayDescription\":\"w\",\"unit\":\"hwplefaxvx\",\"aggregationType\":\"cbtgnhnz\",\"fillGapWithZero\":\"qxtjjfzqlqhyca\",\"category\":\"dggxdbeesmi\",\"dimensions\":[{},{},{},{}]}],\"logSpecifications\":[{\"name\":\"riaa\",\"displayName\":\"uagydwqfbylyrf\"}]}}}]}"; + = "{\"value\":[{\"name\":\"vpglydz\",\"isDataAction\":true,\"display\":{\"provider\":\"eevt\",\"resource\":\"pryu\",\"operation\":\"wytpzdmovz\",\"description\":\"va\"},\"origin\":\"zqadf\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[{\"name\":\"glae\",\"displayName\":\"ndtic\",\"displayDescription\":\"pvz\",\"unit\":\"qtmldgxo\",\"aggregationType\":\"irclnpk\",\"fillGapWithZero\":\"ayzri\",\"category\":\"hya\",\"dimensions\":[{},{},{}]},{\"name\":\"lboxqvkjl\",\"displayName\":\"ho\",\"displayDescription\":\"ynhdwdigum\",\"unit\":\"raauzzpt\",\"aggregationType\":\"zysdzh\",\"fillGapWithZero\":\"wwvaiqyuvvfonk\",\"category\":\"hqyikvy\",\"dimensions\":[{}]}],\"logSpecifications\":[{\"name\":\"luwmncst\",\"displayName\":\"jfybvpoekrsgsgb\"},{\"name\":\"uzqgnjdgkynsc\",\"displayName\":\"qhzvhxnkomt\"},{\"name\":\"bo\",\"displayName\":\"pnvdxz\"}]}}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("vv", response.iterator().next().name()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("hhqyi", response.iterator().next().display().provider()); - Assertions.assertEquals("y", response.iterator().next().display().resource()); - Assertions.assertEquals("uyav", response.iterator().next().display().operation()); - Assertions.assertEquals("wmn", response.iterator().next().display().description()); - Assertions.assertEquals("ttijfybvpoekrs", response.iterator().next().origin()); - Assertions.assertEquals("uzqgnjdgkynsc", + Assertions.assertEquals("vpglydz", response.iterator().next().name()); + Assertions.assertTrue(response.iterator().next().isDataAction()); + Assertions.assertEquals("eevt", response.iterator().next().display().provider()); + Assertions.assertEquals("pryu", response.iterator().next().display().resource()); + Assertions.assertEquals("wytpzdmovz", response.iterator().next().display().operation()); + Assertions.assertEquals("va", response.iterator().next().display().description()); + Assertions.assertEquals("zqadf", response.iterator().next().origin()); + Assertions.assertEquals("glae", response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).name()); - Assertions.assertEquals("qhzvhxnkomt", + Assertions.assertEquals("ndtic", response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).displayName()); - Assertions.assertEquals("bo", + Assertions.assertEquals("pvz", response.iterator() .next() .properties() @@ -52,9 +52,9 @@ public void testList() throws Exception { .metricSpecifications() .get(0) .displayDescription()); - Assertions.assertEquals("pnvdxz", + Assertions.assertEquals("qtmldgxo", response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).unit()); - Assertions.assertEquals("ihfrbbcevqa", + Assertions.assertEquals("irclnpk", response.iterator() .next() .properties() @@ -62,7 +62,7 @@ public void testList() throws Exception { .metricSpecifications() .get(0) .aggregationType()); - Assertions.assertEquals("ltd", + Assertions.assertEquals("ayzri", response.iterator() .next() .properties() @@ -70,11 +70,11 @@ public void testList() throws Exception { .metricSpecifications() .get(0) .fillGapWithZero()); - Assertions.assertEquals("fkqojpy", + Assertions.assertEquals("hya", response.iterator().next().properties().serviceSpecification().metricSpecifications().get(0).category()); - Assertions.assertEquals("riaa", + Assertions.assertEquals("luwmncst", response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).name()); - Assertions.assertEquals("uagydwqfbylyrf", + Assertions.assertEquals("jfybvpoekrsgsgb", response.iterator().next().properties().serviceSpecification().logSpecifications().get(0).displayName()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStorageInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStorageInnerTests.java new file mode 100644 index 000000000000..82328e8d4d81 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStorageInnerTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageInner; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; +import org.junit.jupiter.api.Assertions; + +public final class PersistentStorageInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PersistentStorageInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Failed\",\"storageAccount\":{\"id\":\"eoybfhjxakvvjgs\"}},\"id\":\"r\",\"name\":\"il\",\"type\":\"yw\"}") + .toObject(PersistentStorageInner.class); + Assertions.assertEquals("eoybfhjxakvvjgs", model.storageAccount().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PersistentStorageInner model + = new PersistentStorageInner().withStorageAccount(new ResourceReference().withId("eoybfhjxakvvjgs")); + model = BinaryData.fromObject(model).toObject(PersistentStorageInner.class); + Assertions.assertEquals("eoybfhjxakvvjgs", model.storageAccount().id()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStorageListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStorageListTests.java new file mode 100644 index 000000000000..23488a754c30 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStorageListTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.implementation.models.PersistentStorageList; +import org.junit.jupiter.api.Assertions; + +public final class PersistentStorageListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PersistentStorageList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"storageAccount\":{\"id\":\"gyvudtjuewbc\"}},\"id\":\"xuuwhcj\",\"name\":\"xccybvpa\",\"type\":\"akkud\"},{\"properties\":{\"provisioningState\":\"Updating\",\"storageAccount\":{\"id\":\"wjplma\"}},\"id\":\"tcyohpfkyrk\",\"name\":\"bdgiogsjk\",\"type\":\"nwqjnoba\"},{\"properties\":{\"provisioningState\":\"Updating\",\"storageAccount\":{\"id\":\"d\"}},\"id\":\"acegfnmntf\",\"name\":\"mvmemfnczd\",\"type\":\"vvbalx\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"storageAccount\":{\"id\":\"hpodbzev\"}},\"id\":\"dnhfuk\",\"name\":\"vsjcswsmystuluqy\",\"type\":\"fcvlerch\"}],\"nextLink\":\"bm\"}") + .toObject(PersistentStorageList.class); + Assertions.assertEquals("gyvudtjuewbc", model.value().get(0).storageAccount().id()); + Assertions.assertEquals("bm", model.nextLink()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStoragePropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStoragePropertiesTests.java new file mode 100644 index 000000000000..3f2b06edf4b9 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PersistentStoragePropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.fluent.models.PersistentStorageProperties; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; +import org.junit.jupiter.api.Assertions; + +public final class PersistentStoragePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PersistentStorageProperties model + = BinaryData.fromString("{\"provisioningState\":\"Deleting\",\"storageAccount\":{\"id\":\"kxn\"}}") + .toObject(PersistentStorageProperties.class); + Assertions.assertEquals("kxn", model.storageAccount().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PersistentStorageProperties model + = new PersistentStorageProperties().withStorageAccount(new ResourceReference().withId("kxn")); + model = BinaryData.fromObject(model).toObject(PersistentStorageProperties.class); + Assertions.assertEquals("kxn", model.storageAccount().id()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointAclTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointAclTests.java index 8988548e04f4..0a27bd70b6c4 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointAclTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointAclTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -14,23 +14,22 @@ public final class PrivateEndpointAclTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointAcl model = BinaryData.fromString( - "{\"name\":\"hz\",\"allow\":[\"RESTAPI\",\"RESTAPI\",\"Trace\",\"ServerConnection\"],\"deny\":[\"ServerConnection\"]}") + "{\"name\":\"ijfqkacewiipfp\",\"allow\":[\"RESTAPI\"],\"deny\":[\"ServerConnection\",\"RESTAPI\",\"ClientConnection\",\"Trace\"]}") .toObject(PrivateEndpointAcl.class); Assertions.assertEquals(WebPubSubRequestType.RESTAPI, model.allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.deny().get(0)); - Assertions.assertEquals("hz", model.name()); + Assertions.assertEquals("ijfqkacewiipfp", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateEndpointAcl model = new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI, - WebPubSubRequestType.TRACE, WebPubSubRequestType.SERVER_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION)) - .withName("hz"); + PrivateEndpointAcl model = new PrivateEndpointAcl().withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI)) + .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.RESTAPI, + WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.TRACE)) + .withName("ijfqkacewiipfp"); model = BinaryData.fromObject(model).toObject(PrivateEndpointAcl.class); Assertions.assertEquals(WebPubSubRequestType.RESTAPI, model.allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.deny().get(0)); - Assertions.assertEquals("hz", model.name()); + Assertions.assertEquals("ijfqkacewiipfp", model.name()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionInnerTests.java index b0730853329f..f12dc10ae1ce 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -15,28 +15,28 @@ public final class PrivateEndpointConnectionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"sdbnwdcfhucqdpf\"},\"groupIds\":[\"lsbjjcanvxbv\",\"vudutncor\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"tvcof\",\"actionsRequired\":\"f\"}},\"id\":\"kgjubgdknnqvsazn\",\"name\":\"n\",\"type\":\"orudsgsa\"}") + "{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"xrslpm\"},\"groupIds\":[\"uoegrpkhjwniyqs\",\"uicpd\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"lvmbmpaxmodfvuef\",\"actionsRequired\":\"sbpfvmwyhr\"}},\"id\":\"uyfta\",\"name\":\"kcpwiy\",\"type\":\"vqtmnub\"}") .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("sdbnwdcfhucqdpf", model.privateEndpoint().id()); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, + Assertions.assertEquals("xrslpm", model.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("tvcof", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("f", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("lvmbmpaxmodfvuef", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("sbpfvmwyhr", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PrivateEndpointConnectionInner model - = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("sdbnwdcfhucqdpf")) + = new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("xrslpm")) .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) - .withDescription("tvcof") - .withActionsRequired("f")); + new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.DISCONNECTED) + .withDescription("lvmbmpaxmodfvuef") + .withActionsRequired("sbpfvmwyhr")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("sdbnwdcfhucqdpf", model.privateEndpoint().id()); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, + Assertions.assertEquals("xrslpm", model.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("tvcof", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("f", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("lvmbmpaxmodfvuef", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("sbpfvmwyhr", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionListTests.java index 5b5e6e5b0ca9..628437ee079d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionListTests.java @@ -1,68 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.webpubsub.models.PrivateEndpoint; -import com.azure.resourcemanager.webpubsub.models.PrivateEndpointConnectionList; -import com.azure.resourcemanager.webpubsub.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.webpubsub.implementation.models.PrivateEndpointConnectionList; import com.azure.resourcemanager.webpubsub.models.PrivateLinkServiceConnectionStatus; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateEndpointConnectionListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"einqf\"},\"groupIds\":[\"x\",\"knpirgnepttwq\",\"sniffc\",\"mqnrojlpijnkr\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"hcrat\",\"actionsRequired\":\"zronasxift\"}},\"id\":\"qyzhf\",\"name\":\"wesgogczh\",\"type\":\"nnxk\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"mossxkkgthrrghxj\"},\"groupIds\":[\"qxvcxgfrpdsofb\",\"hrnsvbu\",\"wdvzyy\",\"ycnunvjsrtk\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"pqgik\",\"actionsRequired\":\"irtx\"}},\"id\":\"uxzejntpsew\",\"name\":\"ioilqukrydxtq\",\"type\":\"ieoxorggufhyaomt\"},{\"properties\":{\"provisioningState\":\"Moving\",\"privateEndpoint\":{\"id\":\"grvk\"},\"groupIds\":[\"vjzhpjbib\",\"jmfxumvf\",\"luyovwxnbkfezzx\",\"cy\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"irujbz\",\"actionsRequired\":\"mvzzbtdcqvp\"}},\"id\":\"yujviylwdshfssn\",\"name\":\"bgye\",\"type\":\"rymsgaojfmw\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"fhir\"},\"groupIds\":[\"moxoftpi\",\"iwyczuh\",\"a\",\"pqjlihhyusps\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"lmfwdgzx\",\"actionsRequired\":\"ucvpamrs\"}},\"id\":\"uzvx\",\"name\":\"risjnhnytxifqjz\",\"type\":\"xmrhu\"}],\"nextLink\":\"wp\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"tkfa\"},\"groupIds\":[\"pqgik\",\"zirtxdyuxzejntps\",\"wgioilqukry\",\"xtqmieoxor\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"yaomtb\",\"actionsRequired\":\"havgrvk\"}},\"id\":\"ovjzhpjbibgjmfx\",\"name\":\"mv\",\"type\":\"cluyovwxnbkf\"},{\"properties\":{\"provisioningState\":\"Moving\",\"privateEndpoint\":{\"id\":\"yhwzdgiruj\"},\"groupIds\":[\"omvzzbtd\",\"qvpn\",\"yujviylwdshfssn\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"frymsgaojfmwnc\",\"actionsRequired\":\"mrfhirctymox\"}},\"id\":\"tpipiwyczuhx\",\"name\":\"cpqjlihhyu\",\"type\":\"pskasdvlmfwdg\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"vpa\"},\"groupIds\":[\"reuzvxurisjn\",\"nytx\",\"fq\",\"zgxmr\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"pcesutrg\",\"actionsRequired\":\"pauutpw\"}},\"id\":\"hihejqgwzpnfqn\",\"name\":\"cypsxjv\",\"type\":\"oimwkslirc\"},{\"properties\":{\"provisioningState\":\"Unknown\",\"privateEndpoint\":{\"id\":\"dfcea\"},\"groupIds\":[\"hvygdyftumr\",\"wnawjslbiw\",\"ojgcyzt\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"baeqphc\",\"actionsRequired\":\"nrnrp\"}},\"id\":\"huwrykqgaifm\",\"name\":\"iklbydvkhb\",\"type\":\"jdz\"}],\"nextLink\":\"cvdsrhnj\"}") .toObject(PrivateEndpointConnectionList.class); - Assertions.assertEquals("einqf", model.value().get(0).privateEndpoint().id()); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, + Assertions.assertEquals("tkfa", model.value().get(0).privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hcrat", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("zronasxift", - model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("wp", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionList model - = new PrivateEndpointConnectionList() - .withValue( - Arrays.asList( - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("einqf")) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateLinkServiceConnectionStatus.REJECTED) - .withDescription("hcrat") - .withActionsRequired("zronasxift")), - new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint().withId("mossxkkgthrrghxj")) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateLinkServiceConnectionStatus.DISCONNECTED) - .withDescription("pqgik") - .withActionsRequired("irtx")), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("grvk")) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateLinkServiceConnectionStatus.REJECTED) - .withDescription("irujbz") - .withActionsRequired("mvzzbtdcqvp")), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("fhir")) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateLinkServiceConnectionStatus.REJECTED) - .withDescription("lmfwdgzx") - .withActionsRequired("ucvpamrs")))) - .withNextLink("wp"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionList.class); - Assertions.assertEquals("einqf", model.value().get(0).privateEndpoint().id()); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hcrat", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("zronasxift", - model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("wp", model.nextLink()); + Assertions.assertEquals("yaomtb", model.value().get(0).privateLinkServiceConnectionState().description()); + Assertions.assertEquals("havgrvk", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("cvdsrhnj", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionPropertiesTests.java index 354beadc6b9d..22334f720696 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionPropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointConnectionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -15,28 +15,28 @@ public final class PrivateEndpointConnectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Moving\",\"privateEndpoint\":{\"id\":\"grauwjuetaebur\"},\"groupIds\":[\"movsmzlxwabmqoe\",\"kif\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"qujmqlgkf\",\"actionsRequired\":\"ndo\"}}") + "{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"ksmond\"},\"groupIds\":[\"uxvypomgkopkwh\",\"jvp\",\"jqg\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"cmbqfqvmk\",\"actionsRequired\":\"oz\"}}") .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("grauwjuetaebur", model.privateEndpoint().id()); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, + Assertions.assertEquals("ksmond", model.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qujmqlgkf", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ndo", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("cmbqfqvmk", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("oz", model.privateLinkServiceConnectionState().actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint().withId("grauwjuetaebur")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.DISCONNECTED) - .withDescription("qujmqlgkf") - .withActionsRequired("ndo")); + PrivateEndpointConnectionProperties model + = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint().withId("ksmond")) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.REJECTED) + .withDescription("cmbqfqvmk") + .withActionsRequired("oz")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("grauwjuetaebur", model.privateEndpoint().id()); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, + Assertions.assertEquals("ksmond", model.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qujmqlgkf", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ndo", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("cmbqfqvmk", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("oz", model.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointTests.java index f9120ff10508..0b99e30db1b6 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateEndpointTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,14 +11,14 @@ public final class PrivateEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"n\"}").toObject(PrivateEndpoint.class); - Assertions.assertEquals("n", model.id()); + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"vhelxprglyatdd\"}").toObject(PrivateEndpoint.class); + Assertions.assertEquals("vhelxprglyatdd", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint().withId("n"); + PrivateEndpoint model = new PrivateEndpoint().withId("vhelxprglyatdd"); model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - Assertions.assertEquals("n", model.id()); + Assertions.assertEquals("vhelxprglyatdd", model.id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourceInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourceInnerTests.java index 5671237fd08f..6b0b6e445414 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourceInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourceInnerTests.java @@ -1,54 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceProperties; -import com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceType; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"mczuo\",\"requiredMembers\":[\"wcw\"],\"requiredZoneNames\":[\"oknssxmojmsvpkjp\",\"vk\",\"cfzq\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"gtczheydb\",\"properties\":{\"description\":\"hmkxmaehvbb\",\"groupId\":\"ripltf\",\"type\":\"tbaxk\"}},{\"name\":\"ywrckp\",\"properties\":{\"description\":\"yhpluodpvruudlgz\",\"groupId\":\"thost\",\"type\":\"tstvdxeclzedq\"}}]},\"id\":\"vh\",\"name\":\"lhpl\",\"type\":\"dqkdlwwqfbu\"}") + "{\"properties\":{\"groupId\":\"wjygvjayvblmhvk\",\"requiredMembers\":[\"bxvvyhg\",\"opbyrqufegxu\",\"wz\",\"bnhlmc\"],\"requiredZoneNames\":[\"dn\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"gbmhrixkwmyi\",\"properties\":{\"description\":\"veg\",\"groupId\":\"bpnaixexccbdre\",\"type\":\"hcexdrrvqa\"}},{\"name\":\"kghtpwijnh\",\"properties\":{\"description\":\"vfycxzb\",\"groupId\":\"oowvrv\",\"type\":\"gjqppy\"}},{\"name\":\"tronzmyhgfi\",\"properties\":{\"description\":\"xkmcwaekrrjre\",\"groupId\":\"xt\",\"type\":\"umh\"}},{\"name\":\"lik\",\"properties\":{\"description\":\"slol\",\"groupId\":\"pvuzlmv\",\"type\":\"lfktgplcrpwjxe\"}}]},\"id\":\"oi\",\"name\":\"brnjwmw\",\"type\":\"pn\"}") .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("mczuo", model.groupId()); - Assertions.assertEquals("wcw", model.requiredMembers().get(0)); - Assertions.assertEquals("oknssxmojmsvpkjp", model.requiredZoneNames().get(0)); - Assertions.assertEquals("gtczheydb", model.shareablePrivateLinkResourceTypes().get(0).name()); - Assertions.assertEquals("hmkxmaehvbb", - model.shareablePrivateLinkResourceTypes().get(0).properties().description()); - Assertions.assertEquals("ripltf", model.shareablePrivateLinkResourceTypes().get(0).properties().groupId()); - Assertions.assertEquals("tbaxk", model.shareablePrivateLinkResourceTypes().get(0).properties().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = new PrivateLinkResourceInner().withGroupId("mczuo") - .withRequiredMembers(Arrays.asList("wcw")) - .withRequiredZoneNames(Arrays.asList("oknssxmojmsvpkjp", "vk", "cfzq")) - .withShareablePrivateLinkResourceTypes(Arrays.asList( - new ShareablePrivateLinkResourceType().withName("gtczheydb") - .withProperties(new ShareablePrivateLinkResourceProperties().withDescription("hmkxmaehvbb") - .withGroupId("ripltf") - .withType("tbaxk")), - new ShareablePrivateLinkResourceType().withName("ywrckp") - .withProperties(new ShareablePrivateLinkResourceProperties().withDescription("yhpluodpvruudlgz") - .withGroupId("thost") - .withType("tstvdxeclzedq")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("mczuo", model.groupId()); - Assertions.assertEquals("wcw", model.requiredMembers().get(0)); - Assertions.assertEquals("oknssxmojmsvpkjp", model.requiredZoneNames().get(0)); - Assertions.assertEquals("gtczheydb", model.shareablePrivateLinkResourceTypes().get(0).name()); - Assertions.assertEquals("hmkxmaehvbb", - model.shareablePrivateLinkResourceTypes().get(0).properties().description()); - Assertions.assertEquals("ripltf", model.shareablePrivateLinkResourceTypes().get(0).properties().groupId()); - Assertions.assertEquals("tbaxk", model.shareablePrivateLinkResourceTypes().get(0).properties().type()); + Assertions.assertEquals("wjygvjayvblmhvk", model.groupId()); + Assertions.assertEquals("bxvvyhg", model.requiredMembers().get(0)); + Assertions.assertEquals("dn", model.requiredZoneNames().get(0)); + Assertions.assertEquals("gbmhrixkwmyi", model.shareablePrivateLinkResourceTypes().get(0).name()); + Assertions.assertEquals("veg", model.shareablePrivateLinkResourceTypes().get(0).properties().description()); + Assertions.assertEquals("bpnaixexccbdre", + model.shareablePrivateLinkResourceTypes().get(0).properties().groupId()); + Assertions.assertEquals("hcexdrrvqa", model.shareablePrivateLinkResourceTypes().get(0).properties().type()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourceListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourceListTests.java index 578717f74f12..d4ce173215fa 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourceListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourceListTests.java @@ -1,57 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.webpubsub.models.PrivateLinkResourceList; -import com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceProperties; -import com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceType; -import java.util.Arrays; +import com.azure.resourcemanager.webpubsub.implementation.models.PrivateLinkResourceList; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourceListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"rgjupauut\",\"requiredMembers\":[\"qhih\"],\"requiredZoneNames\":[\"g\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"fqntcyp\",\"properties\":{}},{\"name\":\"vfoimwksli\",\"properties\":{}},{\"name\":\"zjxvydfcea\",\"properties\":{}}]},\"id\":\"hvygdyftumr\",\"name\":\"wnawjslbiw\",\"type\":\"ojgcyzt\"},{\"properties\":{\"groupId\":\"z\",\"requiredMembers\":[\"eqphchqnrnr\",\"x\",\"huwrykqgaifm\"],\"requiredZoneNames\":[\"lb\",\"dvk\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"dznx\",\"properties\":{}}]},\"id\":\"srhnjivo\",\"name\":\"v\",\"type\":\"novqfzge\"}],\"nextLink\":\"dftuljltduce\"}") + "{\"value\":[{\"properties\":{\"groupId\":\"lmfeokerq\",\"requiredMembers\":[\"hkobopgxedk\"],\"requiredZoneNames\":[\"pbqpcrfkbwccsn\",\"vcdwxlpqekftn\",\"htjsying\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"tmtdhtmdvypgik\",\"properties\":{}},{\"name\":\"zywkb\",\"properties\":{}},{\"name\":\"yuzhlhkjoqrvq\",\"properties\":{}}]},\"id\":\"t\",\"name\":\"inrvgoupmfi\",\"type\":\"bfggjioolvr\"}],\"nextLink\":\"kvtkkg\"}") .toObject(PrivateLinkResourceList.class); - Assertions.assertEquals("rgjupauut", model.value().get(0).groupId()); - Assertions.assertEquals("qhih", model.value().get(0).requiredMembers().get(0)); - Assertions.assertEquals("g", model.value().get(0).requiredZoneNames().get(0)); - Assertions.assertEquals("fqntcyp", model.value().get(0).shareablePrivateLinkResourceTypes().get(0).name()); - Assertions.assertEquals("dftuljltduce", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceList model - = new PrivateLinkResourceList() - .withValue(Arrays.asList( - new PrivateLinkResourceInner().withGroupId("rgjupauut") - .withRequiredMembers(Arrays.asList("qhih")) - .withRequiredZoneNames(Arrays.asList("g")) - .withShareablePrivateLinkResourceTypes(Arrays.asList( - new ShareablePrivateLinkResourceType().withName("fqntcyp") - .withProperties(new ShareablePrivateLinkResourceProperties()), - new ShareablePrivateLinkResourceType().withName("vfoimwksli") - .withProperties(new ShareablePrivateLinkResourceProperties()), - new ShareablePrivateLinkResourceType().withName("zjxvydfcea") - .withProperties(new ShareablePrivateLinkResourceProperties()))), - new PrivateLinkResourceInner().withGroupId("z") - .withRequiredMembers(Arrays.asList("eqphchqnrnr", "x", "huwrykqgaifm")) - .withRequiredZoneNames(Arrays.asList("lb", "dvk")) - .withShareablePrivateLinkResourceTypes( - Arrays.asList(new ShareablePrivateLinkResourceType().withName("dznx") - .withProperties(new ShareablePrivateLinkResourceProperties()))))) - .withNextLink("dftuljltduce"); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceList.class); - Assertions.assertEquals("rgjupauut", model.value().get(0).groupId()); - Assertions.assertEquals("qhih", model.value().get(0).requiredMembers().get(0)); - Assertions.assertEquals("g", model.value().get(0).requiredZoneNames().get(0)); - Assertions.assertEquals("fqntcyp", model.value().get(0).shareablePrivateLinkResourceTypes().get(0).name()); - Assertions.assertEquals("dftuljltduce", model.nextLink()); + Assertions.assertEquals("lmfeokerq", model.value().get(0).groupId()); + Assertions.assertEquals("hkobopgxedk", model.value().get(0).requiredMembers().get(0)); + Assertions.assertEquals("pbqpcrfkbwccsn", model.value().get(0).requiredZoneNames().get(0)); + Assertions.assertEquals("tmtdhtmdvypgik", + model.value().get(0).shareablePrivateLinkResourceTypes().get(0).name()); + Assertions.assertEquals("kvtkkg", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourcePropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourcePropertiesTests.java index 6afec8154a6b..d0818d36fbfd 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourcePropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkResourcePropertiesTests.java @@ -1,62 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.PrivateLinkResourceProperties; -import com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceProperties; -import com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceType; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"kxtrq\",\"requiredMembers\":[\"mlmbtxhwgfwsrta\",\"coezbrhubskh\",\"dyg\",\"ookk\"],\"requiredZoneNames\":[\"jb\",\"leorfmluiqtqz\",\"avyvnqqyba\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"ayjkqa\",\"properties\":{\"description\":\"zslesjcbher\",\"groupId\":\"tiewdj\",\"type\":\"bquwrbehw\"}},{\"name\":\"o\",\"properties\":{\"description\":\"f\",\"groupId\":\"mrqemvvhmx\",\"type\":\"rjfut\"}},{\"name\":\"oe\",\"properties\":{\"description\":\"ewzcjznmwcp\",\"groupId\":\"uaadraufactkahzo\",\"type\":\"jjziuxxpsh\"}},{\"name\":\"e\",\"properties\":{\"description\":\"fgslqubkwdl\",\"groupId\":\"rds\",\"type\":\"ujbazpjuohminyfl\"}}]}") + "{\"groupId\":\"azej\",\"requiredMembers\":[\"kagfhsxtt\",\"ugzxnf\",\"azpxdtnkdmkqjjl\"],\"requiredZoneNames\":[\"nvrk\",\"yo\",\"aibrebqaaysjkixq\",\"nqttezl\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"iakp\",\"properties\":{\"description\":\"qmt\",\"groupId\":\"ltmm\",\"type\":\"hyeozphvwau\"}},{\"name\":\"ncyg\",\"properties\":{\"description\":\"vipmdscwxqupevzh\",\"groupId\":\"totxhojujb\",\"type\":\"elmcuvhixbjxyfw\"}}]}") .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("kxtrq", model.groupId()); - Assertions.assertEquals("mlmbtxhwgfwsrta", model.requiredMembers().get(0)); - Assertions.assertEquals("jb", model.requiredZoneNames().get(0)); - Assertions.assertEquals("ayjkqa", model.shareablePrivateLinkResourceTypes().get(0).name()); - Assertions.assertEquals("zslesjcbher", - model.shareablePrivateLinkResourceTypes().get(0).properties().description()); - Assertions.assertEquals("tiewdj", model.shareablePrivateLinkResourceTypes().get(0).properties().groupId()); - Assertions.assertEquals("bquwrbehw", model.shareablePrivateLinkResourceTypes().get(0).properties().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties().withGroupId("kxtrq") - .withRequiredMembers(Arrays.asList("mlmbtxhwgfwsrta", "coezbrhubskh", "dyg", "ookk")) - .withRequiredZoneNames(Arrays.asList("jb", "leorfmluiqtqz", "avyvnqqyba")) - .withShareablePrivateLinkResourceTypes(Arrays.asList( - new ShareablePrivateLinkResourceType().withName("ayjkqa") - .withProperties(new ShareablePrivateLinkResourceProperties().withDescription("zslesjcbher") - .withGroupId("tiewdj") - .withType("bquwrbehw")), - new ShareablePrivateLinkResourceType().withName("o") - .withProperties(new ShareablePrivateLinkResourceProperties().withDescription("f") - .withGroupId("mrqemvvhmx") - .withType("rjfut")), - new ShareablePrivateLinkResourceType().withName("oe") - .withProperties(new ShareablePrivateLinkResourceProperties().withDescription("ewzcjznmwcp") - .withGroupId("uaadraufactkahzo") - .withType("jjziuxxpsh")), - new ShareablePrivateLinkResourceType().withName("e") - .withProperties(new ShareablePrivateLinkResourceProperties().withDescription("fgslqubkwdl") - .withGroupId("rds") - .withType("ujbazpjuohminyfl")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("kxtrq", model.groupId()); - Assertions.assertEquals("mlmbtxhwgfwsrta", model.requiredMembers().get(0)); - Assertions.assertEquals("jb", model.requiredZoneNames().get(0)); - Assertions.assertEquals("ayjkqa", model.shareablePrivateLinkResourceTypes().get(0).name()); - Assertions.assertEquals("zslesjcbher", - model.shareablePrivateLinkResourceTypes().get(0).properties().description()); - Assertions.assertEquals("tiewdj", model.shareablePrivateLinkResourceTypes().get(0).properties().groupId()); - Assertions.assertEquals("bquwrbehw", model.shareablePrivateLinkResourceTypes().get(0).properties().type()); + Assertions.assertEquals("azej", model.groupId()); + Assertions.assertEquals("kagfhsxtt", model.requiredMembers().get(0)); + Assertions.assertEquals("nvrk", model.requiredZoneNames().get(0)); + Assertions.assertEquals("iakp", model.shareablePrivateLinkResourceTypes().get(0).name()); + Assertions.assertEquals("qmt", model.shareablePrivateLinkResourceTypes().get(0).properties().description()); + Assertions.assertEquals("ltmm", model.shareablePrivateLinkResourceTypes().get(0).properties().groupId()); + Assertions.assertEquals("hyeozphvwau", model.shareablePrivateLinkResourceTypes().get(0).properties().type()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkServiceConnectionStateTests.java index dfe20f0b38a8..e9d41bd54b4d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkServiceConnectionStateTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/PrivateLinkServiceConnectionStateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,23 +12,23 @@ public final class PrivateLinkServiceConnectionStateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model - = BinaryData.fromString("{\"status\":\"Approved\",\"description\":\"ntuji\",\"actionsRequired\":\"jed\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("ntuji", model.description()); - Assertions.assertEquals("jed", model.actionsRequired()); + PrivateLinkServiceConnectionState model = BinaryData + .fromString("{\"status\":\"Disconnected\",\"description\":\"cuejrjxgci\",\"actionsRequired\":\"brh\"}") + .toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, model.status()); + Assertions.assertEquals("cuejrjxgci", model.description()); + Assertions.assertEquals("brh", model.actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) - .withDescription("ntuji") - .withActionsRequired("jed"); + = new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.DISCONNECTED) + .withDescription("cuejrjxgci") + .withActionsRequired("brh"); model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, model.status()); - Assertions.assertEquals("ntuji", model.description()); - Assertions.assertEquals("jed", model.actionsRequired()); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, model.status()); + Assertions.assertEquals("cuejrjxgci", model.description()); + Assertions.assertEquals("brh", model.actionsRequired()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaInnerTests.java index ed083064cb4a..15fa8f48abcb 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -16,32 +16,32 @@ public final class ReplicaInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReplicaInner model = BinaryData.fromString( - "{\"sku\":{\"name\":\"rnxrxcpj\",\"tier\":\"Standard\",\"size\":\"vokqdzfv\",\"family\":\"ivjlfrqttbajlka\",\"capacity\":764088106},\"properties\":{\"provisioningState\":\"Canceled\",\"regionEndpointEnabled\":\"pidkqqfkuvscxkdm\",\"resourceStopped\":\"govibrxkpmloazu\"},\"location\":\"ocbgoorbteoyb\",\"tags\":{\"il\":\"xakvvjgslor\",\"t\":\"yw\"},\"id\":\"gkxnyedabg\",\"name\":\"vudtjuewbcihx\",\"type\":\"uwhcjyxccybv\"}") + "{\"properties\":{\"provisioningState\":\"Succeeded\",\"regionEndpointEnabled\":\"tnovqfzgemjdftul\",\"resourceStopped\":\"tduceamt\"},\"sku\":{\"name\":\"zuo\",\"tier\":\"Free\",\"size\":\"cwwqiokn\",\"family\":\"xmojmsvpkjp\",\"capacity\":967300246},\"location\":\"cfzq\",\"tags\":{\"tczheydbsdshmkx\":\"x\",\"ltfnhtbaxkgx\":\"aehvbbxuri\"},\"id\":\"wrck\",\"name\":\"yklyhpluodpvruud\",\"type\":\"gzibthostgktstv\"}") .toObject(ReplicaInner.class); - Assertions.assertEquals("ocbgoorbteoyb", model.location()); - Assertions.assertEquals("xakvvjgslor", model.tags().get("il")); - Assertions.assertEquals("rnxrxcpj", model.sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals(764088106, model.sku().capacity()); - Assertions.assertEquals("pidkqqfkuvscxkdm", model.regionEndpointEnabled()); - Assertions.assertEquals("govibrxkpmloazu", model.resourceStopped()); + Assertions.assertEquals("cfzq", model.location()); + Assertions.assertEquals("x", model.tags().get("tczheydbsdshmkx")); + Assertions.assertEquals("zuo", model.sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.FREE, model.sku().tier()); + Assertions.assertEquals(967300246, model.sku().capacity()); + Assertions.assertEquals("tnovqfzgemjdftul", model.regionEndpointEnabled()); + Assertions.assertEquals("tduceamt", model.resourceStopped()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ReplicaInner model = new ReplicaInner().withLocation("ocbgoorbteoyb") - .withTags(mapOf("il", "xakvvjgslor", "t", "yw")) - .withSku(new ResourceSku().withName("rnxrxcpj").withTier(WebPubSubSkuTier.STANDARD).withCapacity(764088106)) - .withRegionEndpointEnabled("pidkqqfkuvscxkdm") - .withResourceStopped("govibrxkpmloazu"); + ReplicaInner model = new ReplicaInner().withLocation("cfzq") + .withTags(mapOf("tczheydbsdshmkx", "x", "ltfnhtbaxkgx", "aehvbbxuri")) + .withSku(new ResourceSku().withName("zuo").withTier(WebPubSubSkuTier.FREE).withCapacity(967300246)) + .withRegionEndpointEnabled("tnovqfzgemjdftul") + .withResourceStopped("tduceamt"); model = BinaryData.fromObject(model).toObject(ReplicaInner.class); - Assertions.assertEquals("ocbgoorbteoyb", model.location()); - Assertions.assertEquals("xakvvjgslor", model.tags().get("il")); - Assertions.assertEquals("rnxrxcpj", model.sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.STANDARD, model.sku().tier()); - Assertions.assertEquals(764088106, model.sku().capacity()); - Assertions.assertEquals("pidkqqfkuvscxkdm", model.regionEndpointEnabled()); - Assertions.assertEquals("govibrxkpmloazu", model.resourceStopped()); + Assertions.assertEquals("cfzq", model.location()); + Assertions.assertEquals("x", model.tags().get("tczheydbsdshmkx")); + Assertions.assertEquals("zuo", model.sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.FREE, model.sku().tier()); + Assertions.assertEquals(967300246, model.sku().capacity()); + Assertions.assertEquals("tnovqfzgemjdftul", model.regionEndpointEnabled()); + Assertions.assertEquals("tduceamt", model.resourceStopped()); } // Use "Map.of" if available diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaListTests.java index 4fea686ce299..0de8d90d7bf1 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaListTests.java @@ -1,71 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.ReplicaInner; -import com.azure.resourcemanager.webpubsub.models.ReplicaList; -import com.azure.resourcemanager.webpubsub.models.ResourceSku; +import com.azure.resourcemanager.webpubsub.implementation.models.ReplicaList; import com.azure.resourcemanager.webpubsub.models.WebPubSubSkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ReplicaListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReplicaList model = BinaryData.fromString( - "{\"value\":[{\"sku\":{\"name\":\"qplhlvnu\",\"tier\":\"Basic\",\"size\":\"lrphwzsoldw\",\"family\":\"uqdunvmnnrwrbi\",\"capacity\":2098382686},\"properties\":{\"provisioningState\":\"Unknown\",\"regionEndpointEnabled\":\"wjhhgdnhxmsivf\",\"resourceStopped\":\"iloxggdufiq\"},\"location\":\"ieuzaofjchvcyyy\",\"tags\":{\"oqonma\":\"dotcubiipuip\",\"cimpevfg\":\"jeknizshq\",\"rrilbywdxsmic\":\"b\",\"qujizdvo\":\"wrwfscjfnyns\"},\"id\":\"ytibyow\",\"name\":\"blgyavutpthj\",\"type\":\"xoi\"},{\"sku\":{\"name\":\"sks\",\"tier\":\"Free\",\"size\":\"lqol\",\"family\":\"kcgxxlxsffgcvi\",\"capacity\":1820797792},\"properties\":{\"provisioningState\":\"Failed\",\"regionEndpointEnabled\":\"w\",\"resourceStopped\":\"oupfgfb\"},\"location\":\"ubdyhgk\",\"tags\":{\"ktlahbqa\":\"nsgowzfttst\"},\"id\":\"tx\",\"name\":\"gzukxitmm\",\"type\":\"tg\"}],\"nextLink\":\"q\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Moving\",\"regionEndpointEnabled\":\"mlkxtrqjfs\",\"resourceStopped\":\"mbtxhwgf\"},\"sku\":{\"name\":\"rtawcoezb\",\"tier\":\"Premium\",\"size\":\"skh\",\"family\":\"ygo\",\"capacity\":328293320},\"location\":\"qfqjbvleorfm\",\"tags\":{\"qqybarye\":\"qtqzfavyv\",\"qgzsles\":\"ayjkqa\",\"vbquwr\":\"cbhernntiewdj\"},\"id\":\"ehwagoh\",\"name\":\"uffkmrqemvvh\",\"type\":\"xtdr\"},{\"properties\":{\"provisioningState\":\"Creating\",\"regionEndpointEnabled\":\"coebjvewzcj\",\"resourceStopped\":\"m\"},\"sku\":{\"name\":\"pmguaadraufac\",\"tier\":\"Premium\",\"size\":\"zov\",\"family\":\"j\",\"capacity\":1921546293},\"location\":\"xps\",\"tags\":{\"ulfgslqu\":\"e\",\"pjuohminyfl\":\"kwdlenrdsutujba\",\"w\":\"orwmduvwpklv\",\"epn\":\"ygdxpgpqchis\"},\"id\":\"bjcrxgibbdaxco\",\"name\":\"fozauorsuk\",\"type\":\"kwbqplhlvnuu\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"regionEndpointEnabled\":\"phwzsoldweyuqdu\",\"resourceStopped\":\"mnnrwr\"},\"sku\":{\"name\":\"ork\",\"tier\":\"Basic\",\"size\":\"wjhhgdnhxmsivf\",\"family\":\"iloxggdufiq\",\"capacity\":1651090930},\"location\":\"uzaofjchvcyyy\",\"tags\":{\"oqonma\":\"dotcubiipuip\",\"cimpevfg\":\"jeknizshq\",\"rrilbywdxsmic\":\"b\",\"qujizdvo\":\"wrwfscjfnyns\"},\"id\":\"ytibyow\",\"name\":\"blgyavutpthj\",\"type\":\"xoi\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"regionEndpointEnabled\":\"bpimlqoljxkcgxxl\",\"resourceStopped\":\"ffgcvizqz\"},\"sku\":{\"name\":\"l\",\"tier\":\"Standard\",\"size\":\"oupfgfb\",\"family\":\"ubdyhgk\",\"capacity\":370188648},\"location\":\"sgow\",\"tags\":{\"ctxtgzukxi\":\"tsttktlahbq\",\"xrxc\":\"mmqtgqqqxhr\",\"azivjlfrqttbajl\":\"juisavokqdzf\",\"kqqfk\":\"atnwxyiopi\"},\"id\":\"vscx\",\"name\":\"dmligovibrxk\",\"type\":\"mloazuru\"}],\"nextLink\":\"bgo\"}") .toObject(ReplicaList.class); - Assertions.assertEquals("ieuzaofjchvcyyy", model.value().get(0).location()); - Assertions.assertEquals("dotcubiipuip", model.value().get(0).tags().get("oqonma")); - Assertions.assertEquals("qplhlvnu", model.value().get(0).sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals(2098382686, model.value().get(0).sku().capacity()); - Assertions.assertEquals("wjhhgdnhxmsivf", model.value().get(0).regionEndpointEnabled()); - Assertions.assertEquals("iloxggdufiq", model.value().get(0).resourceStopped()); - Assertions.assertEquals("q", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplicaList model = new ReplicaList().withValue(Arrays.asList( - new ReplicaInner().withLocation("ieuzaofjchvcyyy") - .withTags(mapOf("oqonma", "dotcubiipuip", "cimpevfg", "jeknizshq", "rrilbywdxsmic", "b", "qujizdvo", - "wrwfscjfnyns")) - .withSku( - new ResourceSku().withName("qplhlvnu").withTier(WebPubSubSkuTier.BASIC).withCapacity(2098382686)) - .withRegionEndpointEnabled("wjhhgdnhxmsivf") - .withResourceStopped("iloxggdufiq"), - new ReplicaInner().withLocation("ubdyhgk") - .withTags(mapOf("ktlahbqa", "nsgowzfttst")) - .withSku(new ResourceSku().withName("sks").withTier(WebPubSubSkuTier.FREE).withCapacity(1820797792)) - .withRegionEndpointEnabled("w") - .withResourceStopped("oupfgfb"))) - .withNextLink("q"); - model = BinaryData.fromObject(model).toObject(ReplicaList.class); - Assertions.assertEquals("ieuzaofjchvcyyy", model.value().get(0).location()); - Assertions.assertEquals("dotcubiipuip", model.value().get(0).tags().get("oqonma")); - Assertions.assertEquals("qplhlvnu", model.value().get(0).sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.BASIC, model.value().get(0).sku().tier()); - Assertions.assertEquals(2098382686, model.value().get(0).sku().capacity()); - Assertions.assertEquals("wjhhgdnhxmsivf", model.value().get(0).regionEndpointEnabled()); - Assertions.assertEquals("iloxggdufiq", model.value().get(0).resourceStopped()); - Assertions.assertEquals("q", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("qfqjbvleorfm", model.value().get(0).location()); + Assertions.assertEquals("qtqzfavyv", model.value().get(0).tags().get("qqybarye")); + Assertions.assertEquals("rtawcoezb", model.value().get(0).sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.PREMIUM, model.value().get(0).sku().tier()); + Assertions.assertEquals(328293320, model.value().get(0).sku().capacity()); + Assertions.assertEquals("mlkxtrqjfs", model.value().get(0).regionEndpointEnabled()); + Assertions.assertEquals("mbtxhwgf", model.value().get(0).resourceStopped()); + Assertions.assertEquals("bgo", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaPropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaPropertiesTests.java index cb46fda04a02..d2102dea144d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaPropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ReplicaPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,18 +12,18 @@ public final class ReplicaPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReplicaProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Updating\",\"regionEndpointEnabled\":\"kkudzp\",\"resourceStopped\":\"wjplma\"}") + "{\"provisioningState\":\"Succeeded\",\"regionEndpointEnabled\":\"lzedqbcvhzlhplo\",\"resourceStopped\":\"kdl\"}") .toObject(ReplicaProperties.class); - Assertions.assertEquals("kkudzp", model.regionEndpointEnabled()); - Assertions.assertEquals("wjplma", model.resourceStopped()); + Assertions.assertEquals("lzedqbcvhzlhplo", model.regionEndpointEnabled()); + Assertions.assertEquals("kdl", model.resourceStopped()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ReplicaProperties model - = new ReplicaProperties().withRegionEndpointEnabled("kkudzp").withResourceStopped("wjplma"); + = new ReplicaProperties().withRegionEndpointEnabled("lzedqbcvhzlhplo").withResourceStopped("kdl"); model = BinaryData.fromObject(model).toObject(ReplicaProperties.class); - Assertions.assertEquals("kkudzp", model.regionEndpointEnabled()); - Assertions.assertEquals("wjplma", model.resourceStopped()); + Assertions.assertEquals("lzedqbcvhzlhplo", model.regionEndpointEnabled()); + Assertions.assertEquals("kdl", model.resourceStopped()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceLogCategoryTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceLogCategoryTests.java index 3345f5bd3ef0..a160e1344400 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceLogCategoryTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceLogCategoryTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,17 +11,17 @@ public final class ResourceLogCategoryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceLogCategory model = BinaryData.fromString("{\"name\":\"l\",\"enabled\":\"qhoftrmaequiah\"}") + ResourceLogCategory model = BinaryData.fromString("{\"name\":\"cciuqgbdbutau\",\"enabled\":\"btkuwhh\"}") .toObject(ResourceLogCategory.class); - Assertions.assertEquals("l", model.name()); - Assertions.assertEquals("qhoftrmaequiah", model.enabled()); + Assertions.assertEquals("cciuqgbdbutau", model.name()); + Assertions.assertEquals("btkuwhh", model.enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceLogCategory model = new ResourceLogCategory().withName("l").withEnabled("qhoftrmaequiah"); + ResourceLogCategory model = new ResourceLogCategory().withName("cciuqgbdbutau").withEnabled("btkuwhh"); model = BinaryData.fromObject(model).toObject(ResourceLogCategory.class); - Assertions.assertEquals("l", model.name()); - Assertions.assertEquals("qhoftrmaequiah", model.enabled()); + Assertions.assertEquals("cciuqgbdbutau", model.name()); + Assertions.assertEquals("btkuwhh", model.enabled()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceLogConfigurationTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceLogConfigurationTests.java index edabee01fb31..058f9bec6fbb 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceLogConfigurationTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceLogConfigurationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -14,20 +14,19 @@ public final class ResourceLogConfigurationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResourceLogConfiguration model = BinaryData.fromString( - "{\"categories\":[{\"name\":\"wpusdsttwvogv\",\"enabled\":\"ejdcngqqmoakuf\"},{\"name\":\"jzrwrdgrtw\",\"enabled\":\"nuuzkopbm\"},{\"name\":\"rfdwoyu\",\"enabled\":\"ziuiefozbhdm\"}]}") + "{\"categories\":[{\"name\":\"cnqxwbpokulpi\",\"enabled\":\"waasip\"},{\"name\":\"iobyu\",\"enabled\":\"rpqlp\"}]}") .toObject(ResourceLogConfiguration.class); - Assertions.assertEquals("wpusdsttwvogv", model.categories().get(0).name()); - Assertions.assertEquals("ejdcngqqmoakuf", model.categories().get(0).enabled()); + Assertions.assertEquals("cnqxwbpokulpi", model.categories().get(0).name()); + Assertions.assertEquals("waasip", model.categories().get(0).enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceLogConfiguration model = new ResourceLogConfiguration().withCategories( - Arrays.asList(new ResourceLogCategory().withName("wpusdsttwvogv").withEnabled("ejdcngqqmoakuf"), - new ResourceLogCategory().withName("jzrwrdgrtw").withEnabled("nuuzkopbm"), - new ResourceLogCategory().withName("rfdwoyu").withEnabled("ziuiefozbhdm"))); + ResourceLogConfiguration model = new ResourceLogConfiguration() + .withCategories(Arrays.asList(new ResourceLogCategory().withName("cnqxwbpokulpi").withEnabled("waasip"), + new ResourceLogCategory().withName("iobyu").withEnabled("rpqlp"))); model = BinaryData.fromObject(model).toObject(ResourceLogConfiguration.class); - Assertions.assertEquals("wpusdsttwvogv", model.categories().get(0).name()); - Assertions.assertEquals("ejdcngqqmoakuf", model.categories().get(0).enabled()); + Assertions.assertEquals("cnqxwbpokulpi", model.categories().get(0).name()); + Assertions.assertEquals("waasip", model.categories().get(0).enabled()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceReferenceTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceReferenceTests.java index 3947a7e12655..7eb8d891a9cf 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceReferenceTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceReferenceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,14 +11,14 @@ public final class ResourceReferenceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceReference model = BinaryData.fromString("{\"id\":\"kndxdigrjgu\"}").toObject(ResourceReference.class); - Assertions.assertEquals("kndxdigrjgu", model.id()); + ResourceReference model = BinaryData.fromString("{\"id\":\"hezrkgq\"}").toObject(ResourceReference.class); + Assertions.assertEquals("hezrkgq", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceReference model = new ResourceReference().withId("kndxdigrjgu"); + ResourceReference model = new ResourceReference().withId("hezrkgq"); model = BinaryData.fromObject(model).toObject(ResourceReference.class); - Assertions.assertEquals("kndxdigrjgu", model.id()); + Assertions.assertEquals("hezrkgq", model.id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceSkuTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceSkuTests.java index 0dbacd98bbb7..e4214d18912c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceSkuTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ResourceSkuTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -13,20 +13,20 @@ public final class ResourceSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResourceSku model = BinaryData.fromString( - "{\"name\":\"hqkvpuvksgplsak\",\"tier\":\"Free\",\"size\":\"synljphuopxodl\",\"family\":\"ynt\",\"capacity\":863114887}") + "{\"name\":\"uiizynke\",\"tier\":\"Premium\",\"size\":\"rwyhqmibzyhwitsm\",\"family\":\"yynpcdpumnzgmwz\",\"capacity\":1417683929}") .toObject(ResourceSku.class); - Assertions.assertEquals("hqkvpuvksgplsak", model.name()); - Assertions.assertEquals(WebPubSubSkuTier.FREE, model.tier()); - Assertions.assertEquals(863114887, model.capacity()); + Assertions.assertEquals("uiizynke", model.name()); + Assertions.assertEquals(WebPubSubSkuTier.PREMIUM, model.tier()); + Assertions.assertEquals(1417683929, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ResourceSku model - = new ResourceSku().withName("hqkvpuvksgplsak").withTier(WebPubSubSkuTier.FREE).withCapacity(863114887); + = new ResourceSku().withName("uiizynke").withTier(WebPubSubSkuTier.PREMIUM).withCapacity(1417683929); model = BinaryData.fromObject(model).toObject(ResourceSku.class); - Assertions.assertEquals("hqkvpuvksgplsak", model.name()); - Assertions.assertEquals(WebPubSubSkuTier.FREE, model.tier()); - Assertions.assertEquals(863114887, model.capacity()); + Assertions.assertEquals("uiizynke", model.name()); + Assertions.assertEquals(WebPubSubSkuTier.PREMIUM, model.tier()); + Assertions.assertEquals(1417683929, model.capacity()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ServiceSpecificationTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ServiceSpecificationTests.java index 57bc8a7e373d..76dbd89bbcea 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ServiceSpecificationTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ServiceSpecificationTests.java @@ -1,118 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.models.Dimension; -import com.azure.resourcemanager.webpubsub.models.LogSpecification; -import com.azure.resourcemanager.webpubsub.models.MetricSpecification; import com.azure.resourcemanager.webpubsub.models.ServiceSpecification; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ServiceSpecificationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceSpecification model = BinaryData.fromString( - "{\"metricSpecifications\":[{\"name\":\"izuckyfihrfidfvz\",\"displayName\":\"zuhtymwisdkfthwx\",\"displayDescription\":\"t\",\"unit\":\"waopvkmijcmmxd\",\"aggregationType\":\"fufsrpymzi\",\"fillGapWithZero\":\"sezcxtb\",\"category\":\"gfycc\",\"dimensions\":[{\"name\":\"mdwzjeiachboo\",\"displayName\":\"lnrosfqp\",\"internalName\":\"ehzzvypyqrim\",\"toBeExportedForShoebox\":true},{\"name\":\"vswjdk\",\"displayName\":\"soodqxhcrmnoh\",\"internalName\":\"ckwhds\",\"toBeExportedForShoebox\":true}]},{\"name\":\"yip\",\"displayName\":\"sqwpgrjb\",\"displayDescription\":\"orcjxvsnby\",\"unit\":\"abnmocpcyshu\",\"aggregationType\":\"afbljjgpbtoqcjmk\",\"fillGapWithZero\":\"a\",\"category\":\"qidtqajzyu\",\"dimensions\":[{\"name\":\"dj\",\"displayName\":\"lkhbz\",\"internalName\":\"epgzgqexz\",\"toBeExportedForShoebox\":false},{\"name\":\"scpai\",\"displayName\":\"hhbcsglummajtjao\",\"internalName\":\"obnbdxkqpxokaj\",\"toBeExportedForShoebox\":false},{\"name\":\"imexgstxgcpodgma\",\"displayName\":\"r\",\"internalName\":\"djwzrlov\",\"toBeExportedForShoebox\":true}]},{\"name\":\"hijco\",\"displayName\":\"ctbzaq\",\"displayDescription\":\"sycbkbfk\",\"unit\":\"kdkexxp\",\"aggregationType\":\"fmxa\",\"fillGapWithZero\":\"fjpgddtocjjxhvp\",\"category\":\"uexhdzx\",\"dimensions\":[{\"name\":\"ojnxqbzvdd\",\"displayName\":\"wndeicbtwnp\",\"internalName\":\"oqvuhr\",\"toBeExportedForShoebox\":false},{\"name\":\"cyddglmjthjqk\",\"displayName\":\"yeicxmqciwqvhk\",\"internalName\":\"xuigdtopbobj\",\"toBeExportedForShoebox\":false},{\"name\":\"e\",\"displayName\":\"a\",\"internalName\":\"uhrzayvvt\",\"toBeExportedForShoebox\":false},{\"name\":\"f\",\"displayName\":\"otkftutqxlngx\",\"internalName\":\"fgugnxkrxdqmid\",\"toBeExportedForShoebox\":false}]}],\"logSpecifications\":[{\"name\":\"qdrabhjybigehoqf\",\"displayName\":\"wska\"},{\"name\":\"ktzlcuiywg\",\"displayName\":\"wgndrvynhzgpp\"}]}") + "{\"metricSpecifications\":[{\"name\":\"kjfkg\",\"displayName\":\"w\",\"displayDescription\":\"lryplwckbasyy\",\"unit\":\"ddhsgcbacphe\",\"aggregationType\":\"ot\",\"fillGapWithZero\":\"qgoulznd\",\"category\":\"kwy\",\"dimensions\":[{\"name\":\"gibma\",\"displayName\":\"akeqs\",\"internalName\":\"yb\",\"toBeExportedForShoebox\":true},{\"name\":\"dqytbciqfouflmm\",\"displayName\":\"zsm\",\"internalName\":\"mglougpbkw\",\"toBeExportedForShoebox\":true}]},{\"name\":\"duqkt\",\"displayName\":\"spwgcuertumkdosv\",\"displayDescription\":\"hbmdgbbjfdd\",\"unit\":\"bmbexppbhtqqro\",\"aggregationType\":\"p\",\"fillGapWithZero\":\"s\",\"category\":\"gbquxigj\",\"dimensions\":[{\"name\":\"jaoyfhrtx\",\"displayName\":\"n\",\"internalName\":\"kujysvlejuvfq\",\"toBeExportedForShoebox\":true},{\"name\":\"yxwjkcp\",\"displayName\":\"nwbxgjvtbvpyssz\",\"internalName\":\"rujqg\",\"toBeExportedForShoebox\":false},{\"name\":\"ouqfprwz\",\"displayName\":\"nguitnwuizgazxu\",\"internalName\":\"zuckyfi\",\"toBeExportedForShoebox\":false},{\"name\":\"dfvzwdzuhty\",\"displayName\":\"isdkfthwxmnteiw\",\"internalName\":\"pvkmijcmmxdcuf\",\"toBeExportedForShoebox\":false}]}],\"logSpecifications\":[{\"name\":\"mzidnsezcxtb\",\"displayName\":\"gfycc\"},{\"name\":\"ewmdw\",\"displayName\":\"eiachboosflnr\"},{\"name\":\"fqpte\",\"displayName\":\"zzvypyqrimzinp\"},{\"name\":\"wjdk\",\"displayName\":\"soodqxhcrmnoh\"}]}") .toObject(ServiceSpecification.class); - Assertions.assertEquals("izuckyfihrfidfvz", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("t", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("waopvkmijcmmxd", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("fufsrpymzi", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("sezcxtb", model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("gfycc", model.metricSpecifications().get(0).category()); - Assertions.assertEquals("mdwzjeiachboo", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("lnrosfqp", model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("ehzzvypyqrim", model.metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("qdrabhjybigehoqf", model.logSpecifications().get(0).name()); - Assertions.assertEquals("wska", model.logSpecifications().get(0).displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceSpecification model = new ServiceSpecification() - .withMetricSpecifications(Arrays.asList( - new MetricSpecification().withName("izuckyfihrfidfvz") - .withDisplayName("zuhtymwisdkfthwx") - .withDisplayDescription("t") - .withUnit("waopvkmijcmmxd") - .withAggregationType("fufsrpymzi") - .withFillGapWithZero("sezcxtb") - .withCategory("gfycc") - .withDimensions(Arrays.asList( - new Dimension().withName("mdwzjeiachboo") - .withDisplayName("lnrosfqp") - .withInternalName("ehzzvypyqrim") - .withToBeExportedForShoebox(true), - new Dimension().withName("vswjdk") - .withDisplayName("soodqxhcrmnoh") - .withInternalName("ckwhds") - .withToBeExportedForShoebox(true))), - new MetricSpecification().withName("yip") - .withDisplayName("sqwpgrjb") - .withDisplayDescription("orcjxvsnby") - .withUnit("abnmocpcyshu") - .withAggregationType("afbljjgpbtoqcjmk") - .withFillGapWithZero("a") - .withCategory("qidtqajzyu") - .withDimensions(Arrays.asList( - new Dimension().withName("dj") - .withDisplayName("lkhbz") - .withInternalName("epgzgqexz") - .withToBeExportedForShoebox(false), - new Dimension().withName("scpai") - .withDisplayName("hhbcsglummajtjao") - .withInternalName("obnbdxkqpxokaj") - .withToBeExportedForShoebox(false), - new Dimension().withName("imexgstxgcpodgma") - .withDisplayName("r") - .withInternalName("djwzrlov") - .withToBeExportedForShoebox(true))), - new MetricSpecification().withName("hijco") - .withDisplayName("ctbzaq") - .withDisplayDescription("sycbkbfk") - .withUnit("kdkexxp") - .withAggregationType("fmxa") - .withFillGapWithZero("fjpgddtocjjxhvp") - .withCategory("uexhdzx") - .withDimensions(Arrays.asList( - new Dimension().withName("ojnxqbzvdd") - .withDisplayName("wndeicbtwnp") - .withInternalName("oqvuhr") - .withToBeExportedForShoebox(false), - new Dimension().withName("cyddglmjthjqk") - .withDisplayName("yeicxmqciwqvhk") - .withInternalName("xuigdtopbobj") - .withToBeExportedForShoebox(false), - new Dimension().withName("e") - .withDisplayName("a") - .withInternalName("uhrzayvvt") - .withToBeExportedForShoebox(false), - new Dimension().withName("f") - .withDisplayName("otkftutqxlngx") - .withInternalName("fgugnxkrxdqmid") - .withToBeExportedForShoebox(false))))) - .withLogSpecifications( - Arrays.asList(new LogSpecification().withName("qdrabhjybigehoqf").withDisplayName("wska"), - new LogSpecification().withName("ktzlcuiywg").withDisplayName("wgndrvynhzgpp"))); - model = BinaryData.fromObject(model).toObject(ServiceSpecification.class); - Assertions.assertEquals("izuckyfihrfidfvz", model.metricSpecifications().get(0).name()); - Assertions.assertEquals("zuhtymwisdkfthwx", model.metricSpecifications().get(0).displayName()); - Assertions.assertEquals("t", model.metricSpecifications().get(0).displayDescription()); - Assertions.assertEquals("waopvkmijcmmxd", model.metricSpecifications().get(0).unit()); - Assertions.assertEquals("fufsrpymzi", model.metricSpecifications().get(0).aggregationType()); - Assertions.assertEquals("sezcxtb", model.metricSpecifications().get(0).fillGapWithZero()); - Assertions.assertEquals("gfycc", model.metricSpecifications().get(0).category()); - Assertions.assertEquals("mdwzjeiachboo", model.metricSpecifications().get(0).dimensions().get(0).name()); - Assertions.assertEquals("lnrosfqp", model.metricSpecifications().get(0).dimensions().get(0).displayName()); - Assertions.assertEquals("ehzzvypyqrim", model.metricSpecifications().get(0).dimensions().get(0).internalName()); - Assertions.assertEquals(true, model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); - Assertions.assertEquals("qdrabhjybigehoqf", model.logSpecifications().get(0).name()); - Assertions.assertEquals("wska", model.logSpecifications().get(0).displayName()); + Assertions.assertEquals("kjfkg", model.metricSpecifications().get(0).name()); + Assertions.assertEquals("w", model.metricSpecifications().get(0).displayName()); + Assertions.assertEquals("lryplwckbasyy", model.metricSpecifications().get(0).displayDescription()); + Assertions.assertEquals("ddhsgcbacphe", model.metricSpecifications().get(0).unit()); + Assertions.assertEquals("ot", model.metricSpecifications().get(0).aggregationType()); + Assertions.assertEquals("qgoulznd", model.metricSpecifications().get(0).fillGapWithZero()); + Assertions.assertEquals("kwy", model.metricSpecifications().get(0).category()); + Assertions.assertEquals("gibma", model.metricSpecifications().get(0).dimensions().get(0).name()); + Assertions.assertEquals("akeqs", model.metricSpecifications().get(0).dimensions().get(0).displayName()); + Assertions.assertEquals("yb", model.metricSpecifications().get(0).dimensions().get(0).internalName()); + Assertions.assertTrue(model.metricSpecifications().get(0).dimensions().get(0).toBeExportedForShoebox()); + Assertions.assertEquals("mzidnsezcxtb", model.logSpecifications().get(0).name()); + Assertions.assertEquals("gfycc", model.logSpecifications().get(0).displayName()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ShareablePrivateLinkResourcePropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ShareablePrivateLinkResourcePropertiesTests.java index 82dc647af066..db59cbfbfdde 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ShareablePrivateLinkResourcePropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ShareablePrivateLinkResourcePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,22 +12,10 @@ public final class ShareablePrivateLinkResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ShareablePrivateLinkResourceProperties model - = BinaryData.fromString("{\"description\":\"nb\",\"groupId\":\"rxgibbd\",\"type\":\"confozauors\"}") + = BinaryData.fromString("{\"description\":\"nfdn\",\"groupId\":\"jchrdgoihxumw\",\"type\":\"ond\"}") .toObject(ShareablePrivateLinkResourceProperties.class); - Assertions.assertEquals("nb", model.description()); - Assertions.assertEquals("rxgibbd", model.groupId()); - Assertions.assertEquals("confozauors", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ShareablePrivateLinkResourceProperties model - = new ShareablePrivateLinkResourceProperties().withDescription("nb") - .withGroupId("rxgibbd") - .withType("confozauors"); - model = BinaryData.fromObject(model).toObject(ShareablePrivateLinkResourceProperties.class); - Assertions.assertEquals("nb", model.description()); - Assertions.assertEquals("rxgibbd", model.groupId()); - Assertions.assertEquals("confozauors", model.type()); + Assertions.assertEquals("nfdn", model.description()); + Assertions.assertEquals("jchrdgoihxumw", model.groupId()); + Assertions.assertEquals("ond", model.type()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ShareablePrivateLinkResourceTypeTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ShareablePrivateLinkResourceTypeTests.java index ae4851a3ea84..cf28ece01e0c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ShareablePrivateLinkResourceTypeTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ShareablePrivateLinkResourceTypeTests.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceProperties; import com.azure.resourcemanager.webpubsub.models.ShareablePrivateLinkResourceType; import org.junit.jupiter.api.Assertions; @@ -13,24 +12,11 @@ public final class ShareablePrivateLinkResourceTypeTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ShareablePrivateLinkResourceType model = BinaryData.fromString( - "{\"name\":\"rwm\",\"properties\":{\"description\":\"wpklvxw\",\"groupId\":\"gdxpg\",\"type\":\"chisze\"}}") + "{\"name\":\"lrcoolsttpki\",\"properties\":{\"description\":\"bnujrywvtylbf\",\"groupId\":\"curdoiwiitht\",\"type\":\"ubxcbihw\"}}") .toObject(ShareablePrivateLinkResourceType.class); - Assertions.assertEquals("rwm", model.name()); - Assertions.assertEquals("wpklvxw", model.properties().description()); - Assertions.assertEquals("gdxpg", model.properties().groupId()); - Assertions.assertEquals("chisze", model.properties().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ShareablePrivateLinkResourceType model = new ShareablePrivateLinkResourceType().withName("rwm") - .withProperties(new ShareablePrivateLinkResourceProperties().withDescription("wpklvxw") - .withGroupId("gdxpg") - .withType("chisze")); - model = BinaryData.fromObject(model).toObject(ShareablePrivateLinkResourceType.class); - Assertions.assertEquals("rwm", model.name()); - Assertions.assertEquals("wpklvxw", model.properties().description()); - Assertions.assertEquals("gdxpg", model.properties().groupId()); - Assertions.assertEquals("chisze", model.properties().type()); + Assertions.assertEquals("lrcoolsttpki", model.name()); + Assertions.assertEquals("bnujrywvtylbf", model.properties().description()); + Assertions.assertEquals("curdoiwiitht", model.properties().groupId()); + Assertions.assertEquals("ubxcbihw", model.properties().type()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourceInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourceInnerTests.java index 787d18a31edd..db42df17488e 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourceInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourceInnerTests.java @@ -1,32 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceInner; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SharedPrivateLinkResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SharedPrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"wwa\",\"privateLinkResourceId\":\"zkoj\",\"provisioningState\":\"Running\",\"requestMessage\":\"zfoqouicybxar\",\"status\":\"Disconnected\"},\"id\":\"ufoxc\",\"name\":\"q\",\"type\":\"p\"}") + "{\"properties\":{\"groupId\":\"vvnchrkcc\",\"privateLinkResourceId\":\"wwzjuqkhrsajiwku\",\"provisioningState\":\"Canceled\",\"requestMessage\":\"kg\",\"fqdns\":[\"uuimjmvxieduug\"],\"status\":\"Timeout\"},\"id\":\"rrfbyaosvexcson\",\"name\":\"clhocohsl\",\"type\":\"ev\"}") .toObject(SharedPrivateLinkResourceInner.class); - Assertions.assertEquals("wwa", model.groupId()); - Assertions.assertEquals("zkoj", model.privateLinkResourceId()); - Assertions.assertEquals("zfoqouicybxar", model.requestMessage()); + Assertions.assertEquals("vvnchrkcc", model.groupId()); + Assertions.assertEquals("wwzjuqkhrsajiwku", model.privateLinkResourceId()); + Assertions.assertEquals("kg", model.requestMessage()); + Assertions.assertEquals("uuimjmvxieduug", model.fqdns().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SharedPrivateLinkResourceInner model = new SharedPrivateLinkResourceInner().withGroupId("wwa") - .withPrivateLinkResourceId("zkoj") - .withRequestMessage("zfoqouicybxar"); + SharedPrivateLinkResourceInner model = new SharedPrivateLinkResourceInner().withGroupId("vvnchrkcc") + .withPrivateLinkResourceId("wwzjuqkhrsajiwku") + .withRequestMessage("kg") + .withFqdns(Arrays.asList("uuimjmvxieduug")); model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResourceInner.class); - Assertions.assertEquals("wwa", model.groupId()); - Assertions.assertEquals("zkoj", model.privateLinkResourceId()); - Assertions.assertEquals("zfoqouicybxar", model.requestMessage()); + Assertions.assertEquals("vvnchrkcc", model.groupId()); + Assertions.assertEquals("wwzjuqkhrsajiwku", model.privateLinkResourceId()); + Assertions.assertEquals("kg", model.requestMessage()); + Assertions.assertEquals("uuimjmvxieduug", model.fqdns().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourceListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourceListTests.java index f044a14221cc..53ac84721f61 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourceListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourceListTests.java @@ -1,44 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceInner; -import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResourceList; -import java.util.Arrays; +import com.azure.resourcemanager.webpubsub.implementation.models.SharedPrivateLinkResourceList; import org.junit.jupiter.api.Assertions; public final class SharedPrivateLinkResourceListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SharedPrivateLinkResourceList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"yohpfkyrkdbdgiog\",\"privateLinkResourceId\":\"jkmnwq\",\"provisioningState\":\"Deleting\",\"requestMessage\":\"aiy\",\"status\":\"Approved\"},\"id\":\"iacegfnmn\",\"name\":\"fpmvmemfnczd\",\"type\":\"vvbalx\"},{\"properties\":{\"groupId\":\"lchpodbzevwrdn\",\"privateLinkResourceId\":\"fukuvsjcswsmystu\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"pfcvlerchpqbmfp\",\"status\":\"Disconnected\"},\"id\":\"widf\",\"name\":\"xsspuunnoxyhk\",\"type\":\"g\"},{\"properties\":{\"groupId\":\"drihpfhoqcaaewda\",\"privateLinkResourceId\":\"mdjvlpj\",\"provisioningState\":\"Moving\",\"requestMessage\":\"brm\",\"status\":\"Approved\"},\"id\":\"vsiykzkdncjdxon\",\"name\":\"zoggculapz\",\"type\":\"y\"}],\"nextLink\":\"gogtqxepnylbf\"}") + "{\"value\":[{\"properties\":{\"groupId\":\"tko\",\"privateLinkResourceId\":\"nkoukn\",\"provisioningState\":\"Creating\",\"requestMessage\":\"tiukbldngkpoci\",\"fqdns\":[\"yxoegukgjnp\"],\"status\":\"Approved\"},\"id\":\"ygevqzntypmrbpiz\",\"name\":\"drqjsdpy\",\"type\":\"nfyhx\"},{\"properties\":{\"groupId\":\"oejzi\",\"privateLinkResourceId\":\"w\",\"provisioningState\":\"Failed\",\"requestMessage\":\"ttgzfbis\",\"fqdns\":[\"khaj\"],\"status\":\"Timeout\"},\"id\":\"a\",\"name\":\"dphagalpbuxwgip\",\"type\":\"honowkgshwank\"},{\"properties\":{\"groupId\":\"zbinjeputtm\",\"privateLinkResourceId\":\"ywnuzoq\",\"provisioningState\":\"Unknown\",\"requestMessage\":\"qzrnkcqvyxlwhz\",\"fqdns\":[\"cohoq\",\"nwvlryavwhheunmm\",\"hgyxzkonoc\"],\"status\":\"Timeout\"},\"id\":\"lyaxuc\",\"name\":\"nuqszfkbey\",\"type\":\"ewrmjmwvvjektc\"}],\"nextLink\":\"enhwlrs\"}") .toObject(SharedPrivateLinkResourceList.class); - Assertions.assertEquals("yohpfkyrkdbdgiog", model.value().get(0).groupId()); - Assertions.assertEquals("jkmnwq", model.value().get(0).privateLinkResourceId()); - Assertions.assertEquals("aiy", model.value().get(0).requestMessage()); - Assertions.assertEquals("gogtqxepnylbf", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SharedPrivateLinkResourceList model = new SharedPrivateLinkResourceList().withValue(Arrays.asList( - new SharedPrivateLinkResourceInner().withGroupId("yohpfkyrkdbdgiog") - .withPrivateLinkResourceId("jkmnwq") - .withRequestMessage("aiy"), - new SharedPrivateLinkResourceInner().withGroupId("lchpodbzevwrdn") - .withPrivateLinkResourceId("fukuvsjcswsmystu") - .withRequestMessage("pfcvlerchpqbmfp"), - new SharedPrivateLinkResourceInner().withGroupId("drihpfhoqcaaewda") - .withPrivateLinkResourceId("mdjvlpj") - .withRequestMessage("brm"))) - .withNextLink("gogtqxepnylbf"); - model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResourceList.class); - Assertions.assertEquals("yohpfkyrkdbdgiog", model.value().get(0).groupId()); - Assertions.assertEquals("jkmnwq", model.value().get(0).privateLinkResourceId()); - Assertions.assertEquals("aiy", model.value().get(0).requestMessage()); - Assertions.assertEquals("gogtqxepnylbf", model.nextLink()); + Assertions.assertEquals("tko", model.value().get(0).groupId()); + Assertions.assertEquals("nkoukn", model.value().get(0).privateLinkResourceId()); + Assertions.assertEquals("tiukbldngkpoci", model.value().get(0).requestMessage()); + Assertions.assertEquals("yxoegukgjnp", model.value().get(0).fqdns().get(0)); + Assertions.assertEquals("enhwlrs", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourcePropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourcePropertiesTests.java index e18a493341aa..089e5c7ffa00 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourcePropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SharedPrivateLinkResourcePropertiesTests.java @@ -1,33 +1,36 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceProperties; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SharedPrivateLinkResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SharedPrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"doamciodhkha\",\"privateLinkResourceId\":\"xkhnzbonlwnto\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"dwbwhkszzcmrvexz\",\"status\":\"Disconnected\"}") + "{\"groupId\":\"eggzfb\",\"privateLinkResourceId\":\"hfmvfaxkffe\",\"provisioningState\":\"Failed\",\"requestMessage\":\"lvmezyvshxmzsbbz\",\"fqdns\":[\"igrxwburvjxxjn\"],\"status\":\"Timeout\"}") .toObject(SharedPrivateLinkResourceProperties.class); - Assertions.assertEquals("doamciodhkha", model.groupId()); - Assertions.assertEquals("xkhnzbonlwnto", model.privateLinkResourceId()); - Assertions.assertEquals("dwbwhkszzcmrvexz", model.requestMessage()); + Assertions.assertEquals("eggzfb", model.groupId()); + Assertions.assertEquals("hfmvfaxkffe", model.privateLinkResourceId()); + Assertions.assertEquals("lvmezyvshxmzsbbz", model.requestMessage()); + Assertions.assertEquals("igrxwburvjxxjn", model.fqdns().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SharedPrivateLinkResourceProperties model - = new SharedPrivateLinkResourceProperties().withGroupId("doamciodhkha") - .withPrivateLinkResourceId("xkhnzbonlwnto") - .withRequestMessage("dwbwhkszzcmrvexz"); + SharedPrivateLinkResourceProperties model = new SharedPrivateLinkResourceProperties().withGroupId("eggzfb") + .withPrivateLinkResourceId("hfmvfaxkffe") + .withRequestMessage("lvmezyvshxmzsbbz") + .withFqdns(Arrays.asList("igrxwburvjxxjn")); model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResourceProperties.class); - Assertions.assertEquals("doamciodhkha", model.groupId()); - Assertions.assertEquals("xkhnzbonlwnto", model.privateLinkResourceId()); - Assertions.assertEquals("dwbwhkszzcmrvexz", model.requestMessage()); + Assertions.assertEquals("eggzfb", model.groupId()); + Assertions.assertEquals("hfmvfaxkffe", model.privateLinkResourceId()); + Assertions.assertEquals("lvmezyvshxmzsbbz", model.requestMessage()); + Assertions.assertEquals("igrxwburvjxxjn", model.fqdns().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageInnerTests.java index ca0101d6982f..afc7b3e04628 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageInnerTests.java @@ -1,41 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.SignalRServiceUsageInner; -import com.azure.resourcemanager.webpubsub.models.SignalRServiceUsageName; import org.junit.jupiter.api.Assertions; public final class SignalRServiceUsageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SignalRServiceUsageInner model = BinaryData.fromString( - "{\"id\":\"vyvdcs\",\"currentValue\":6235593202680912824,\"limit\":7516654710743281273,\"name\":{\"value\":\"ectehf\",\"localizedValue\":\"scjeypv\"},\"unit\":\"zrkgqhcjrefovg\"}") + "{\"id\":\"kkdmfl\",\"currentValue\":3963298330756380,\"limit\":3734568678043826451,\"name\":{\"value\":\"ril\",\"localizedValue\":\"apeewchpxlkt\"},\"unit\":\"uziycsl\"}") .toObject(SignalRServiceUsageInner.class); - Assertions.assertEquals("vyvdcs", model.id()); - Assertions.assertEquals(6235593202680912824L, model.currentValue()); - Assertions.assertEquals(7516654710743281273L, model.limit()); - Assertions.assertEquals("ectehf", model.name().value()); - Assertions.assertEquals("scjeypv", model.name().localizedValue()); - Assertions.assertEquals("zrkgqhcjrefovg", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SignalRServiceUsageInner model = new SignalRServiceUsageInner().withId("vyvdcs") - .withCurrentValue(6235593202680912824L) - .withLimit(7516654710743281273L) - .withName(new SignalRServiceUsageName().withValue("ectehf").withLocalizedValue("scjeypv")) - .withUnit("zrkgqhcjrefovg"); - model = BinaryData.fromObject(model).toObject(SignalRServiceUsageInner.class); - Assertions.assertEquals("vyvdcs", model.id()); - Assertions.assertEquals(6235593202680912824L, model.currentValue()); - Assertions.assertEquals(7516654710743281273L, model.limit()); - Assertions.assertEquals("ectehf", model.name().value()); - Assertions.assertEquals("scjeypv", model.name().localizedValue()); - Assertions.assertEquals("zrkgqhcjrefovg", model.unit()); + Assertions.assertEquals("kkdmfl", model.id()); + Assertions.assertEquals(3963298330756380L, model.currentValue()); + Assertions.assertEquals(3734568678043826451L, model.limit()); + Assertions.assertEquals("ril", model.name().value()); + Assertions.assertEquals("apeewchpxlkt", model.name().localizedValue()); + Assertions.assertEquals("uziycsl", model.unit()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageListTests.java index 8c1b4a51f51e..b530b7065297 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageListTests.java @@ -1,46 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.SignalRServiceUsageInner; -import com.azure.resourcemanager.webpubsub.models.SignalRServiceUsageList; -import com.azure.resourcemanager.webpubsub.models.SignalRServiceUsageName; -import java.util.Arrays; +import com.azure.resourcemanager.webpubsub.implementation.models.SignalRServiceUsageList; import org.junit.jupiter.api.Assertions; public final class SignalRServiceUsageListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SignalRServiceUsageList model = BinaryData.fromString( - "{\"value\":[{\"id\":\"ndnvo\",\"currentValue\":4292877192766299113,\"limit\":3293446474919179561,\"name\":{\"value\":\"kcglhslaz\",\"localizedValue\":\"yggdtjixh\"},\"unit\":\"uofqwe\"}],\"nextLink\":\"hmenevfyexfwhybc\"}") + "{\"value\":[{\"id\":\"babwidfcxss\",\"currentValue\":8123407983516557660,\"limit\":6931265050892608105,\"name\":{\"value\":\"kxgqddrih\",\"localizedValue\":\"hoqca\"},\"unit\":\"wdaomdjvlpjxxkzb\"},{\"id\":\"sgeivsiy\",\"currentValue\":5582812927114641945,\"limit\":3615112848125243921,\"name\":{\"value\":\"onbzoggculapzwy\",\"localizedValue\":\"gogtqxepnylbf\"},\"unit\":\"jlyjtlvofq\"},{\"id\":\"vfcibyfmowux\",\"currentValue\":4476979116704678050,\"limit\":4461942065391473875,\"name\":{\"value\":\"zwiivwzjbhyzs\",\"localizedValue\":\"rkambt\"},\"unit\":\"egv\"}],\"nextLink\":\"vuqeqvldspast\"}") .toObject(SignalRServiceUsageList.class); - Assertions.assertEquals("ndnvo", model.value().get(0).id()); - Assertions.assertEquals(4292877192766299113L, model.value().get(0).currentValue()); - Assertions.assertEquals(3293446474919179561L, model.value().get(0).limit()); - Assertions.assertEquals("kcglhslaz", model.value().get(0).name().value()); - Assertions.assertEquals("yggdtjixh", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("uofqwe", model.value().get(0).unit()); - Assertions.assertEquals("hmenevfyexfwhybc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SignalRServiceUsageList model - = new SignalRServiceUsageList().withValue(Arrays.asList(new SignalRServiceUsageInner().withId("ndnvo") - .withCurrentValue(4292877192766299113L) - .withLimit(3293446474919179561L) - .withName(new SignalRServiceUsageName().withValue("kcglhslaz").withLocalizedValue("yggdtjixh")) - .withUnit("uofqwe"))).withNextLink("hmenevfyexfwhybc"); - model = BinaryData.fromObject(model).toObject(SignalRServiceUsageList.class); - Assertions.assertEquals("ndnvo", model.value().get(0).id()); - Assertions.assertEquals(4292877192766299113L, model.value().get(0).currentValue()); - Assertions.assertEquals(3293446474919179561L, model.value().get(0).limit()); - Assertions.assertEquals("kcglhslaz", model.value().get(0).name().value()); - Assertions.assertEquals("yggdtjixh", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("uofqwe", model.value().get(0).unit()); - Assertions.assertEquals("hmenevfyexfwhybc", model.nextLink()); + Assertions.assertEquals("babwidfcxss", model.value().get(0).id()); + Assertions.assertEquals(8123407983516557660L, model.value().get(0).currentValue()); + Assertions.assertEquals(6931265050892608105L, model.value().get(0).limit()); + Assertions.assertEquals("kxgqddrih", model.value().get(0).name().value()); + Assertions.assertEquals("hoqca", model.value().get(0).name().localizedValue()); + Assertions.assertEquals("wdaomdjvlpjxxkzb", model.value().get(0).unit()); + Assertions.assertEquals("vuqeqvldspast", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageNameTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageNameTests.java index 6eb0f74ab354..e5c4c9ee9f96 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageNameTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SignalRServiceUsageNameTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,17 +11,10 @@ public final class SignalRServiceUsageNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SignalRServiceUsageName model = BinaryData.fromString("{\"value\":\"qsl\",\"localizedValue\":\"yvxyqjp\"}") - .toObject(SignalRServiceUsageName.class); - Assertions.assertEquals("qsl", model.value()); - Assertions.assertEquals("yvxyqjp", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SignalRServiceUsageName model = new SignalRServiceUsageName().withValue("qsl").withLocalizedValue("yvxyqjp"); - model = BinaryData.fromObject(model).toObject(SignalRServiceUsageName.class); - Assertions.assertEquals("qsl", model.value()); - Assertions.assertEquals("yvxyqjp", model.localizedValue()); + SignalRServiceUsageName model + = BinaryData.fromString("{\"value\":\"ufuztcktyhjtq\",\"localizedValue\":\"cgzulwmmrqzzr\"}") + .toObject(SignalRServiceUsageName.class); + Assertions.assertEquals("ufuztcktyhjtq", model.value()); + Assertions.assertEquals("cgzulwmmrqzzr", model.localizedValue()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuCapacityTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuCapacityTests.java index cb3b46d7f43d..16166f3d1b43 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuCapacityTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuCapacityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,13 +11,7 @@ public final class SkuCapacityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuCapacity model = BinaryData.fromString( - "{\"minimum\":1135591058,\"maximum\":1646739085,\"default\":2041776052,\"allowedValues\":[2017122463],\"scaleType\":\"Automatic\"}") + "{\"minimum\":171079627,\"maximum\":1607958077,\"default\":1469869368,\"allowedValues\":[248286602],\"scaleType\":\"Automatic\"}") .toObject(SkuCapacity.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapacity model = new SkuCapacity(); - model = BinaryData.fromObject(model).toObject(SkuCapacity.class); - } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuListInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuListInnerTests.java index eb58bd44f4c2..108865e62084 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuListInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuListInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,13 +11,7 @@ public final class SkuListInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuListInner model = BinaryData.fromString( - "{\"value\":[{\"resourceType\":\"yjt\",\"sku\":{\"name\":\"of\",\"tier\":\"Standard\",\"size\":\"fcibyfmowuxrkj\",\"family\":\"dwxf\",\"capacity\":2104951545},\"capacity\":{\"minimum\":1157352083,\"maximum\":1754263967,\"default\":779718035,\"allowedValues\":[1253939074,954639384,1858009162,1410890434],\"scaleType\":\"None\"}},{\"resourceType\":\"btrnegvm\",\"sku\":{\"name\":\"uqeqv\",\"tier\":\"Standard\",\"size\":\"astjbkkdmflvestm\",\"family\":\"xrrilozapee\",\"capacity\":1482669533},\"capacity\":{\"minimum\":1353258007,\"maximum\":55990997,\"default\":17628020,\"allowedValues\":[163860242,1984241161,1190990500,463707796],\"scaleType\":\"Manual\"}},{\"resourceType\":\"ufuztcktyhjtq\",\"sku\":{\"name\":\"cgzulwmmrqzzr\",\"tier\":\"Basic\",\"size\":\"gl\",\"family\":\"zgkrvqe\",\"capacity\":1665980983},\"capacity\":{\"minimum\":1014603209,\"maximum\":1266268287,\"default\":108809884,\"allowedValues\":[584463560,2045022432,989782858],\"scaleType\":\"None\"}}],\"nextLink\":\"o\"}") + "{\"value\":[{\"resourceType\":\"ghfkvtvsexs\",\"sku\":{\"name\":\"ueluqhhahhxvrhmz\",\"tier\":\"Standard\",\"size\":\"g\",\"family\":\"spughftqsxhq\",\"capacity\":184918697},\"capacity\":{\"minimum\":649615996,\"maximum\":1485711526,\"default\":2084244471,\"allowedValues\":[1490533084,1889807539,1526695059],\"scaleType\":\"Manual\"}}],\"nextLink\":\"zdmsyqtfi\"}") .toObject(SkuListInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuListInner model = new SkuListInner(); - model = BinaryData.fromObject(model).toObject(SkuListInner.class); - } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuTests.java index 807dd8615857..30ce400ddc14 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/SkuTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,13 +11,7 @@ public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Sku model = BinaryData.fromString( - "{\"resourceType\":\"vf\",\"sku\":{\"name\":\"awzqadfl\",\"tier\":\"Free\",\"size\":\"iglaecx\",\"family\":\"t\",\"capacity\":1510056241},\"capacity\":{\"minimum\":675680646,\"maximum\":635512255,\"default\":2090573911,\"allowedValues\":[412723764,443285023,763019330],\"scaleType\":\"None\"}}") + "{\"resourceType\":\"hbotzingamvppho\",\"sku\":{\"name\":\"qzudphq\",\"tier\":\"Premium\",\"size\":\"kfwynw\",\"family\":\"tbvkayhmtnvyq\",\"capacity\":686807657},\"capacity\":{\"minimum\":348691719,\"maximum\":2073049895,\"default\":180338782,\"allowedValues\":[219155482,813945685,48409211,647378344],\"scaleType\":\"Automatic\"}}") .toObject(Sku.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku(); - model = BinaryData.fromObject(model).toObject(Sku.class); - } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByJwtCustomClaimRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByJwtCustomClaimRuleTests.java new file mode 100644 index 000000000000..0d023b40d53e --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByJwtCustomClaimRuleTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.ThrottleByJwtCustomClaimRule; +import org.junit.jupiter.api.Assertions; + +public final class ThrottleByJwtCustomClaimRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThrottleByJwtCustomClaimRule model = BinaryData + .fromString( + "{\"type\":\"ThrottleByJwtCustomClaimRule\",\"claimName\":\"huopxodlqiynto\",\"maxCount\":1419616379}") + .toObject(ThrottleByJwtCustomClaimRule.class); + Assertions.assertEquals("huopxodlqiynto", model.claimName()); + Assertions.assertEquals(1419616379, model.maxCount()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThrottleByJwtCustomClaimRule model + = new ThrottleByJwtCustomClaimRule().withClaimName("huopxodlqiynto").withMaxCount(1419616379); + model = BinaryData.fromObject(model).toObject(ThrottleByJwtCustomClaimRule.class); + Assertions.assertEquals("huopxodlqiynto", model.claimName()); + Assertions.assertEquals(1419616379, model.maxCount()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByJwtSignatureRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByJwtSignatureRuleTests.java new file mode 100644 index 000000000000..50732a37cc9a --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByJwtSignatureRuleTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.ThrottleByJwtSignatureRule; +import org.junit.jupiter.api.Assertions; + +public final class ThrottleByJwtSignatureRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThrottleByJwtSignatureRule model + = BinaryData.fromString("{\"type\":\"ThrottleByJwtSignatureRule\",\"maxCount\":664543766}") + .toObject(ThrottleByJwtSignatureRule.class); + Assertions.assertEquals(664543766, model.maxCount()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThrottleByJwtSignatureRule model = new ThrottleByJwtSignatureRule().withMaxCount(664543766); + model = BinaryData.fromObject(model).toObject(ThrottleByJwtSignatureRule.class); + Assertions.assertEquals(664543766, model.maxCount()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByUserIdRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByUserIdRuleTests.java new file mode 100644 index 000000000000..40ca22f1eca6 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/ThrottleByUserIdRuleTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.ThrottleByUserIdRule; +import org.junit.jupiter.api.Assertions; + +public final class ThrottleByUserIdRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ThrottleByUserIdRule model + = BinaryData.fromString("{\"type\":\"ThrottleByUserIdRule\",\"maxCount\":1679809360}") + .toObject(ThrottleByUserIdRule.class); + Assertions.assertEquals(1679809360, model.maxCount()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ThrottleByUserIdRule model = new ThrottleByUserIdRule().withMaxCount(1679809360); + model = BinaryData.fromObject(model).toObject(ThrottleByUserIdRule.class); + Assertions.assertEquals(1679809360, model.maxCount()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByJwtCustomClaimRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByJwtCustomClaimRuleTests.java new file mode 100644 index 000000000000..ab7efd1ed275 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByJwtCustomClaimRuleTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.TrafficThrottleByJwtCustomClaimRule; +import org.junit.jupiter.api.Assertions; + +public final class TrafficThrottleByJwtCustomClaimRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrafficThrottleByJwtCustomClaimRule model = BinaryData.fromString( + "{\"type\":\"TrafficThrottleByJwtCustomClaimRule\",\"claimName\":\"sjswsrms\",\"maxInboundMessageBytes\":5698766360721811122,\"aggregationWindowInSeconds\":1849555195}") + .toObject(TrafficThrottleByJwtCustomClaimRule.class); + Assertions.assertEquals("sjswsrms", model.claimName()); + Assertions.assertEquals(5698766360721811122L, model.maxInboundMessageBytes()); + Assertions.assertEquals(1849555195, model.aggregationWindowInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrafficThrottleByJwtCustomClaimRule model = new TrafficThrottleByJwtCustomClaimRule().withClaimName("sjswsrms") + .withMaxInboundMessageBytes(5698766360721811122L) + .withAggregationWindowInSeconds(1849555195); + model = BinaryData.fromObject(model).toObject(TrafficThrottleByJwtCustomClaimRule.class); + Assertions.assertEquals("sjswsrms", model.claimName()); + Assertions.assertEquals(5698766360721811122L, model.maxInboundMessageBytes()); + Assertions.assertEquals(1849555195, model.aggregationWindowInSeconds()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByJwtSignatureRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByJwtSignatureRuleTests.java new file mode 100644 index 000000000000..877f8ba99946 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByJwtSignatureRuleTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.TrafficThrottleByJwtSignatureRule; +import org.junit.jupiter.api.Assertions; + +public final class TrafficThrottleByJwtSignatureRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrafficThrottleByJwtSignatureRule model = BinaryData.fromString( + "{\"type\":\"TrafficThrottleByJwtSignatureRule\",\"maxInboundMessageBytes\":927536476059464125,\"aggregationWindowInSeconds\":922265533}") + .toObject(TrafficThrottleByJwtSignatureRule.class); + Assertions.assertEquals(927536476059464125L, model.maxInboundMessageBytes()); + Assertions.assertEquals(922265533, model.aggregationWindowInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrafficThrottleByJwtSignatureRule model + = new TrafficThrottleByJwtSignatureRule().withMaxInboundMessageBytes(927536476059464125L) + .withAggregationWindowInSeconds(922265533); + model = BinaryData.fromObject(model).toObject(TrafficThrottleByJwtSignatureRule.class); + Assertions.assertEquals(927536476059464125L, model.maxInboundMessageBytes()); + Assertions.assertEquals(922265533, model.aggregationWindowInSeconds()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByUserIdRuleTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByUserIdRuleTests.java new file mode 100644 index 000000000000..3ce2fb8cd2ce --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/TrafficThrottleByUserIdRuleTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.TrafficThrottleByUserIdRule; +import org.junit.jupiter.api.Assertions; + +public final class TrafficThrottleByUserIdRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrafficThrottleByUserIdRule model = BinaryData.fromString( + "{\"type\":\"TrafficThrottleByUserIdRule\",\"maxInboundMessageBytes\":6156800437256073696,\"aggregationWindowInSeconds\":893832741}") + .toObject(TrafficThrottleByUserIdRule.class); + Assertions.assertEquals(6156800437256073696L, model.maxInboundMessageBytes()); + Assertions.assertEquals(893832741, model.aggregationWindowInSeconds()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrafficThrottleByUserIdRule model + = new TrafficThrottleByUserIdRule().withMaxInboundMessageBytes(6156800437256073696L) + .withAggregationWindowInSeconds(893832741); + model = BinaryData.fromObject(model).toObject(TrafficThrottleByUserIdRule.class); + Assertions.assertEquals(6156800437256073696L, model.maxInboundMessageBytes()); + Assertions.assertEquals(893832741, model.aggregationWindowInSeconds()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UpstreamAuthSettingsTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UpstreamAuthSettingsTests.java index 3bf20d6aad1c..6507203df98b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UpstreamAuthSettingsTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UpstreamAuthSettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -14,18 +14,18 @@ public final class UpstreamAuthSettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpstreamAuthSettings model - = BinaryData.fromString("{\"type\":\"None\",\"managedIdentity\":{\"resource\":\"zj\"}}") + = BinaryData.fromString("{\"type\":\"ManagedIdentity\",\"managedIdentity\":{\"resource\":\"usue\"}}") .toObject(UpstreamAuthSettings.class); - Assertions.assertEquals(UpstreamAuthType.NONE, model.type()); - Assertions.assertEquals("zj", model.managedIdentity().resource()); + Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, model.type()); + Assertions.assertEquals("usue", model.managedIdentity().resource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UpstreamAuthSettings model = new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) - .withManagedIdentity(new ManagedIdentitySettings().withResource("zj")); + UpstreamAuthSettings model = new UpstreamAuthSettings().withType(UpstreamAuthType.MANAGED_IDENTITY) + .withManagedIdentity(new ManagedIdentitySettings().withResource("usue")); model = BinaryData.fromObject(model).toObject(UpstreamAuthSettings.class); - Assertions.assertEquals(UpstreamAuthType.NONE, model.type()); - Assertions.assertEquals("zj", model.managedIdentity().resource()); + Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, model.type()); + Assertions.assertEquals("usue", model.managedIdentity().resource()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UsagesListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UsagesListMockTests.java index 61f1fe74c820..21f274b6c9ac 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UsagesListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UsagesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.SignalRServiceUsage; @@ -22,23 +22,23 @@ public final class UsagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"id\":\"sxjb\",\"currentValue\":4851960046016392272,\"limit\":3068254664144085762,\"name\":{\"value\":\"zjqatucoig\",\"localizedValue\":\"xncnwfe\"},\"unit\":\"nwgfmxjgcgbjbgd\"}]}"; + = "{\"value\":[{\"id\":\"rmmuabwibvjo\",\"currentValue\":2678470743225866417,\"limit\":6569320531945702085,\"name\":{\"value\":\"oyzbamwineofvf\",\"localizedValue\":\"kpoldtvevboc\"},\"unit\":\"hzjkn\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.usages().list("uewmrswnjlxuzrhw", com.azure.core.util.Context.NONE); + = manager.usages().list("qwodiffjx", com.azure.core.util.Context.NONE); - Assertions.assertEquals("sxjb", response.iterator().next().id()); - Assertions.assertEquals(4851960046016392272L, response.iterator().next().currentValue()); - Assertions.assertEquals(3068254664144085762L, response.iterator().next().limit()); - Assertions.assertEquals("zjqatucoig", response.iterator().next().name().value()); - Assertions.assertEquals("xncnwfe", response.iterator().next().name().localizedValue()); - Assertions.assertEquals("nwgfmxjgcgbjbgd", response.iterator().next().unit()); + Assertions.assertEquals("rmmuabwibvjo", response.iterator().next().id()); + Assertions.assertEquals(2678470743225866417L, response.iterator().next().currentValue()); + Assertions.assertEquals(6569320531945702085L, response.iterator().next().limit()); + Assertions.assertEquals("oyzbamwineofvf", response.iterator().next().name().value()); + Assertions.assertEquals("kpoldtvevboc", response.iterator().next().name().localizedValue()); + Assertions.assertEquals("hzjkn", response.iterator().next().unit()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UserAssignedIdentityPropertyTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UserAssignedIdentityPropertyTests.java index 174a0c549e83..5c07136519c0 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UserAssignedIdentityPropertyTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/UserAssignedIdentityPropertyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -11,7 +11,7 @@ public final class UserAssignedIdentityPropertyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UserAssignedIdentityProperty model - = BinaryData.fromString("{\"principalId\":\"kghv\",\"clientId\":\"dzwmkrefajpj\"}") + = BinaryData.fromString("{\"principalId\":\"jzkzi\",\"clientId\":\"vvcnayr\"}") .toObject(UserAssignedIdentityProperty.class); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesDeleteWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesDeleteWithResponseMockTests.java index fda9a8490783..942d8bde6fca 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesDeleteWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomCertificatesDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.webPubSubCustomCertificates() - .deleteWithResponse("eg", "amlbnseqacjjvpil", "uooqjagmdit", com.azure.core.util.Context.NONE); + .deleteWithResponse("hzdtxetlgydlh", "vlnnpx", "b", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsDeleteMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsDeleteMockTests.java index 27fcb00e1d91..757cfb09dfb6 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsDeleteMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDelete() throws Exception { WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.webPubSubCustomDomains() - .delete("guaucmfdjwnla", "punj", "ikczvvitacgxmf", com.azure.core.util.Context.NONE); + .delete("ovyrrleaesinu", "tljqobbpih", "hcecybmrqbr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsGetWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsGetWithResponseMockTests.java index fd69b188af0f..85c8c5c6a7c5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsGetWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.CustomDomain; @@ -21,20 +21,20 @@ public final class WebPubSubCustomDomainsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Running\",\"domainName\":\"qogsfikayian\",\"customCertificate\":{\"id\":\"arujt\"}},\"id\":\"qxfzyjqttvwk\",\"name\":\"qhjpenuygbqe\",\"type\":\"qekewvnqvcd\"}"; + = "{\"properties\":{\"provisioningState\":\"Deleting\",\"domainName\":\"gycxnmskwhqjjys\",\"customCertificate\":{\"id\":\"rlpshhkv\"}},\"id\":\"dwqslsrhmpqvw\",\"name\":\"skondcbrwimu\",\"type\":\"qejo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CustomDomain response = manager.webPubSubCustomDomains() - .getWithResponse("jk", "sysidfvclglxnf", "ijtk", com.azure.core.util.Context.NONE) + .getWithResponse("igsxcdgljplk", "ua", "htomflrytswfp", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("qogsfikayian", response.domainName()); - Assertions.assertEquals("arujt", response.customCertificate().id()); + Assertions.assertEquals("gycxnmskwhqjjys", response.domainName()); + Assertions.assertEquals("rlpshhkv", response.customCertificate().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsListMockTests.java index fc27746d4093..bfdaa59a1c1c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubCustomDomainsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.CustomDomain; @@ -22,19 +22,19 @@ public final class WebPubSubCustomDomainsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"domainName\":\"jwabmd\",\"customCertificate\":{\"id\":\"tmvcop\"}},\"id\":\"c\",\"name\":\"jurbuhhlkyqltqsr\",\"type\":\"gtuwkff\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"domainName\":\"ksghudgzhxogjgg\",\"customCertificate\":{\"id\":\"oujkxibdafh\"}},\"id\":\"mdyomkxfbvfbh\",\"name\":\"y\",\"type\":\"rhpw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.webPubSubCustomDomains().list("k", "dirazf", com.azure.core.util.Context.NONE); + = manager.webPubSubCustomDomains().list("bbmpxdlvykfre", "crse", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jwabmd", response.iterator().next().domainName()); - Assertions.assertEquals("tmvcop", response.iterator().next().customCertificate().id()); + Assertions.assertEquals("ksghudgzhxogjgg", response.iterator().next().domainName()); + Assertions.assertEquals("oujkxibdafh", response.iterator().next().customCertificate().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubInnerTests.java index e8cf0b878dfe..d433eea75e96 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubInnerTests.java @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubHubInner; +import com.azure.resourcemanager.webpubsub.models.ChatSettings; import com.azure.resourcemanager.webpubsub.models.EventHandler; import com.azure.resourcemanager.webpubsub.models.EventListener; import com.azure.resourcemanager.webpubsub.models.EventListenerEndpoint; import com.azure.resourcemanager.webpubsub.models.EventListenerFilter; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventFilters; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; import com.azure.resourcemanager.webpubsub.models.ManagedIdentitySettings; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthSettings; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthType; import com.azure.resourcemanager.webpubsub.models.WebPubSubHubProperties; @@ -21,44 +25,57 @@ public final class WebPubSubHubInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WebPubSubHubInner model = BinaryData.fromString( - "{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"ejvegrhbpnaixex\",\"userEventPattern\":\"b\",\"systemEvents\":[\"ax\",\"cexdrrvqa\",\"qkghtpwijnhy\",\"svfycxzbfv\"],\"auth\":{\"type\":\"ManagedIdentity\",\"managedIdentity\":{\"resource\":\"mtg\"}}},{\"urlTemplate\":\"qp\",\"userEventPattern\":\"ostronz\",\"systemEvents\":[\"gfipnsxk\",\"cwaekrrjre\",\"fxtsgum\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{\"resource\":\"kxw\"}}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"bq\",\"webSocketKeepAliveIntervalInSeconds\":878184103},\"id\":\"lmv\",\"name\":\"elfk\",\"type\":\"gplcrpwjxeznoigb\"}") + "{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"qsycbkbfkgu\",\"userEventPattern\":\"kexxppof\",\"systemEvents\":[\"x\",\"fjpgddtocjjxhvp\",\"o\",\"exhd\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{\"resource\":\"ojnxqbzvdd\"}},\"groupPresenceEvents\":{\"eventNames\":[\"joined\",\"left\",\"joined\"],\"groupFilters\":[\"btwnpzaoqvuhrhcf\",\"cyddglmjthjqk\",\"pyeicxm\",\"ciwqvhk\"]}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"igdtopbob\",\"webSocketKeepAliveIntervalInSeconds\":2040578673,\"chat\":{\"mode\":\"e\",\"persistentStorage\":{\"id\":\"m\"}}},\"id\":\"hrzayvvtpgvdf\",\"name\":\"iotkftutqxl\",\"type\":\"gxlefgugnxkrxd\"}") .toObject(WebPubSubHubInner.class); - Assertions.assertEquals("ejvegrhbpnaixex", model.properties().eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("b", model.properties().eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("ax", model.properties().eventHandlers().get(0).systemEvents().get(0)); - Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, - model.properties().eventHandlers().get(0).auth().type()); - Assertions.assertEquals("mtg", model.properties().eventHandlers().get(0).auth().managedIdentity().resource()); - Assertions.assertEquals("bq", model.properties().anonymousConnectPolicy()); - Assertions.assertEquals(878184103, model.properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("qsycbkbfkgu", model.properties().eventHandlers().get(0).urlTemplate()); + Assertions.assertEquals("kexxppof", model.properties().eventHandlers().get(0).userEventPattern()); + Assertions.assertEquals("x", model.properties().eventHandlers().get(0).systemEvents().get(0)); + Assertions.assertEquals(UpstreamAuthType.NONE, model.properties().eventHandlers().get(0).auth().type()); + Assertions.assertEquals("ojnxqbzvdd", + model.properties().eventHandlers().get(0).auth().managedIdentity().resource()); + Assertions.assertEquals(GroupPresenceEventName.JOINED, + model.properties().eventHandlers().get(0).groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("btwnpzaoqvuhrhcf", + model.properties().eventHandlers().get(0).groupPresenceEvents().groupFilters().get(0)); + Assertions.assertEquals("igdtopbob", model.properties().anonymousConnectPolicy()); + Assertions.assertEquals(2040578673, model.properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("e", model.properties().chat().mode()); + Assertions.assertEquals("m", model.properties().chat().persistentStorage().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { WebPubSubHubInner model = new WebPubSubHubInner().withProperties(new WebPubSubHubProperties() - .withEventHandlers(Arrays.asList( - new EventHandler().withUrlTemplate("ejvegrhbpnaixex") - .withUserEventPattern("b") - .withSystemEvents(Arrays.asList("ax", "cexdrrvqa", "qkghtpwijnhy", "svfycxzbfv")) - .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.MANAGED_IDENTITY) - .withManagedIdentity(new ManagedIdentitySettings().withResource("mtg"))), - new EventHandler().withUrlTemplate("qp") - .withUserEventPattern("ostronz") - .withSystemEvents(Arrays.asList("gfipnsxk", "cwaekrrjre", "fxtsgum")) - .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) - .withManagedIdentity(new ManagedIdentitySettings().withResource("kxw"))))) + .withEventHandlers(Arrays.asList(new EventHandler().withUrlTemplate("qsycbkbfkgu") + .withUserEventPattern("kexxppof") + .withSystemEvents(Arrays.asList("x", "fjpgddtocjjxhvp", "o", "exhd")) + .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) + .withManagedIdentity(new ManagedIdentitySettings().withResource("ojnxqbzvdd"))) + .withGroupPresenceEvents(new GroupPresenceEventFilters() + .withEventNames(Arrays.asList(GroupPresenceEventName.JOINED, GroupPresenceEventName.LEFT, + GroupPresenceEventName.JOINED)) + .withGroupFilters(Arrays.asList("btwnpzaoqvuhrhcf", "cyddglmjthjqk", "pyeicxm", "ciwqvhk"))))) .withEventListeners(Arrays.asList( + new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()), + new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()), new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()))) - .withAnonymousConnectPolicy("bq") - .withWebSocketKeepAliveIntervalInSeconds(878184103)); + .withAnonymousConnectPolicy("igdtopbob") + .withWebSocketKeepAliveIntervalInSeconds(2040578673) + .withChat(new ChatSettings().withMode("e").withPersistentStorage(new ResourceReference().withId("m")))); model = BinaryData.fromObject(model).toObject(WebPubSubHubInner.class); - Assertions.assertEquals("ejvegrhbpnaixex", model.properties().eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("b", model.properties().eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("ax", model.properties().eventHandlers().get(0).systemEvents().get(0)); - Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, - model.properties().eventHandlers().get(0).auth().type()); - Assertions.assertEquals("mtg", model.properties().eventHandlers().get(0).auth().managedIdentity().resource()); - Assertions.assertEquals("bq", model.properties().anonymousConnectPolicy()); - Assertions.assertEquals(878184103, model.properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("qsycbkbfkgu", model.properties().eventHandlers().get(0).urlTemplate()); + Assertions.assertEquals("kexxppof", model.properties().eventHandlers().get(0).userEventPattern()); + Assertions.assertEquals("x", model.properties().eventHandlers().get(0).systemEvents().get(0)); + Assertions.assertEquals(UpstreamAuthType.NONE, model.properties().eventHandlers().get(0).auth().type()); + Assertions.assertEquals("ojnxqbzvdd", + model.properties().eventHandlers().get(0).auth().managedIdentity().resource()); + Assertions.assertEquals(GroupPresenceEventName.JOINED, + model.properties().eventHandlers().get(0).groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("btwnpzaoqvuhrhcf", + model.properties().eventHandlers().get(0).groupPresenceEvents().groupFilters().get(0)); + Assertions.assertEquals("igdtopbob", model.properties().anonymousConnectPolicy()); + Assertions.assertEquals(2040578673, model.properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("e", model.properties().chat().mode()); + Assertions.assertEquals("m", model.properties().chat().persistentStorage().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubListTests.java index b7f1c1e6d469..b4c8c310f6ee 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubListTests.java @@ -1,105 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubHubInner; -import com.azure.resourcemanager.webpubsub.models.EventHandler; -import com.azure.resourcemanager.webpubsub.models.EventListener; -import com.azure.resourcemanager.webpubsub.models.EventListenerEndpoint; -import com.azure.resourcemanager.webpubsub.models.EventListenerFilter; -import com.azure.resourcemanager.webpubsub.models.UpstreamAuthSettings; -import com.azure.resourcemanager.webpubsub.models.WebPubSubHubList; -import com.azure.resourcemanager.webpubsub.models.WebPubSubHubProperties; -import java.util.Arrays; +import com.azure.resourcemanager.webpubsub.implementation.models.WebPubSubHubList; import org.junit.jupiter.api.Assertions; public final class WebPubSubHubListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WebPubSubHubList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"syqtfi\",\"userEventPattern\":\"hbotzingamvppho\",\"systemEvents\":[\"zudphqamvdkfw\",\"nwcvtbvkayhmtnv\"],\"auth\":{}},{\"urlTemplate\":\"iatkzwpcnp\",\"userEventPattern\":\"cjaesgvvs\",\"systemEvents\":[\"ajguqf\",\"wygzlvdnkfxusem\",\"wzrmuh\",\"pfcqdp\"],\"auth\":{}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"psvuoymgc\",\"webSocketKeepAliveIntervalInSeconds\":841424592},\"id\":\"ezrypql\",\"name\":\"feo\",\"type\":\"erqwkyhkobopg\"},{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"k\",\"userEventPattern\":\"epbqpcrfkbw\",\"systemEvents\":[\"njv\",\"dw\",\"lpqekf\",\"nkhtjsyingw\"],\"auth\":{}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"tdhtmdvyp\",\"webSocketKeepAliveIntervalInSeconds\":811019553},\"id\":\"gszywk\",\"name\":\"irryuzhlh\",\"type\":\"joqrvqqaatj\"},{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"vgoup\",\"userEventPattern\":\"iibfggj\",\"systemEvents\":[\"lvrwxkvtkk\",\"llqwjygvjayvblmh\"],\"auth\":{}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"bxvvyhg\",\"webSocketKeepAliveIntervalInSeconds\":610233368},\"id\":\"yrqufegxuvwz\",\"name\":\"bnhlmc\",\"type\":\"l\"}],\"nextLink\":\"ngitvgbmhrixkwm\"}") + "{\"value\":[{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"efovgmk\",\"userEventPattern\":\"leyyvx\",\"systemEvents\":[\"pkc\",\"t\",\"pngjcrcczsqpjhvm\"],\"auth\":{},\"groupPresenceEvents\":{\"eventNames\":[]}},{\"urlTemplate\":\"v\",\"userEventPattern\":\"sounqecanoaeu\",\"systemEvents\":[\"yhltrpmopjmcm\"],\"auth\":{},\"groupPresenceEvents\":{\"eventNames\":[]}},{\"urlTemplate\":\"okth\",\"userEventPattern\":\"iuaod\",\"systemEvents\":[\"pk\",\"xodpuozmyzydagfu\"],\"auth\":{},\"groupPresenceEvents\":{\"eventNames\":[]}},{\"urlTemplate\":\"ezyiuokktwhrdxw\",\"userEventPattern\":\"wqsmbsur\",\"systemEvents\":[\"moryocfsfksym\",\"dystkiiuxhqyud\",\"o\",\"rq\"],\"auth\":{},\"groupPresenceEvents\":{\"eventNames\":[]}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"vyifqrvkdvjsl\",\"webSocketKeepAliveIntervalInSeconds\":952204067,\"chat\":{\"mode\":\"d\",\"persistentStorage\":{\"id\":\"t\"}}},\"id\":\"n\",\"name\":\"ulexxbczwtr\",\"type\":\"wiqzbqjvsovmyo\"}],\"nextLink\":\"cspkwlhzdobpxjmf\"}") .toObject(WebPubSubHubList.class); - Assertions.assertEquals("syqtfi", model.value().get(0).properties().eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("hbotzingamvppho", - model.value().get(0).properties().eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("zudphqamvdkfw", - model.value().get(0).properties().eventHandlers().get(0).systemEvents().get(0)); - Assertions.assertEquals("psvuoymgc", model.value().get(0).properties().anonymousConnectPolicy()); - Assertions.assertEquals(841424592, model.value().get(0).properties().webSocketKeepAliveIntervalInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WebPubSubHubList model - = new WebPubSubHubList() - .withValue( - Arrays - .asList( - new WebPubSubHubInner() - .withProperties( - new WebPubSubHubProperties() - .withEventHandlers( - Arrays - .asList( - new EventHandler().withUrlTemplate("syqtfi") - .withUserEventPattern("hbotzingamvppho") - .withSystemEvents( - Arrays.asList("zudphqamvdkfw", "nwcvtbvkayhmtnv")) - .withAuth(new UpstreamAuthSettings()), - new EventHandler().withUrlTemplate("iatkzwpcnp") - .withUserEventPattern("cjaesgvvs") - .withSystemEvents(Arrays.asList("ajguqf", "wygzlvdnkfxusem", - "wzrmuh", "pfcqdp")) - .withAuth(new UpstreamAuthSettings()))) - .withEventListeners(Arrays.asList( - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()), - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()), - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()))) - .withAnonymousConnectPolicy("psvuoymgc") - .withWebSocketKeepAliveIntervalInSeconds(841424592)), - new WebPubSubHubInner() - .withProperties( - new WebPubSubHubProperties() - .withEventHandlers(Arrays.asList(new EventHandler().withUrlTemplate("k") - .withUserEventPattern("epbqpcrfkbw") - .withSystemEvents(Arrays.asList("njv", "dw", "lpqekf", "nkhtjsyingw")) - .withAuth(new UpstreamAuthSettings()))) - .withEventListeners(Arrays.asList( - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()), - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()), - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()), - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()))) - .withAnonymousConnectPolicy("tdhtmdvyp") - .withWebSocketKeepAliveIntervalInSeconds(811019553)), - new WebPubSubHubInner().withProperties(new WebPubSubHubProperties() - .withEventHandlers(Arrays.asList(new EventHandler().withUrlTemplate("vgoup") - .withUserEventPattern("iibfggj") - .withSystemEvents(Arrays.asList("lvrwxkvtkk", "llqwjygvjayvblmh")) - .withAuth(new UpstreamAuthSettings()))) - .withEventListeners(Arrays.asList( - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()), - new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()))) - .withAnonymousConnectPolicy("bxvvyhg") - .withWebSocketKeepAliveIntervalInSeconds(610233368)))); - model = BinaryData.fromObject(model).toObject(WebPubSubHubList.class); - Assertions.assertEquals("syqtfi", model.value().get(0).properties().eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("hbotzingamvppho", - model.value().get(0).properties().eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("zudphqamvdkfw", - model.value().get(0).properties().eventHandlers().get(0).systemEvents().get(0)); - Assertions.assertEquals("psvuoymgc", model.value().get(0).properties().anonymousConnectPolicy()); - Assertions.assertEquals(841424592, model.value().get(0).properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("efovgmk", model.value().get(0).properties().eventHandlers().get(0).urlTemplate()); + Assertions.assertEquals("leyyvx", model.value().get(0).properties().eventHandlers().get(0).userEventPattern()); + Assertions.assertEquals("pkc", model.value().get(0).properties().eventHandlers().get(0).systemEvents().get(0)); + Assertions.assertEquals("vyifqrvkdvjsl", model.value().get(0).properties().anonymousConnectPolicy()); + Assertions.assertEquals(952204067, model.value().get(0).properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("d", model.value().get(0).properties().chat().mode()); + Assertions.assertEquals("t", model.value().get(0).properties().chat().persistentStorage().id()); + Assertions.assertEquals("cspkwlhzdobpxjmf", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubPropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubPropertiesTests.java index f38925fbc38d..1e40732881ee 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubPropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubPropertiesTests.java @@ -1,15 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.webpubsub.models.ChatSettings; import com.azure.resourcemanager.webpubsub.models.EventHandler; import com.azure.resourcemanager.webpubsub.models.EventListener; import com.azure.resourcemanager.webpubsub.models.EventListenerEndpoint; import com.azure.resourcemanager.webpubsub.models.EventListenerFilter; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventFilters; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; import com.azure.resourcemanager.webpubsub.models.ManagedIdentitySettings; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthSettings; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthType; import com.azure.resourcemanager.webpubsub.models.WebPubSubHubProperties; @@ -20,47 +24,56 @@ public final class WebPubSubHubPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WebPubSubHubProperties model = BinaryData.fromString( - "{\"eventHandlers\":[{\"urlTemplate\":\"w\",\"userEventPattern\":\"kpnb\",\"systemEvents\":[\"ejjoqkagfhsxtta\",\"gzxnfaazpxdtnk\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{\"resource\":\"lwuenvrkp\"}}},{\"urlTemplate\":\"ou\",\"userEventPattern\":\"bre\",\"systemEvents\":[\"aysjkixqtnqttez\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{\"resource\":\"akpjpqqmtedlt\"}}},{\"urlTemplate\":\"mjihyeozphv\",\"userEventPattern\":\"uyqncygupkvipmd\",\"systemEvents\":[\"xqupevzhf\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{\"resource\":\"ojujbyp\"}}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"uvhixbjxyfwn\",\"webSocketKeepAliveIntervalInSeconds\":156258046}") + "{\"eventHandlers\":[{\"urlTemplate\":\"dt\",\"userEventPattern\":\"zrvqdr\",\"systemEvents\":[\"jybige\",\"oqfbowskanyk\",\"zlcuiywgqywgndrv\",\"nhzgpphrcgyn\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{\"resource\":\"fvm\"}},\"groupPresenceEvents\":{\"eventNames\":[\"joined\"],\"groupFilters\":[\"xlzevgbmqjqabcy\",\"mivkwlzuvcc\",\"wnfnbacf\"]}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"ebxetqgtzxdp\",\"webSocketKeepAliveIntervalInSeconds\":1802954017,\"chat\":{\"mode\":\"wxrjfeallnwsub\",\"persistentStorage\":{\"id\":\"jampmngnzscxaqw\"}}}") .toObject(WebPubSubHubProperties.class); - Assertions.assertEquals("w", model.eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("kpnb", model.eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("ejjoqkagfhsxtta", model.eventHandlers().get(0).systemEvents().get(0)); + Assertions.assertEquals("dt", model.eventHandlers().get(0).urlTemplate()); + Assertions.assertEquals("zrvqdr", model.eventHandlers().get(0).userEventPattern()); + Assertions.assertEquals("jybige", model.eventHandlers().get(0).systemEvents().get(0)); Assertions.assertEquals(UpstreamAuthType.NONE, model.eventHandlers().get(0).auth().type()); - Assertions.assertEquals("lwuenvrkp", model.eventHandlers().get(0).auth().managedIdentity().resource()); - Assertions.assertEquals("uvhixbjxyfwn", model.anonymousConnectPolicy()); - Assertions.assertEquals(156258046, model.webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("fvm", model.eventHandlers().get(0).auth().managedIdentity().resource()); + Assertions.assertEquals(GroupPresenceEventName.JOINED, + model.eventHandlers().get(0).groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("xlzevgbmqjqabcy", + model.eventHandlers().get(0).groupPresenceEvents().groupFilters().get(0)); + Assertions.assertEquals("ebxetqgtzxdp", model.anonymousConnectPolicy()); + Assertions.assertEquals(1802954017, model.webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("wxrjfeallnwsub", model.chat().mode()); + Assertions.assertEquals("jampmngnzscxaqw", model.chat().persistentStorage().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { WebPubSubHubProperties model = new WebPubSubHubProperties() - .withEventHandlers(Arrays.asList( - new EventHandler().withUrlTemplate("w") - .withUserEventPattern("kpnb") - .withSystemEvents(Arrays.asList("ejjoqkagfhsxtta", "gzxnfaazpxdtnk")) - .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) - .withManagedIdentity(new ManagedIdentitySettings().withResource("lwuenvrkp"))), - new EventHandler().withUrlTemplate("ou") - .withUserEventPattern("bre") - .withSystemEvents(Arrays.asList("aysjkixqtnqttez")) - .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) - .withManagedIdentity(new ManagedIdentitySettings().withResource("akpjpqqmtedlt"))), - new EventHandler().withUrlTemplate("mjihyeozphv") - .withUserEventPattern("uyqncygupkvipmd") - .withSystemEvents(Arrays.asList("xqupevzhf")) - .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) - .withManagedIdentity(new ManagedIdentitySettings().withResource("ojujbyp"))))) + .withEventHandlers(Arrays.asList(new EventHandler().withUrlTemplate("dt") + .withUserEventPattern("zrvqdr") + .withSystemEvents(Arrays.asList("jybige", "oqfbowskanyk", "zlcuiywgqywgndrv", "nhzgpphrcgyn")) + .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) + .withManagedIdentity(new ManagedIdentitySettings().withResource("fvm"))) + .withGroupPresenceEvents( + new GroupPresenceEventFilters().withEventNames(Arrays.asList(GroupPresenceEventName.JOINED)) + .withGroupFilters(Arrays.asList("xlzevgbmqjqabcy", "mivkwlzuvcc", "wnfnbacf"))))) .withEventListeners(Arrays.asList( + new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()), + new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()), + new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()), new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()))) - .withAnonymousConnectPolicy("uvhixbjxyfwn") - .withWebSocketKeepAliveIntervalInSeconds(156258046); + .withAnonymousConnectPolicy("ebxetqgtzxdp") + .withWebSocketKeepAliveIntervalInSeconds(1802954017) + .withChat(new ChatSettings().withMode("wxrjfeallnwsub") + .withPersistentStorage(new ResourceReference().withId("jampmngnzscxaqw"))); model = BinaryData.fromObject(model).toObject(WebPubSubHubProperties.class); - Assertions.assertEquals("w", model.eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("kpnb", model.eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("ejjoqkagfhsxtta", model.eventHandlers().get(0).systemEvents().get(0)); + Assertions.assertEquals("dt", model.eventHandlers().get(0).urlTemplate()); + Assertions.assertEquals("zrvqdr", model.eventHandlers().get(0).userEventPattern()); + Assertions.assertEquals("jybige", model.eventHandlers().get(0).systemEvents().get(0)); Assertions.assertEquals(UpstreamAuthType.NONE, model.eventHandlers().get(0).auth().type()); - Assertions.assertEquals("lwuenvrkp", model.eventHandlers().get(0).auth().managedIdentity().resource()); - Assertions.assertEquals("uvhixbjxyfwn", model.anonymousConnectPolicy()); - Assertions.assertEquals(156258046, model.webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("fvm", model.eventHandlers().get(0).auth().managedIdentity().resource()); + Assertions.assertEquals(GroupPresenceEventName.JOINED, + model.eventHandlers().get(0).groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("xlzevgbmqjqabcy", + model.eventHandlers().get(0).groupPresenceEvents().groupFilters().get(0)); + Assertions.assertEquals("ebxetqgtzxdp", model.anonymousConnectPolicy()); + Assertions.assertEquals(1802954017, model.webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("wxrjfeallnwsub", model.chat().mode()); + Assertions.assertEquals("jampmngnzscxaqw", model.chat().persistentStorage().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsCreateOrUpdateMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsCreateOrUpdateMockTests.java index 5d7f12e1b838..2ad810b37575 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsCreateOrUpdateMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsCreateOrUpdateMockTests.java @@ -1,20 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; +import com.azure.resourcemanager.webpubsub.models.ChatSettings; import com.azure.resourcemanager.webpubsub.models.EventHandler; import com.azure.resourcemanager.webpubsub.models.EventListener; import com.azure.resourcemanager.webpubsub.models.EventListenerEndpoint; import com.azure.resourcemanager.webpubsub.models.EventListenerFilter; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventFilters; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; import com.azure.resourcemanager.webpubsub.models.ManagedIdentitySettings; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthSettings; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthType; import com.azure.resourcemanager.webpubsub.models.WebPubSubHub; @@ -30,36 +34,78 @@ public final class WebPubSubHubsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"rmfsvbpav\",\"userEventPattern\":\"pfppd\",\"systemEvents\":[\"upgahxkum\",\"sjcaacfdmmcpugm\",\"hqepvufhbzehewh\"],\"auth\":{\"type\":\"ManagedIdentity\",\"managedIdentity\":{}}},{\"urlTemplate\":\"bqnbl\",\"userEventPattern\":\"eaclgschorimk\",\"systemEvents\":[\"rmoucsofl\"],\"auth\":{\"type\":\"ManagedIdentity\",\"managedIdentity\":{}}},{\"urlTemplate\":\"yfcaabeolhbhlvbm\",\"userEventPattern\":\"qi\",\"systemEvents\":[\"tkcudfbsfarfsiow\",\"kjxnqpvwgfstmhq\",\"kizmdksaoafclu\"],\"auth\":{\"type\":\"ManagedIdentity\",\"managedIdentity\":{}}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"im\",\"webSocketKeepAliveIntervalInSeconds\":614051045},\"id\":\"gc\",\"name\":\"wpbmzgwesydsxwef\",\"type\":\"hecbvopwndyq\"}"; + = "{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"qgsjjxun\",\"userEventPattern\":\"gketwzhhzjhf\",\"systemEvents\":[\"vvmu\",\"gpmuneqsxvmhfbuz\",\"yihsasbhudypohyu\"],\"auth\":{\"type\":\"ManagedIdentity\",\"managedIdentity\":{}},\"groupPresenceEvents\":{\"eventNames\":[\"joined\"],\"groupFilters\":[\"pfoobr\",\"ttymsjny\"]}},{\"urlTemplate\":\"qdnfwqzdz\",\"userEventPattern\":\"ilaxhn\",\"systemEvents\":[\"lyvijouwiv\",\"xoyzunbix\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{}},\"groupPresenceEvents\":{\"eventNames\":[\"left\",\"left\"],\"groupFilters\":[\"clrcivtsox\",\"rkenx\"]}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"efrp\",\"webSocketKeepAliveIntervalInSeconds\":1642527126,\"chat\":{\"mode\":\"qskaw\",\"persistentStorage\":{\"id\":\"vmm\"}}},\"id\":\"pqfrtqlkz\",\"name\":\"egnitg\",\"type\":\"kxlzyqdrfeg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WebPubSubHub response = manager.webPubSubHubs() - .define("o") - .withExistingWebPubSub("uxvnsasbcrymodi", "rxklobdxnazpmk") + .define("kvyklxubyjaffmm") + .withExistingWebPubSub("cvhrfsp", "uagrttikteusqc") .withProperties(new WebPubSubHubProperties() - .withEventHandlers(Arrays.asList(new EventHandler().withUrlTemplate("vevfxz") - .withUserEventPattern("jhbzxliohrdddtf") - .withSystemEvents(Arrays.asList("ba", "pcbbnzqcykna", "qofyuicdhzbdy", "wwgbdv")) - .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) - .withManagedIdentity(new ManagedIdentitySettings())))) - .withEventListeners(Arrays.asList(new EventListener().withFilter(new EventListenerFilter()) - .withEndpoint(new EventListenerEndpoint()))) - .withAnonymousConnectPolicy("ffplfmuvapckcc") - .withWebSocketKeepAliveIntervalInSeconds(643996998)) + .withEventHandlers(Arrays.asList( + new EventHandler().withUrlTemplate("cqc") + .withUserEventPattern("bgq") + .withSystemEvents(Arrays.asList("talmett", "wgdsl")) + .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.MANAGED_IDENTITY) + .withManagedIdentity(new ManagedIdentitySettings())) + .withGroupPresenceEvents( + new GroupPresenceEventFilters().withEventNames(Arrays.asList(GroupPresenceEventName.LEFT)) + .withGroupFilters(Arrays.asList("z"))), + new EventHandler().withUrlTemplate("seypxiutcxapz") + .withUserEventPattern("rpetogebjoxsl") + .withSystemEvents(Arrays.asList("hlabrq")) + .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.NONE) + .withManagedIdentity(new ManagedIdentitySettings())) + .withGroupPresenceEvents( + new GroupPresenceEventFilters().withEventNames(Arrays.asList(GroupPresenceEventName.JOINED)) + .withGroupFilters( + Arrays.asList("gaehvvibrxjjst", "qbeitpkxztmoob", "lftidgfcwqmpim", "qxzhem"))), + new EventHandler().withUrlTemplate("yhohujswtwkozzwc") + .withUserEventPattern("kb") + .withSystemEvents(Arrays.asList("fajnjwltlwtjjguk", "alhsnvkc", "mxzrpoa", "mlnwiaaomylweazu")) + .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.MANAGED_IDENTITY) + .withManagedIdentity(new ManagedIdentitySettings())) + .withGroupPresenceEvents(new GroupPresenceEventFilters() + .withEventNames(Arrays.asList(GroupPresenceEventName.LEFT, GroupPresenceEventName.LEFT)) + .withGroupFilters(Arrays.asList("hlf", "swpchwahfbousn", "epgfew", "twly"))), + new EventHandler().withUrlTemplate("gncxykxhdj") + .withUserEventPattern("immbcx") + .withSystemEvents(Arrays.asList("cporxvxcjz", "qizxfpxtgqscjavf", "juhdqazkmtgguwpi", "r")) + .withAuth(new UpstreamAuthSettings().withType(UpstreamAuthType.MANAGED_IDENTITY) + .withManagedIdentity(new ManagedIdentitySettings())) + .withGroupPresenceEvents(new GroupPresenceEventFilters() + .withEventNames(Arrays.asList(GroupPresenceEventName.LEFT, GroupPresenceEventName.JOINED, + GroupPresenceEventName.JOINED, GroupPresenceEventName.JOINED)) + .withGroupFilters(Arrays.asList("wrxgkneuvy", "nzqodfvpg"))))) + .withEventListeners(Arrays.asList( + new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()), + new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()), + new EventListener().withFilter(new EventListenerFilter()).withEndpoint(new EventListenerEndpoint()), + new EventListener().withFilter(new EventListenerFilter()) + .withEndpoint(new EventListenerEndpoint()))) + .withAnonymousConnectPolicy("gsgbpfgzdjt") + .withWebSocketKeepAliveIntervalInSeconds(1656349594) + .withChat(new ChatSettings().withMode("bqvgaqv") + .withPersistentStorage(new ResourceReference().withId("fcq")))) .create(); - Assertions.assertEquals("rmfsvbpav", response.properties().eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("pfppd", response.properties().eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("upgahxkum", response.properties().eventHandlers().get(0).systemEvents().get(0)); + Assertions.assertEquals("qgsjjxun", response.properties().eventHandlers().get(0).urlTemplate()); + Assertions.assertEquals("gketwzhhzjhf", response.properties().eventHandlers().get(0).userEventPattern()); + Assertions.assertEquals("vvmu", response.properties().eventHandlers().get(0).systemEvents().get(0)); Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, response.properties().eventHandlers().get(0).auth().type()); - Assertions.assertEquals("im", response.properties().anonymousConnectPolicy()); - Assertions.assertEquals(614051045, response.properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals(GroupPresenceEventName.JOINED, + response.properties().eventHandlers().get(0).groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("pfoobr", + response.properties().eventHandlers().get(0).groupPresenceEvents().groupFilters().get(0)); + Assertions.assertEquals("efrp", response.properties().anonymousConnectPolicy()); + Assertions.assertEquals(1642527126, response.properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("qskaw", response.properties().chat().mode()); + Assertions.assertEquals("vmm", response.properties().chat().persistentStorage().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsDeleteMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsDeleteMockTests.java index d2ee16d50285..dbb8eef79b2c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsDeleteMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDelete() throws Exception { WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.webPubSubHubs() - .delete("ytxzvtznapxbanno", "voxczytpr", "nwvroevytlyokrr", com.azure.core.util.Context.NONE); + manager.webPubSubHubs().delete("nzeyqxtjj", "zqlqhyc", "vodggxdbee", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsGetWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsGetWithResponseMockTests.java index 7657e48e5be9..53dc4427d3c5 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsGetWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsGetWithResponseMockTests.java @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthType; import com.azure.resourcemanager.webpubsub.models.WebPubSubHub; import java.nio.charset.StandardCharsets; @@ -22,25 +23,30 @@ public final class WebPubSubHubsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"urfqkfuare\",\"userEventPattern\":\"vhhtklnvnaf\",\"systemEvents\":[\"yfedevjbo\",\"lcqxypokk\"],\"auth\":{\"type\":\"ManagedIdentity\",\"managedIdentity\":{}}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"czngnbdxxe\",\"webSocketKeepAliveIntervalInSeconds\":1211103053},\"id\":\"nvudbchaqdtvqecr\",\"name\":\"ct\",\"type\":\"xxdtddmflh\"}"; + = "{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"brn\",\"userEventPattern\":\"u\",\"systemEvents\":[\"rafwgckhocxvdf\",\"fwafqrouda\",\"pavehhr\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{}},\"groupPresenceEvents\":{\"eventNames\":[\"joined\"],\"groupFilters\":[\"hcxgkmoyx\",\"dyuib\",\"mfdn\"]}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"vfvfcj\",\"webSocketKeepAliveIntervalInSeconds\":640278837,\"chat\":{\"mode\":\"srvhmgorffuki\",\"persistentStorage\":{\"id\":\"w\"}}},\"id\":\"hwplefaxvx\",\"name\":\"l\",\"type\":\"btgn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WebPubSubHub response = manager.webPubSubHubs() - .getWithResponse("xhpdulontacnpqwt", "htuevrhrljy", "ogwxhnsduugwb", com.azure.core.util.Context.NONE) + .getWithResponse("hihfrbbcevqagtlt", "hlfkqojpy", "vgtrdcnifmzzs", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("urfqkfuare", response.properties().eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("vhhtklnvnaf", response.properties().eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("yfedevjbo", response.properties().eventHandlers().get(0).systemEvents().get(0)); - Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, - response.properties().eventHandlers().get(0).auth().type()); - Assertions.assertEquals("czngnbdxxe", response.properties().anonymousConnectPolicy()); - Assertions.assertEquals(1211103053, response.properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("brn", response.properties().eventHandlers().get(0).urlTemplate()); + Assertions.assertEquals("u", response.properties().eventHandlers().get(0).userEventPattern()); + Assertions.assertEquals("rafwgckhocxvdf", response.properties().eventHandlers().get(0).systemEvents().get(0)); + Assertions.assertEquals(UpstreamAuthType.NONE, response.properties().eventHandlers().get(0).auth().type()); + Assertions.assertEquals(GroupPresenceEventName.JOINED, + response.properties().eventHandlers().get(0).groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("hcxgkmoyx", + response.properties().eventHandlers().get(0).groupPresenceEvents().groupFilters().get(0)); + Assertions.assertEquals("vfvfcj", response.properties().anonymousConnectPolicy()); + Assertions.assertEquals(640278837, response.properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("srvhmgorffuki", response.properties().chat().mode()); + Assertions.assertEquals("w", response.properties().chat().persistentStorage().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsListMockTests.java index 812b055c6462..05897f5d1e34 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubHubsListMockTests.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; +import com.azure.resourcemanager.webpubsub.models.GroupPresenceEventName; import com.azure.resourcemanager.webpubsub.models.UpstreamAuthType; import com.azure.resourcemanager.webpubsub.models.WebPubSubHub; import java.nio.charset.StandardCharsets; @@ -23,27 +24,33 @@ public final class WebPubSubHubsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"u\",\"userEventPattern\":\"nchrszizoyu\",\"systemEvents\":[\"etndnbfqyggagf\",\"nlgmtrwahzjmu\"],\"auth\":{\"type\":\"ManagedIdentity\",\"managedIdentity\":{}}},{\"urlTemplate\":\"r\",\"userEventPattern\":\"rohkpigqfusu\",\"systemEvents\":[\"mkwkl\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{}}},{\"urlTemplate\":\"xmqeqalh\",\"userEventPattern\":\"nhg\",\"systemEvents\":[\"yynfsvkhgbv\",\"ta\",\"arfdlpukhpyrnei\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{}}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"hnmgbroux\",\"webSocketKeepAliveIntervalInSeconds\":1093469503},\"id\":\"fhp\",\"name\":\"paz\",\"type\":\"zoyw\"}]}"; + = "{\"value\":[{\"properties\":{\"eventHandlers\":[{\"urlTemplate\":\"yr\",\"userEventPattern\":\"iagtc\",\"systemEvents\":[\"cqwogfnzjvusfzl\",\"mozuxylfsb\",\"kadpysown\",\"tgkbugrjqctojc\"],\"auth\":{\"type\":\"None\",\"managedIdentity\":{}},\"groupPresenceEvents\":{\"eventNames\":[\"left\",\"joined\",\"left\"],\"groupFilters\":[\"jy\",\"dh\",\"u\",\"lcplc\"]}}],\"eventListeners\":[{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}},{\"filter\":{\"type\":\"EventListenerFilter\"},\"endpoint\":{\"type\":\"EventListenerEndpoint\"}}],\"anonymousConnectPolicy\":\"hihlhzdsqtzbs\",\"webSocketKeepAliveIntervalInSeconds\":1050448632,\"chat\":{\"mode\":\"cjhfgmvecactxmw\",\"persistentStorage\":{\"id\":\"yowc\"}}},\"id\":\"qovekqvgqou\",\"name\":\"ifzmpjwyivqi\",\"type\":\"f\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.webPubSubHubs().list("sserxhtvsoxhlwn", "sjgqrsxyp", com.azure.core.util.Context.NONE); + = manager.webPubSubHubs().list("mieknlraria", "wiuagydwqf", com.azure.core.util.Context.NONE); - Assertions.assertEquals("u", response.iterator().next().properties().eventHandlers().get(0).urlTemplate()); - Assertions.assertEquals("nchrszizoyu", + Assertions.assertEquals("yr", response.iterator().next().properties().eventHandlers().get(0).urlTemplate()); + Assertions.assertEquals("iagtc", response.iterator().next().properties().eventHandlers().get(0).userEventPattern()); - Assertions.assertEquals("etndnbfqyggagf", + Assertions.assertEquals("cqwogfnzjvusfzl", response.iterator().next().properties().eventHandlers().get(0).systemEvents().get(0)); - Assertions.assertEquals(UpstreamAuthType.MANAGED_IDENTITY, + Assertions.assertEquals(UpstreamAuthType.NONE, response.iterator().next().properties().eventHandlers().get(0).auth().type()); - Assertions.assertEquals("hnmgbroux", response.iterator().next().properties().anonymousConnectPolicy()); - Assertions.assertEquals(1093469503, + Assertions.assertEquals(GroupPresenceEventName.LEFT, + response.iterator().next().properties().eventHandlers().get(0).groupPresenceEvents().eventNames().get(0)); + Assertions.assertEquals("jy", + response.iterator().next().properties().eventHandlers().get(0).groupPresenceEvents().groupFilters().get(0)); + Assertions.assertEquals("hihlhzdsqtzbs", response.iterator().next().properties().anonymousConnectPolicy()); + Assertions.assertEquals(1050448632, response.iterator().next().properties().webSocketKeepAliveIntervalInSeconds()); + Assertions.assertEquals("cjhfgmvecactxmw", response.iterator().next().properties().chat().mode()); + Assertions.assertEquals("yowc", response.iterator().next().properties().chat().persistentStorage().id()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubNetworkACLsTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubNetworkACLsTests.java index 38edfff4d8b5..016a20a35bec 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubNetworkACLsTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubNetworkACLsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -18,15 +18,15 @@ public final class WebPubSubNetworkACLsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WebPubSubNetworkACLs model = BinaryData.fromString( - "{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"Trace\",\"RESTAPI\",\"ServerConnection\",\"ClientConnection\"],\"deny\":[\"Trace\",\"RESTAPI\",\"ServerConnection\",\"ServerConnection\"]},\"privateEndpoints\":[{\"name\":\"nswhcc\",\"allow\":[\"ServerConnection\"],\"deny\":[\"RESTAPI\",\"Trace\",\"Trace\",\"ServerConnection\"]},{\"name\":\"qscywu\",\"allow\":[\"RESTAPI\",\"ServerConnection\",\"RESTAPI\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"ClientConnection\"]}],\"ipRules\":[{\"value\":\"ai\",\"action\":\"Allow\"},{\"value\":\"gzd\",\"action\":\"Allow\"},{\"value\":\"eypqwdxggicccn\",\"action\":\"Allow\"},{\"value\":\"exmk\",\"action\":\"Deny\"}]}") + "{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"ServerConnection\",\"Trace\",\"ClientConnection\"],\"deny\":[\"ClientConnection\"]},\"privateEndpoints\":[{\"name\":\"pichkoymkcdy\",\"allow\":[\"Trace\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"RESTAPI\",\"RESTAPI\",\"ClientConnection\"]},{\"name\":\"novvqfovljxy\",\"allow\":[\"ClientConnection\",\"Trace\",\"ClientConnection\",\"Trace\"],\"deny\":[\"RESTAPI\",\"RESTAPI\",\"Trace\"]}],\"ipRules\":[{\"value\":\"dgvraeaeneq\",\"action\":\"Allow\"}]}") .toObject(WebPubSubNetworkACLs.class); Assertions.assertEquals(AclAction.DENY, model.defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.TRACE, model.publicNetwork().allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.TRACE, model.publicNetwork().deny().get(0)); - Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.privateEndpoints().get(0).allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.publicNetwork().allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.publicNetwork().deny().get(0)); + Assertions.assertEquals(WebPubSubRequestType.TRACE, model.privateEndpoints().get(0).allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.RESTAPI, model.privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("nswhcc", model.privateEndpoints().get(0).name()); - Assertions.assertEquals("ai", model.ipRules().get(0).value()); + Assertions.assertEquals("pichkoymkcdy", model.privateEndpoints().get(0).name()); + Assertions.assertEquals("dgvraeaeneq", model.ipRules().get(0).value()); Assertions.assertEquals(AclAction.ALLOW, model.ipRules().get(0).action()); } @@ -34,32 +34,30 @@ public void testDeserialize() throws Exception { public void testSerialize() throws Exception { WebPubSubNetworkACLs model = new WebPubSubNetworkACLs().withDefaultAction(AclAction.DENY) .withPublicNetwork(new NetworkAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.RESTAPI, - WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.CLIENT_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.RESTAPI, - WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.SERVER_CONNECTION))) + .withAllow(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.TRACE, + WebPubSubRequestType.CLIENT_CONNECTION)) + .withDeny(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION))) .withPrivateEndpoints(Arrays.asList( - new PrivateEndpointAcl().withAllow(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.TRACE, - WebPubSubRequestType.TRACE, WebPubSubRequestType.SERVER_CONNECTION)) - .withName("nswhcc"), new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.SERVER_CONNECTION, + .withAllow(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.CLIENT_CONNECTION)) + .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI, WebPubSubRequestType.CLIENT_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.CLIENT_CONNECTION)) - .withName("qscywu"))) - .withIpRules(Arrays.asList(new IpRule().withValue("ai").withAction(AclAction.ALLOW), - new IpRule().withValue("gzd").withAction(AclAction.ALLOW), - new IpRule().withValue("eypqwdxggicccn").withAction(AclAction.ALLOW), - new IpRule().withValue("exmk").withAction(AclAction.DENY))); + .withName("pichkoymkcdy"), + new PrivateEndpointAcl() + .withAllow(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.TRACE, + WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.TRACE)) + .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI, + WebPubSubRequestType.TRACE)) + .withName("novvqfovljxy"))) + .withIpRules(Arrays.asList(new IpRule().withValue("dgvraeaeneq").withAction(AclAction.ALLOW))); model = BinaryData.fromObject(model).toObject(WebPubSubNetworkACLs.class); Assertions.assertEquals(AclAction.DENY, model.defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.TRACE, model.publicNetwork().allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.TRACE, model.publicNetwork().deny().get(0)); - Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.privateEndpoints().get(0).allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.publicNetwork().allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.publicNetwork().deny().get(0)); + Assertions.assertEquals(WebPubSubRequestType.TRACE, model.privateEndpoints().get(0).allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.RESTAPI, model.privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("nswhcc", model.privateEndpoints().get(0).name()); - Assertions.assertEquals("ai", model.ipRules().get(0).value()); + Assertions.assertEquals("pichkoymkcdy", model.privateEndpoints().get(0).name()); + Assertions.assertEquals("dgvraeaeneq", model.ipRules().get(0).value()); Assertions.assertEquals(AclAction.ALLOW, model.ipRules().get(0).action()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesCreateOrUpdateMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..f99c4ff9f919 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesCreateOrUpdateMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.webpubsub.WebPubSubManager; +import com.azure.resourcemanager.webpubsub.models.PersistentStorage; +import com.azure.resourcemanager.webpubsub.models.ResourceReference; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WebPubSubPersistentStoragesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"storageAccount\":{\"id\":\"xbulpzealbmqkyo\"}},\"id\":\"yvfkmbts\",\"name\":\"ahxsgxjcmm\",\"type\":\"rrscubiwsdrnp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + WebPubSubManager manager = WebPubSubManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PersistentStorage response = manager.webPubSubPersistentStorages() + .define("hulrtywikdmhla") + .withExistingWebPubSub("c", "v") + .withStorageAccount(new ResourceReference().withId("gbhgau")) + .create(); + + Assertions.assertEquals("xbulpzealbmqkyo", response.storageAccount().id()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesGetWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesGetWithResponseMockTests.java new file mode 100644 index 000000000000..40093ef95609 --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.webpubsub.WebPubSubManager; +import com.azure.resourcemanager.webpubsub.models.PersistentStorage; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WebPubSubPersistentStoragesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Creating\",\"storageAccount\":{\"id\":\"tbsjuscvsf\"}},\"id\":\"gctmgxuupbezq\",\"name\":\"cydrtceukdqkk\",\"type\":\"ihztgeqmgqzgwldo\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + WebPubSubManager manager = WebPubSubManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PersistentStorage response = manager.webPubSubPersistentStorages() + .getWithResponse("maonurj", "umghihpvecmsl", "lbl", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("tbsjuscvsf", response.storageAccount().id()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesListMockTests.java new file mode 100644 index 000000000000..0ed103c1ec0f --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPersistentStoragesListMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.webpubsub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.webpubsub.WebPubSubManager; +import com.azure.resourcemanager.webpubsub.models.PersistentStorage; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WebPubSubPersistentStoragesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Moving\",\"storageAccount\":{\"id\":\"zstacsjvhrweft\"}},\"id\":\"qejpmvssehaepwa\",\"name\":\"cxtczhupeukn\",\"type\":\"jduyyespydjfb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + WebPubSubManager manager = WebPubSubManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.webPubSubPersistentStorages().list("chillcecf", "huwaoaguhic", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("zstacsjvhrweft", response.iterator().next().storageAccount().id()); + } +} diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsDeleteMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsDeleteMockTests.java index e2c55a36d7d5..c27555442088 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsDeleteMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDelete() throws Exception { WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.webPubSubPrivateEndpointConnections() - .delete("tlhguynuchl", "mltx", "whmozusgzvlnsnnj", com.azure.core.util.Context.NONE); + .delete("ulwgniiprglvawuw", "d", "fypiv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsGetWithResponseMockTests.java index ef89d85bee03..5f0a306c9a7b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsGetWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.PrivateEndpointConnection; @@ -22,23 +22,23 @@ public final class WebPubSubPrivateEndpointConnectionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Running\",\"privateEndpoint\":{\"id\":\"zudnigrfiho\"},\"groupIds\":[\"wlpxuzzjg\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"yhqotoihiqakydi\",\"actionsRequired\":\"brkwpzdqt\"}},\"id\":\"cspodaqax\",\"name\":\"ipietgbe\",\"type\":\"jfulbmoic\"}"; + = "{\"properties\":{\"provisioningState\":\"Moving\",\"privateEndpoint\":{\"id\":\"snsqowxwcoml\"},\"groupIds\":[\"twvc\",\"cswkacvejy\",\"dvlvhbwrnfxtgdd\",\"qthe\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"oya\",\"actionsRequired\":\"coeqswankltytm\"}},\"id\":\"roznnhdrlktgj\",\"name\":\"sggux\",\"type\":\"eml\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnection response = manager.webPubSubPrivateEndpointConnections() - .getWithResponse("memczjkmmyk", "ujxsglhsr", "rye", com.azure.core.util.Context.NONE) + .getWithResponse("gddeimaw", "o", "gkkumuikjcj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("zudnigrfiho", response.privateEndpoint().id()); + Assertions.assertEquals("snsqowxwcoml", response.privateEndpoint().id()); Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("yhqotoihiqakydi", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("brkwpzdqt", response.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("oya", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("coeqswankltytm", response.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsListMockTests.java index f2bfa5c649fe..e5840853dc00 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.PrivateEndpointConnection; @@ -23,24 +23,23 @@ public final class WebPubSubPrivateEndpointConnectionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"privateEndpoint\":{\"id\":\"zfhotlh\"},\"groupIds\":[\"yych\",\"nsjlpjrtws\",\"hv\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"hvtrrmhwrbfdpyf\",\"actionsRequired\":\"bhvjglr\"}},\"id\":\"uyzlw\",\"name\":\"hmem\",\"type\":\"ooclutnp\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"mhbrbqgvg\"},\"groupIds\":[\"bbttefjo\",\"nssqyzqed\",\"kdfrdbiqmrjgeihf\",\"lg\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"zcxmjpbyep\",\"actionsRequired\":\"gt\"}},\"id\":\"j\",\"name\":\"rc\",\"type\":\"yfqi\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.webPubSubPrivateEndpointConnections() - .list("eallklmtkhlo", "kxxpvbrd", com.azure.core.util.Context.NONE); + .list("sbbjpmcu", "kmifoxxkub", com.azure.core.util.Context.NONE); - Assertions.assertEquals("zfhotlh", response.iterator().next().privateEndpoint().id()); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, + Assertions.assertEquals("mhbrbqgvg", response.iterator().next().privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hvtrrmhwrbfdpyf", + Assertions.assertEquals("zcxmjpbyep", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("bhvjglr", - response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("gt", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsUpdateWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsUpdateWithResponseMockTests.java index 13684c3d4c4f..25e43480faf9 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsUpdateWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateEndpointConnectionsUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.fluent.models.PrivateEndpointConnectionInner; @@ -25,31 +25,30 @@ public final class WebPubSubPrivateEndpointConnectionsUpdateWithResponseMockTest @Test public void testUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"llfojuidjp\"},\"groupIds\":[\"jucejikzoeovvtz\",\"je\",\"jklntikyj\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"qzolxrzvhqjw\",\"actionsRequired\":\"htgv\"}},\"id\":\"pcrrk\",\"name\":\"lawjmjsmwrok\",\"type\":\"dxfzzzwyjaf\"}"; + = "{\"properties\":{\"provisioningState\":\"Unknown\",\"privateEndpoint\":{\"id\":\"rtspphkixkykxds\"},\"groupIds\":[\"emmucfxh\",\"kkflrmymyincqlhr\",\"s\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"iiovgqcgxu\",\"actionsRequired\":\"qkctotiowlxte\"}},\"id\":\"ptjgwdt\",\"name\":\"ukranblw\",\"type\":\"hqlkccuzgygqwaho\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnection response = manager.webPubSubPrivateEndpointConnections() - .updateWithResponse("dlpnfpubn", "nbatzvi", "sowsaael", - new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint().withId("uhplrvkmjcwmjv")) + .updateWithResponse("ywaeeczgf", "ukklelss", "blycsxzujksr", + new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("qplpvmjc")) .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) - .withDescription("rzbjpsfxsfuz") - .withActionsRequired("vtmva")), + .withStatus(PrivateLinkServiceConnectionStatus.PENDING) + .withDescription("c") + .withActionsRequired("xw")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("llfojuidjp", response.privateEndpoint().id()); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, + Assertions.assertEquals("rtspphkixkykxds", response.privateEndpoint().id()); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.PENDING, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qzolxrzvhqjw", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("htgv", response.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("iiovgqcgxu", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("qkctotiowlxte", response.privateLinkServiceConnectionState().actionsRequired()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateLinkResourcesListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateLinkResourcesListMockTests.java index e4a7e84382aa..287c7dd6f48b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateLinkResourcesListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPrivateLinkResourcesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.PrivateLinkResource; @@ -22,28 +22,27 @@ public final class WebPubSubPrivateLinkResourcesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"phtvdu\",\"requiredMembers\":[\"vl\",\"jchcsrlzknmzla\"],\"requiredZoneNames\":[\"pdwvnphcn\",\"q\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"mqrhvthl\",\"properties\":{\"description\":\"dcxsmlz\",\"groupId\":\"zdtxetlgyd\",\"type\":\"qvlnnpxybafiqgea\"}},{\"name\":\"bgj\",\"properties\":{\"description\":\"lklbyulidw\",\"groupId\":\"vmzegj\",\"type\":\"fhjirwgdnqzbrfk\"}},{\"name\":\"zhzmtksjci\",\"properties\":{\"description\":\"gsxcdgljplkeua\",\"groupId\":\"tomflrytswfpf\",\"type\":\"gycxnmskwhqjjys\"}}]},\"id\":\"rlpshhkv\",\"name\":\"edwqslsrh\",\"type\":\"pq\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"vgzpcrrkolawj\",\"requiredMembers\":[\"mwrokcdxfzzzwyja\"],\"requiredZoneNames\":[\"lhguyn\",\"chl\",\"mltx\"],\"shareablePrivateLinkResourceTypes\":[{\"name\":\"ozusgz\",\"properties\":{\"description\":\"snnjzfpafolpym\",\"groupId\":\"mxq\",\"type\":\"agpgdph\"}}]},\"id\":\"dulajvlejchcs\",\"name\":\"lzk\",\"type\":\"mzlanru\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.webPubSubPrivateLinkResources().list("fpafolpymwamxq", "rag", com.azure.core.util.Context.NONE); + PagedIterable response = manager.webPubSubPrivateLinkResources() + .list("yjuzkdb", "zolxrzvhqjwtr", com.azure.core.util.Context.NONE); - Assertions.assertEquals("phtvdu", response.iterator().next().groupId()); - Assertions.assertEquals("vl", response.iterator().next().requiredMembers().get(0)); - Assertions.assertEquals("pdwvnphcn", response.iterator().next().requiredZoneNames().get(0)); - Assertions.assertEquals("mqrhvthl", - response.iterator().next().shareablePrivateLinkResourceTypes().get(0).name()); - Assertions.assertEquals("dcxsmlz", + Assertions.assertEquals("vgzpcrrkolawj", response.iterator().next().groupId()); + Assertions.assertEquals("mwrokcdxfzzzwyja", response.iterator().next().requiredMembers().get(0)); + Assertions.assertEquals("lhguyn", response.iterator().next().requiredZoneNames().get(0)); + Assertions.assertEquals("ozusgz", response.iterator().next().shareablePrivateLinkResourceTypes().get(0).name()); + Assertions.assertEquals("snnjzfpafolpym", response.iterator().next().shareablePrivateLinkResourceTypes().get(0).properties().description()); - Assertions.assertEquals("zdtxetlgyd", + Assertions.assertEquals("mxq", response.iterator().next().shareablePrivateLinkResourceTypes().get(0).properties().groupId()); - Assertions.assertEquals("qvlnnpxybafiqgea", + Assertions.assertEquals("agpgdph", response.iterator().next().shareablePrivateLinkResourceTypes().get(0).properties().type()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPropertiesTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPropertiesTests.java index efc2e6dd42e8..8b5c0b1b9aeb 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPropertiesTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubPropertiesTests.java @@ -1,12 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubProperties; import com.azure.resourcemanager.webpubsub.models.AclAction; +import com.azure.resourcemanager.webpubsub.models.ApplicationFirewallSettings; +import com.azure.resourcemanager.webpubsub.models.ClientConnectionCountRule; +import com.azure.resourcemanager.webpubsub.models.ClientTrafficControlRule; import com.azure.resourcemanager.webpubsub.models.IpRule; import com.azure.resourcemanager.webpubsub.models.LiveTraceCategory; import com.azure.resourcemanager.webpubsub.models.LiveTraceConfiguration; @@ -25,100 +28,101 @@ public final class WebPubSubPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WebPubSubProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Failed\",\"externalIP\":\"eosjswsr\",\"hostName\":\"lyzrpzbchckqqzqi\",\"publicPort\":1257157038,\"serverPort\":1168629825,\"version\":\"iizynkedyatrwyh\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"itsmypyyn\"},\"groupIds\":[\"pumnz\",\"mwzn\",\"abikns\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"xbldtlwwrlkdmtn\",\"actionsRequired\":\"ok\"}},\"id\":\"llxdyhgs\",\"name\":\"ocogj\",\"type\":\"tdtbnnhadooc\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"hnvpamqgxq\"},\"groupIds\":[\"zikywgg\",\"kallatmel\",\"uipiccjzk\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"vc\",\"actionsRequired\":\"y\"}},\"id\":\"yrnxxmueedn\",\"name\":\"rdvstkwqqtch\",\"type\":\"alm\"},{\"properties\":{\"provisioningState\":\"Running\",\"privateEndpoint\":{\"id\":\"ygdvwv\"},\"groupIds\":[\"ohgwxrtfudxepxg\",\"qagvrvm\",\"pkukghi\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"gwimfn\",\"actionsRequired\":\"fjxwmsz\"}},\"id\":\"foqreyfkzik\",\"name\":\"jawneaiv\",\"type\":\"wczelpci\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"feaenwab\",\"privateLinkResourceId\":\"atklddxbjhwuaa\",\"provisioningState\":\"Unknown\",\"requestMessage\":\"osphyoul\",\"status\":\"Pending\"},\"id\":\"xagl\",\"name\":\"vimjwos\",\"type\":\"tx\"},{\"properties\":{\"groupId\":\"cskfcktqumiekk\",\"privateLinkResourceId\":\"zzikhlyfjhdg\",\"provisioningState\":\"Failed\",\"requestMessage\":\"bdunygaeqid\",\"status\":\"Timeout\"},\"id\":\"t\",\"name\":\"xllrxcyjm\",\"type\":\"a\"},{\"properties\":{\"groupId\":\"uvarmywdmjsjq\",\"privateLinkResourceId\":\"jhhyxxrwlycoduhp\",\"provisioningState\":\"Running\",\"requestMessage\":\"ymareqnajxqugj\",\"status\":\"Rejected\"},\"id\":\"ubeddg\",\"name\":\"sofwqmzqalkrmnji\",\"type\":\"pxacqqudfn\"},{\"properties\":{\"groupId\":\"xbaaabjyv\",\"privateLinkResourceId\":\"yffimrzrtuzqogs\",\"provisioningState\":\"Running\",\"requestMessage\":\"vfdnwnwmewzsyyce\",\"status\":\"Disconnected\"},\"id\":\"i\",\"name\":\"judpfrxt\",\"type\":\"thzvaytdwkqbrqu\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"exiili\",\"liveTraceConfiguration\":{\"enabled\":\"tiirqtdqoa\",\"categories\":[{\"name\":\"zfgs\",\"enabled\":\"yfxrx\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"ramxjezwlwnw\",\"enabled\":\"qlcvydy\"},{\"name\":\"tdooaoj\",\"enabled\":\"iodkooebwnujhem\"}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"Trace\"],\"deny\":[\"ServerConnection\",\"ServerConnection\"]},\"privateEndpoints\":[{\"name\":\"fw\",\"allow\":[\"ClientConnection\",\"ServerConnection\"],\"deny\":[\"RESTAPI\",\"Trace\"]},{\"name\":\"vefkdlfoakggk\",\"allow\":[\"Trace\",\"ClientConnection\",\"ServerConnection\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"Trace\",\"RESTAPI\",\"Trace\"]},{\"name\":\"lyls\",\"allow\":[\"RESTAPI\"],\"deny\":[\"ServerConnection\"]},{\"name\":\"jervtia\",\"allow\":[\"ServerConnection\",\"ClientConnection\"],\"deny\":[\"ClientConnection\"]}],\"ipRules\":[{\"value\":\"bzkfzbeyvpn\",\"action\":\"Deny\"},{\"value\":\"invkjjxdxrbuu\",\"action\":\"Allow\"},{\"value\":\"ewyhml\",\"action\":\"Allow\"},{\"value\":\"tzpofncckwyfzq\",\"action\":\"Allow\"}]},\"publicNetworkAccess\":\"buy\",\"disableLocalAuth\":false,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"qztpp\",\"resourceStopped\":\"o\",\"socketIO\":{\"serviceMode\":\"rjaltolmncw\"}}") + "{\"provisioningState\":\"Creating\",\"externalIP\":\"vlvqhjkbegi\",\"hostName\":\"nmxiebwwaloayqc\",\"publicPort\":1214313613,\"serverPort\":1999029226,\"version\":\"uzgwyzmhtx\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"jcbpwxqpsrknft\"},\"groupIds\":[\"riuhprwm\",\"yvxqtayriwwroy\",\"bexrmcq\",\"bycnojvkn\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"gzva\",\"actionsRequired\":\"pjyzhpv\"}},\"id\":\"zcjrvxdjzlmwlx\",\"name\":\"vu\",\"type\":\"fhzovawjvzunluth\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"i\"},\"groupIds\":[\"lpjzuaejxdu\",\"tskzbbtdzumveek\",\"pwo\",\"uh\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"jyofdxluusdtto\",\"actionsRequired\":\"aboekqv\"}},\"id\":\"lns\",\"name\":\"vbxwyjsflhh\",\"type\":\"aalnjixi\"},{\"properties\":{\"provisioningState\":\"Running\",\"privateEndpoint\":{\"id\":\"oyaqcslyjpkiid\"},\"groupIds\":[\"xznelixhnrztf\",\"lhbnxkna\",\"aulppggd\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"nyiropuhpi\",\"actionsRequired\":\"pgylg\"}},\"id\":\"itxmedjvcslynqww\",\"name\":\"cwzzhxgktr\",\"type\":\"gucnapkte\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"privateEndpoint\":{\"id\":\"tfdygpfqb\"},\"groupIds\":[\"eopzfqrhhuaopp\",\"cq\",\"qxolzdahzx\",\"t\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"dmoizpostmg\",\"actionsRequired\":\"fbunrmfqjhhk\"}},\"id\":\"pvjymjhxxjyng\",\"name\":\"divkrt\",\"type\":\"wbxqzvszjfau\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"xxivetv\",\"privateLinkResourceId\":\"cqaqtdoqmcbx\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"yslqbhsfx\",\"fqdns\":[\"ytkblmpew\"],\"status\":\"Disconnected\"},\"id\":\"krvrns\",\"name\":\"shqjohxcrsbf\",\"type\":\"vasrruvwb\"},{\"properties\":{\"groupId\":\"qfsubcgjbirx\",\"privateLinkResourceId\":\"pybsrfbjfdtw\",\"provisioningState\":\"Updating\",\"requestMessage\":\"ftpvjzbexil\",\"fqdns\":[\"fqqnvwpmqtaruo\",\"jmkcjhwqytj\"],\"status\":\"Disconnected\"},\"id\":\"wj\",\"name\":\"wgdrjervnaenqp\",\"type\":\"hin\"},{\"properties\":{\"groupId\":\"ygmi\",\"privateLinkResourceId\":\"thnzd\",\"provisioningState\":\"Deleting\",\"requestMessage\":\"gnayqigynduh\",\"fqdns\":[\"qlkth\",\"maqolbgycduie\",\"tgccymvaolpss\"],\"status\":\"Rejected\"},\"id\":\"mmdnbbglzps\",\"name\":\"iydmcwyhzdxs\",\"type\":\"adbzmnvdfznud\"},{\"properties\":{\"groupId\":\"dvxzbncblylpst\",\"privateLinkResourceId\":\"bhhxsrzdzuc\",\"provisioningState\":\"Moving\",\"requestMessage\":\"dntnevf\",\"fqdns\":[\"mygtdssls\",\"tmweriofzpyq\",\"emwabnet\",\"hhszh\"],\"status\":\"Disconnected\"},\"id\":\"vwiwubmwmbesld\",\"name\":\"k\",\"type\":\"wtppjflcxogaoko\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"ikvmkqzeqqk\",\"liveTraceConfiguration\":{\"enabled\":\"fzxmhhvhgureodkw\",\"categories\":[{\"name\":\"gxtibqdxbxw\",\"enabled\":\"bogqxndlkzgxhu\"},{\"name\":\"plbpodxun\",\"enabled\":\"ebxmubyynt\"},{\"name\":\"rbqtkoie\",\"enabled\":\"eotg\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"muwlauwzizxbm\",\"enabled\":\"cjefuzmu\"},{\"name\":\"bttdumorppxe\",\"enabled\":\"nzbtbhj\"},{\"name\":\"lkfg\",\"enabled\":\"dneu\"},{\"name\":\"fphsdyhtozfikdow\",\"enabled\":\"uuvxz\"}]},\"networkACLs\":{\"defaultAction\":\"Allow\",\"publicNetwork\":{\"allow\":[\"Trace\",\"Trace\",\"ServerConnection\"],\"deny\":[\"ServerConnection\",\"ClientConnection\",\"RESTAPI\"]},\"privateEndpoints\":[{\"name\":\"hcohfwdsjnk\",\"allow\":[\"RESTAPI\",\"RESTAPI\",\"Trace\"],\"deny\":[\"ClientConnection\",\"Trace\",\"RESTAPI\"]}],\"ipRules\":[{\"value\":\"dkzzewkfvhqcrail\",\"action\":\"Allow\"},{\"value\":\"pfuflrw\",\"action\":\"Deny\"}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":4703146720664462734},\"publicNetworkAccess\":\"gafcnihgwqapnedg\",\"disableLocalAuth\":true,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"vq\",\"resourceStopped\":\"keqdcvdrhvoods\",\"socketIO\":{\"serviceMode\":\"obzdopcjwvnhdl\"}}") .toObject(WebPubSubProperties.class); - Assertions.assertEquals(true, model.tls().clientCertEnabled()); - Assertions.assertEquals("tiirqtdqoa", model.liveTraceConfiguration().enabled()); - Assertions.assertEquals("zfgs", model.liveTraceConfiguration().categories().get(0).name()); - Assertions.assertEquals("yfxrx", model.liveTraceConfiguration().categories().get(0).enabled()); - Assertions.assertEquals("ramxjezwlwnw", model.resourceLogConfiguration().categories().get(0).name()); - Assertions.assertEquals("qlcvydy", model.resourceLogConfiguration().categories().get(0).enabled()); - Assertions.assertEquals(AclAction.DENY, model.networkACLs().defaultAction()); + Assertions.assertTrue(model.tls().clientCertEnabled()); + Assertions.assertEquals("fzxmhhvhgureodkw", model.liveTraceConfiguration().enabled()); + Assertions.assertEquals("gxtibqdxbxw", model.liveTraceConfiguration().categories().get(0).name()); + Assertions.assertEquals("bogqxndlkzgxhu", model.liveTraceConfiguration().categories().get(0).enabled()); + Assertions.assertEquals("muwlauwzizxbm", model.resourceLogConfiguration().categories().get(0).name()); + Assertions.assertEquals("cjefuzmu", model.resourceLogConfiguration().categories().get(0).enabled()); + Assertions.assertEquals(AclAction.ALLOW, model.networkACLs().defaultAction()); Assertions.assertEquals(WebPubSubRequestType.TRACE, model.networkACLs().publicNetwork().allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.networkACLs().publicNetwork().deny().get(0)); - Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, - model.networkACLs().privateEndpoints().get(0).allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.RESTAPI, + model.networkACLs().privateEndpoints().get(0).allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.networkACLs().privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("fw", model.networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("bzkfzbeyvpn", model.networkACLs().ipRules().get(0).value()); - Assertions.assertEquals(AclAction.DENY, model.networkACLs().ipRules().get(0).action()); - Assertions.assertEquals("buy", model.publicNetworkAccess()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(true, model.disableAadAuth()); - Assertions.assertEquals("qztpp", model.regionEndpointEnabled()); - Assertions.assertEquals("o", model.resourceStopped()); - Assertions.assertEquals("rjaltolmncw", model.socketIO().serviceMode()); + Assertions.assertEquals("hcohfwdsjnk", model.networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals("dkzzewkfvhqcrail", model.networkACLs().ipRules().get(0).value()); + Assertions.assertEquals(AclAction.ALLOW, model.networkACLs().ipRules().get(0).action()); + Assertions.assertEquals(4703146720664462734L, + model.applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("gafcnihgwqapnedg", model.publicNetworkAccess()); + Assertions.assertTrue(model.disableLocalAuth()); + Assertions.assertFalse(model.disableAadAuth()); + Assertions.assertEquals("vq", model.regionEndpointEnabled()); + Assertions.assertEquals("keqdcvdrhvoods", model.resourceStopped()); + Assertions.assertEquals("obzdopcjwvnhdl", model.socketIO().serviceMode()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WebPubSubProperties model = new WebPubSubProperties() - .withTls(new WebPubSubTlsSettings().withClientCertEnabled(true)) - .withLiveTraceConfiguration(new LiveTraceConfiguration().withEnabled("tiirqtdqoa") - .withCategories(Arrays.asList(new LiveTraceCategory().withName("zfgs").withEnabled("yfxrx")))) - .withResourceLogConfiguration(new ResourceLogConfiguration() - .withCategories(Arrays.asList(new ResourceLogCategory().withName("ramxjezwlwnw").withEnabled("qlcvydy"), - new ResourceLogCategory().withName("tdooaoj").withEnabled("iodkooebwnujhem")))) - .withNetworkACLs( - new WebPubSubNetworkACLs().withDefaultAction(AclAction.DENY) - .withPublicNetwork(new NetworkAcl().withAllow(Arrays.asList(WebPubSubRequestType.TRACE)) + WebPubSubProperties model + = new WebPubSubProperties().withTls(new WebPubSubTlsSettings().withClientCertEnabled(true)) + .withLiveTraceConfiguration(new LiveTraceConfiguration().withEnabled("fzxmhhvhgureodkw") + .withCategories( + Arrays.asList(new LiveTraceCategory().withName("gxtibqdxbxw").withEnabled("bogqxndlkzgxhu"), + new LiveTraceCategory().withName("plbpodxun").withEnabled("ebxmubyynt"), + new LiveTraceCategory().withName("rbqtkoie").withEnabled("eotg")))) + .withResourceLogConfiguration(new ResourceLogConfiguration().withCategories( + Arrays.asList(new ResourceLogCategory().withName("muwlauwzizxbm").withEnabled("cjefuzmu"), + new ResourceLogCategory().withName("bttdumorppxe").withEnabled("nzbtbhj"), + new ResourceLogCategory().withName("lkfg").withEnabled("dneu"), + new ResourceLogCategory().withName("fphsdyhtozfikdow").withEnabled("uuvxz")))) + .withNetworkACLs(new WebPubSubNetworkACLs().withDefaultAction(AclAction.ALLOW) + .withPublicNetwork(new NetworkAcl() + .withAllow(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.TRACE, + WebPubSubRequestType.SERVER_CONNECTION)) .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION))) - .withPrivateEndpoints(Arrays.asList( - new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.TRACE)) - .withName("fw"), - new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.CLIENT_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.CLIENT_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.TRACE, - WebPubSubRequestType.RESTAPI, WebPubSubRequestType.TRACE)) - .withName("vefkdlfoakggk"), - new PrivateEndpointAcl().withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI)) - .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION)) - .withName("lyls"), - new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.CLIENT_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION)) - .withName("jervtia"))) - .withIpRules(Arrays.asList(new IpRule().withValue("bzkfzbeyvpn").withAction(AclAction.DENY), - new IpRule().withValue("invkjjxdxrbuu").withAction(AclAction.ALLOW), - new IpRule().withValue("ewyhml").withAction(AclAction.ALLOW), - new IpRule().withValue("tzpofncckwyfzq").withAction(AclAction.ALLOW)))) - .withPublicNetworkAccess("buy") - .withDisableLocalAuth(false) - .withDisableAadAuth(true) - .withRegionEndpointEnabled("qztpp") - .withResourceStopped("o") - .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("rjaltolmncw")); + WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.RESTAPI))) + .withPrivateEndpoints(Arrays.asList(new PrivateEndpointAcl() + .withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI, + WebPubSubRequestType.TRACE)) + .withDeny(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.TRACE, + WebPubSubRequestType.RESTAPI)) + .withName("hcohfwdsjnk"))) + .withIpRules( + Arrays.asList(new IpRule().withValue("dkzzewkfvhqcrail").withAction(AclAction.ALLOW), + new IpRule().withValue("pfuflrw").withAction(AclAction.DENY)))) + .withApplicationFirewall(new ApplicationFirewallSettings() + .withClientConnectionCountRules( + Arrays.asList(new ClientConnectionCountRule(), new ClientConnectionCountRule(), + new ClientConnectionCountRule(), new ClientConnectionCountRule())) + .withClientTrafficControlRules(Arrays.asList(new ClientTrafficControlRule())) + .withMaxClientConnectionLifetimeInSeconds(4703146720664462734L)) + .withPublicNetworkAccess("gafcnihgwqapnedg") + .withDisableLocalAuth(true) + .withDisableAadAuth(false) + .withRegionEndpointEnabled("vq") + .withResourceStopped("keqdcvdrhvoods") + .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("obzdopcjwvnhdl")); model = BinaryData.fromObject(model).toObject(WebPubSubProperties.class); - Assertions.assertEquals(true, model.tls().clientCertEnabled()); - Assertions.assertEquals("tiirqtdqoa", model.liveTraceConfiguration().enabled()); - Assertions.assertEquals("zfgs", model.liveTraceConfiguration().categories().get(0).name()); - Assertions.assertEquals("yfxrx", model.liveTraceConfiguration().categories().get(0).enabled()); - Assertions.assertEquals("ramxjezwlwnw", model.resourceLogConfiguration().categories().get(0).name()); - Assertions.assertEquals("qlcvydy", model.resourceLogConfiguration().categories().get(0).enabled()); - Assertions.assertEquals(AclAction.DENY, model.networkACLs().defaultAction()); + Assertions.assertTrue(model.tls().clientCertEnabled()); + Assertions.assertEquals("fzxmhhvhgureodkw", model.liveTraceConfiguration().enabled()); + Assertions.assertEquals("gxtibqdxbxw", model.liveTraceConfiguration().categories().get(0).name()); + Assertions.assertEquals("bogqxndlkzgxhu", model.liveTraceConfiguration().categories().get(0).enabled()); + Assertions.assertEquals("muwlauwzizxbm", model.resourceLogConfiguration().categories().get(0).name()); + Assertions.assertEquals("cjefuzmu", model.resourceLogConfiguration().categories().get(0).enabled()); + Assertions.assertEquals(AclAction.ALLOW, model.networkACLs().defaultAction()); Assertions.assertEquals(WebPubSubRequestType.TRACE, model.networkACLs().publicNetwork().allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.networkACLs().publicNetwork().deny().get(0)); - Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, - model.networkACLs().privateEndpoints().get(0).allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.RESTAPI, + model.networkACLs().privateEndpoints().get(0).allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.networkACLs().privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("fw", model.networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("bzkfzbeyvpn", model.networkACLs().ipRules().get(0).value()); - Assertions.assertEquals(AclAction.DENY, model.networkACLs().ipRules().get(0).action()); - Assertions.assertEquals("buy", model.publicNetworkAccess()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(true, model.disableAadAuth()); - Assertions.assertEquals("qztpp", model.regionEndpointEnabled()); - Assertions.assertEquals("o", model.resourceStopped()); - Assertions.assertEquals("rjaltolmncw", model.socketIO().serviceMode()); + Assertions.assertEquals("hcohfwdsjnk", model.networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals("dkzzewkfvhqcrail", model.networkACLs().ipRules().get(0).value()); + Assertions.assertEquals(AclAction.ALLOW, model.networkACLs().ipRules().get(0).action()); + Assertions.assertEquals(4703146720664462734L, + model.applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("gafcnihgwqapnedg", model.publicNetworkAccess()); + Assertions.assertTrue(model.disableLocalAuth()); + Assertions.assertFalse(model.disableAadAuth()); + Assertions.assertEquals("vq", model.regionEndpointEnabled()); + Assertions.assertEquals("keqdcvdrhvoods", model.resourceStopped()); + Assertions.assertEquals("obzdopcjwvnhdl", model.socketIO().serviceMode()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateMockTests.java index 238738f76ac0..4e9d0cedb90f 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateMockTests.java @@ -1,19 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.fluent.models.SharedPrivateLinkResourceInner; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResource; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -22,24 +23,26 @@ public final class WebPubSubReplicaSharedPrivateLinkResourcesCreateOrUpdateMockT @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"groupId\":\"hltnjadhqoawjq\",\"privateLinkResourceId\":\"yueayfbpcmsp\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"rueqthwm\",\"status\":\"Timeout\"},\"id\":\"scbbxig\",\"name\":\"hxiidlopedb\",\"type\":\"dpyqyybxubmd\"}"; + = "{\"properties\":{\"groupId\":\"vqs\",\"privateLinkResourceId\":\"ny\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"ivensrpmeyyvpk\",\"fqdns\":[\"lbijpzgsksrfhfvo\",\"mknbnxwcdommpv\"],\"status\":\"Disconnected\"},\"id\":\"zfgbrttuiaclkie\",\"name\":\"hajlfn\",\"type\":\"hiqfyuttdiy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SharedPrivateLinkResource response = manager.webPubSubReplicaSharedPrivateLinkResources() - .createOrUpdate("kkjanurnnqbnqbp", "zxqltgrdogypx", "x", "bfihw", - new SharedPrivateLinkResourceInner().withGroupId("vctafsrb") - .withPrivateLinkResourceId("rblmli") - .withRequestMessage("hspnxwqagnepz"), + .createOrUpdate("eksgbuxantuygd", "gaqi", "irpiwrqofulopmj", "lexwhcbjp", + new SharedPrivateLinkResourceInner().withGroupId("k") + .withPrivateLinkResourceId("phuuuerctato") + .withRequestMessage("qpbrlc") + .withFqdns(Arrays.asList("uczkgofxyfsruc", "crrpcjttbstvje")), com.azure.core.util.Context.NONE); - Assertions.assertEquals("hltnjadhqoawjq", response.groupId()); - Assertions.assertEquals("yueayfbpcmsp", response.privateLinkResourceId()); - Assertions.assertEquals("rueqthwm", response.requestMessage()); + Assertions.assertEquals("vqs", response.groupId()); + Assertions.assertEquals("ny", response.privateLinkResourceId()); + Assertions.assertEquals("ivensrpmeyyvpk", response.requestMessage()); + Assertions.assertEquals("lbijpzgsksrfhfvo", response.fqdns().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesGetWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesGetWithResponseMockTests.java index b5ac8c871007..67a980f50413 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesGetWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResource; @@ -21,22 +21,22 @@ public final class WebPubSubReplicaSharedPrivateLinkResourcesGetWithResponseMock @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"groupId\":\"mkoisqcssf\",\"privateLinkResourceId\":\"xuifmcsypobkdqz\",\"provisioningState\":\"Unknown\",\"requestMessage\":\"ylollgtrczzydmxz\",\"status\":\"Timeout\"},\"id\":\"vuaurk\",\"name\":\"hci\",\"type\":\"ldefxrdcoxn\"}"; + = "{\"properties\":{\"groupId\":\"oc\",\"privateLinkResourceId\":\"jrohmbpyryxameb\",\"provisioningState\":\"Unknown\",\"requestMessage\":\"vkfkmr\",\"fqdns\":[\"nehvsmt\"],\"status\":\"Pending\"},\"id\":\"pyapucygvoav\",\"name\":\"unssxlghieegjl\",\"type\":\"vvpa\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SharedPrivateLinkResource response = manager.webPubSubReplicaSharedPrivateLinkResources() - .getWithResponse("nyghshxcylhkgmn", "ghpxycphdr", "jjkhvyomaclu", "vxnqmhrpqpd", - com.azure.core.util.Context.NONE) + .getWithResponse("ajqfutlx", "oqza", "unwqr", "zfrgqhaohcm", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mkoisqcssf", response.groupId()); - Assertions.assertEquals("xuifmcsypobkdqz", response.privateLinkResourceId()); - Assertions.assertEquals("ylollgtrczzydmxz", response.requestMessage()); + Assertions.assertEquals("oc", response.groupId()); + Assertions.assertEquals("jrohmbpyryxameb", response.privateLinkResourceId()); + Assertions.assertEquals("vkfkmr", response.requestMessage()); + Assertions.assertEquals("nehvsmt", response.fqdns().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesListMockTests.java index 8e65fd5cce02..2a003ebd7af9 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicaSharedPrivateLinkResourcesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResource; @@ -22,20 +22,21 @@ public final class WebPubSubReplicaSharedPrivateLinkResourcesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"guamlj\",\"privateLinkResourceId\":\"l\",\"provisioningState\":\"Updating\",\"requestMessage\":\"plzgaufcshhvn\",\"status\":\"Rejected\"},\"id\":\"xkym\",\"name\":\"q\",\"type\":\"nxrjkixtwbtaoy\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"vogygzyvneez\",\"privateLinkResourceId\":\"ifgh\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"qtlffhzbk\",\"fqdns\":[\"jjavfq\",\"vhnqo\",\"wdogiyetesyp\"],\"status\":\"Rejected\"},\"id\":\"ztjhqtfbovnynkbw\",\"name\":\"tnjuhpsprkzyaupi\",\"type\":\"ccxnafbwqroohtuo\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.webPubSubReplicaSharedPrivateLinkResources() - .list("cisiz", "oaedsxjwuivedwcg", "eewxeiqbpsmg", com.azure.core.util.Context.NONE); + .list("b", "vnwsw", "txkyctwwgzwxjlm", com.azure.core.util.Context.NONE); - Assertions.assertEquals("guamlj", response.iterator().next().groupId()); - Assertions.assertEquals("l", response.iterator().next().privateLinkResourceId()); - Assertions.assertEquals("plzgaufcshhvn", response.iterator().next().requestMessage()); + Assertions.assertEquals("vogygzyvneez", response.iterator().next().groupId()); + Assertions.assertEquals("ifgh", response.iterator().next().privateLinkResourceId()); + Assertions.assertEquals("qtlffhzbk", response.iterator().next().requestMessage()); + Assertions.assertEquals("jjavfq", response.iterator().next().fqdns().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasCreateOrUpdateMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasCreateOrUpdateMockTests.java index ce32b3f2991c..682f57cc631c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasCreateOrUpdateMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasCreateOrUpdateMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.Replica; @@ -25,32 +25,34 @@ public final class WebPubSubReplicasCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"sku\":{\"name\":\"lwgniiprglvawu\",\"tier\":\"Free\",\"size\":\"fypiv\",\"family\":\"bbjpmcubkmif\",\"capacity\":2127053211},\"properties\":{\"provisioningState\":\"Succeeded\",\"regionEndpointEnabled\":\"phavpmhbrb\",\"resourceStopped\":\"vgovpbbttefjokn\"},\"location\":\"qyzqedikdfrdb\",\"tags\":{\"qlggwfi\":\"rjgeih\",\"mgtvlj\":\"zcxmjpbyep\",\"yfqi\":\"rc\",\"ui\":\"gxhnpomyqwcabv\"},\"id\":\"eeyaswl\",\"name\":\"augmrmfjlr\",\"type\":\"wtoaukhfk\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"regionEndpointEnabled\":\"zohmnrxxbs\",\"resourceStopped\":\"klinhmdptysprq\"},\"sku\":{\"name\":\"nzxojpslsvjgpli\",\"tier\":\"Premium\",\"size\":\"woyxqvapcohhou\",\"family\":\"pqojxcx\",\"capacity\":434945118},\"location\":\"cgdz\",\"tags\":{\"jhzn\":\"ribcawetzqddtjwf\"},\"id\":\"mtuatmzwcjjncqtj\",\"name\":\"mizvgbgatzuuvbx\",\"type\":\"grebwggahttzlsw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Replica response = manager.webPubSubReplicas() - .define("wkufykhvuhxepm") - .withRegion("lrmymyincqlhri") - .withExistingWebPubSub("ewbidyvteowxv", "piudeugfsxzecpa") - .withTags(mapOf("cgxuugqkctotiowl", "lmiiiovg")) - .withSku(new ResourceSku().withName("tznabao").withTier(WebPubSubSkuTier.STANDARD).withCapacity(423835249)) - .withRegionEndpointEnabled("ds") - .withResourceStopped("pemmucfxhik") + .define("ueayfbpcmsplb") + .withRegion("geleohdbvq") + .withExistingWebPubSub("hhltnjadhqo", "wjqo") + .withTags(mapOf("lkwzdqybxceakxcp", "kjopwbeon")) + .withSku(new ResourceSku().withName("lopedbwdpyqyyb") + .withTier(WebPubSubSkuTier.STANDARD) + .withCapacity(1525948244)) + .withRegionEndpointEnabled("qthwmgnmbscbb") + .withResourceStopped("gdhxi") .create(); - Assertions.assertEquals("qyzqedikdfrdb", response.location()); - Assertions.assertEquals("rjgeih", response.tags().get("qlggwfi")); - Assertions.assertEquals("lwgniiprglvawu", response.sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.FREE, response.sku().tier()); - Assertions.assertEquals(2127053211, response.sku().capacity()); - Assertions.assertEquals("phavpmhbrb", response.regionEndpointEnabled()); - Assertions.assertEquals("vgovpbbttefjokn", response.resourceStopped()); + Assertions.assertEquals("cgdz", response.location()); + Assertions.assertEquals("ribcawetzqddtjwf", response.tags().get("jhzn")); + Assertions.assertEquals("nzxojpslsvjgpli", response.sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.PREMIUM, response.sku().tier()); + Assertions.assertEquals(434945118, response.sku().capacity()); + Assertions.assertEquals("zohmnrxxbs", response.regionEndpointEnabled()); + Assertions.assertEquals("klinhmdptysprq", response.resourceStopped()); } // Use "Map.of" if available diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasDeleteWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasDeleteWithResponseMockTests.java index bc74f3702a4f..2c861c0a6635 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasDeleteWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.webPubSubReplicas() - .deleteWithResponse("ukklelss", "blycsxzujksr", "smdesqplpvmjcd", com.azure.core.util.Context.NONE); + .deleteWithResponse("lhkgmnsghp", "ycphdrwjjkhvyo", "ac", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasGetWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasGetWithResponseMockTests.java index c9bd9f52ff51..806bf32190c0 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasGetWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.Replica; @@ -22,25 +22,25 @@ public final class WebPubSubReplicasGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"sku\":{\"name\":\"kkum\",\"tier\":\"Premium\",\"size\":\"cjc\",\"family\":\"tbw\",\"capacity\":1738579050},\"properties\":{\"provisioningState\":\"Creating\",\"regionEndpointEnabled\":\"wcoml\",\"resourceStopped\":\"ytwvczcswkacve\"},\"location\":\"fdv\",\"tags\":{\"rnfxtgddp\":\"b\",\"hn\":\"th\",\"oe\":\"naoyank\",\"roznnhdrlktgj\":\"swankltytmh\"},\"id\":\"sggux\",\"name\":\"eml\",\"type\":\"ywaeeczgf\"}"; + = "{\"properties\":{\"provisioningState\":\"Running\",\"regionEndpointEnabled\":\"rmfjlrxw\",\"resourceStopped\":\"aukhfkvcisiz\"},\"sku\":{\"name\":\"a\",\"tier\":\"Free\",\"size\":\"jwuive\",\"family\":\"cgyee\",\"capacity\":429954507},\"location\":\"qbpsmg\",\"tags\":{\"mljdlrgmsplzga\":\"u\",\"new\":\"fcshh\"},\"id\":\"nxkympqanxrjk\",\"name\":\"xtwbta\",\"type\":\"ypnyghshxc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Replica response = manager.webPubSubReplicas() - .getWithResponse("rhpw", "gddeimaw", "o", com.azure.core.util.Context.NONE) + .getWithResponse("gxhnpomyqwcabv", "ui", "eeyaswl", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("fdv", response.location()); - Assertions.assertEquals("b", response.tags().get("rnfxtgddp")); - Assertions.assertEquals("kkum", response.sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.PREMIUM, response.sku().tier()); - Assertions.assertEquals(1738579050, response.sku().capacity()); - Assertions.assertEquals("wcoml", response.regionEndpointEnabled()); - Assertions.assertEquals("ytwvczcswkacve", response.resourceStopped()); + Assertions.assertEquals("qbpsmg", response.location()); + Assertions.assertEquals("u", response.tags().get("mljdlrgmsplzga")); + Assertions.assertEquals("a", response.sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.FREE, response.sku().tier()); + Assertions.assertEquals(429954507, response.sku().capacity()); + Assertions.assertEquals("rmfjlrxw", response.regionEndpointEnabled()); + Assertions.assertEquals("aukhfkvcisiz", response.resourceStopped()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasListMockTests.java index 050b29dee3ab..8272b79501f9 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubReplicasListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.Replica; @@ -23,24 +23,24 @@ public final class WebPubSubReplicasListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"sku\":{\"name\":\"osovyrrleaesin\",\"tier\":\"Standard\",\"size\":\"jqo\",\"family\":\"pihehce\",\"capacity\":695554313},\"properties\":{\"provisioningState\":\"Moving\",\"regionEndpointEnabled\":\"rjb\",\"resourceStopped\":\"pxdlv\"},\"location\":\"frexcrseqw\",\"tags\":{\"hxogjggsvoujkxi\":\"ghudg\"},\"id\":\"dafhr\",\"name\":\"mdyomkxfbvfbh\",\"type\":\"y\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Moving\",\"regionEndpointEnabled\":\"isqcssffxuifmcs\",\"resourceStopped\":\"obkdqzrdzsyl\"},\"sku\":{\"name\":\"lgtrczzy\",\"tier\":\"Free\",\"size\":\"ji\",\"family\":\"vuaurk\",\"capacity\":497731118},\"location\":\"rldefxrdcox\",\"tags\":{\"nqbnqb\":\"kjanur\",\"gypxrxvbfihwuhvc\":\"izxqltgrd\",\"s\":\"a\",\"wqagnepzwa\":\"bxrblmliowxihspn\"},\"id\":\"lsbs\",\"name\":\"qqqagwwrxaomzi\",\"type\":\"glrrczez\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.webPubSubReplicas().list("wwsko", "dcbrwimuvq", com.azure.core.util.Context.NONE); + = manager.webPubSubReplicas().list("u", "vxnqmhrpqpd", com.azure.core.util.Context.NONE); - Assertions.assertEquals("frexcrseqw", response.iterator().next().location()); - Assertions.assertEquals("ghudg", response.iterator().next().tags().get("hxogjggsvoujkxi")); - Assertions.assertEquals("osovyrrleaesin", response.iterator().next().sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.STANDARD, response.iterator().next().sku().tier()); - Assertions.assertEquals(695554313, response.iterator().next().sku().capacity()); - Assertions.assertEquals("rjb", response.iterator().next().regionEndpointEnabled()); - Assertions.assertEquals("pxdlv", response.iterator().next().resourceStopped()); + Assertions.assertEquals("rldefxrdcox", response.iterator().next().location()); + Assertions.assertEquals("kjanur", response.iterator().next().tags().get("nqbnqb")); + Assertions.assertEquals("lgtrczzy", response.iterator().next().sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.FREE, response.iterator().next().sku().tier()); + Assertions.assertEquals(497731118, response.iterator().next().sku().capacity()); + Assertions.assertEquals("isqcssffxuifmcs", response.iterator().next().regionEndpointEnabled()); + Assertions.assertEquals("obkdqzrdzsyl", response.iterator().next().resourceStopped()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubResourceInnerTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubResourceInnerTests.java index 304ebda0a2c2..4a0e9283ce30 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubResourceInnerTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubResourceInnerTests.java @@ -1,12 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubResourceInner; import com.azure.resourcemanager.webpubsub.models.AclAction; +import com.azure.resourcemanager.webpubsub.models.ApplicationFirewallSettings; +import com.azure.resourcemanager.webpubsub.models.ClientConnectionCountRule; +import com.azure.resourcemanager.webpubsub.models.ClientTrafficControlRule; import com.azure.resourcemanager.webpubsub.models.IpRule; import com.azure.resourcemanager.webpubsub.models.LiveTraceCategory; import com.azure.resourcemanager.webpubsub.models.LiveTraceConfiguration; @@ -33,118 +36,126 @@ public final class WebPubSubResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WebPubSubResourceInner model = BinaryData.fromString( - "{\"sku\":{\"name\":\"hh\",\"tier\":\"Premium\",\"size\":\"dzu\",\"family\":\"rsc\",\"capacity\":42562338},\"properties\":{\"provisioningState\":\"Creating\",\"externalIP\":\"iwjmygtdssls\",\"hostName\":\"mweriofzpy\",\"publicPort\":1979583980,\"serverPort\":705753696,\"version\":\"bnetshh\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"wiwubm\"},\"groupIds\":[\"esl\",\"nkww\",\"pp\",\"flcxoga\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"m\",\"actionsRequired\":\"ikvmkqzeqqk\"}},\"id\":\"tfz\",\"name\":\"mhhv\",\"type\":\"gureodkwobdag\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"qdxbxwa\",\"privateLinkResourceId\":\"bogqxndlkzgxhu\",\"provisioningState\":\"Running\",\"requestMessage\":\"bpodxunkbebxm\",\"status\":\"Rejected\"},\"id\":\"ntwlrbqtkoie\",\"name\":\"seotgqrllt\",\"type\":\"u\"},{\"properties\":{\"groupId\":\"auwzizxbmpgc\",\"privateLinkResourceId\":\"efuzmuvpbttd\",\"provisioningState\":\"Canceled\",\"requestMessage\":\"p\",\"status\":\"Pending\"},\"id\":\"mnzb\",\"name\":\"bhjpglkfgohdne\",\"type\":\"el\"},{\"properties\":{\"groupId\":\"hsd\",\"privateLinkResourceId\":\"htozfikdow\",\"provisioningState\":\"Updating\",\"requestMessage\":\"v\",\"status\":\"Rejected\"},\"id\":\"lvithhqzonosgg\",\"name\":\"hcohfwdsjnk\",\"type\":\"ljuti\"},{\"properties\":{\"groupId\":\"wacf\",\"privateLinkResourceId\":\"gdkz\",\"provisioningState\":\"Creating\",\"requestMessage\":\"fvhqc\",\"status\":\"Pending\"},\"id\":\"vpnpp\",\"name\":\"uflrwd\",\"type\":\"hdlxyjrxsagafcn\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"apnedgfbcvkc\",\"liveTraceConfiguration\":{\"enabled\":\"pkeqdcvdrhvoo\",\"categories\":[{\"name\":\"bobzdopcjwvnhd\",\"enabled\":\"wmgxcxrsl\"},{\"name\":\"utwu\",\"enabled\":\"grpkhjwniyqs\"},{\"name\":\"i\",\"enabled\":\"dggkzzlvmbmpa\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"vuefywsbpfvmwyh\",\"enabled\":\"ouyftaakc\"},{\"name\":\"iyzvqtmnub\",\"enabled\":\"kpzksmondjmq\"}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"Trace\"],\"deny\":[\"RESTAPI\",\"RESTAPI\"]},\"privateEndpoints\":[{\"name\":\"ojvpa\",\"allow\":[\"ServerConnection\",\"Trace\",\"ServerConnection\",\"RESTAPI\"],\"deny\":[\"ServerConnection\",\"ClientConnection\",\"ServerConnection\"]},{\"name\":\"fqvm\",\"allow\":[\"ClientConnection\",\"ServerConnection\"],\"deny\":[\"Trace\",\"RESTAPI\",\"Trace\"]},{\"name\":\"lxprglyatddckcbc\",\"allow\":[\"RESTAPI\",\"RESTAPI\",\"ClientConnection\",\"ServerConnection\"],\"deny\":[\"Trace\"]},{\"name\":\"ibrhosxsdqr\",\"allow\":[\"ClientConnection\"],\"deny\":[\"RESTAPI\"]}],\"ipRules\":[{\"value\":\"yiba\",\"action\":\"Allow\"}]},\"publicNetworkAccess\":\"uszdtmhrkwof\",\"disableLocalAuth\":true,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"cpi\",\"resourceStopped\":\"pbtg\",\"socketIO\":{\"serviceMode\":\"wo\"}},\"kind\":\"WebPubSub\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"qiiobyuqer\":{\"principalId\":\"tkcnqxwb\",\"clientId\":\"kulpiujwaasi\"},\"fbtkuwhhmhyk\":{\"principalId\":\"lp\",\"clientId\":\"cciuqgbdbutau\"}},\"principalId\":\"oxafn\",\"tenantId\":\"lpichk\"},\"location\":\"mkcdyhbpkkpwdre\",\"tags\":{\"w\":\"vvqfovljxyws\",\"dsytgadgvr\":\"yrs\",\"neqn\":\"ea\",\"jfqka\":\"arrwlquu\"},\"id\":\"e\",\"name\":\"iipfpubj\",\"type\":\"bwwift\"}") + "{\"properties\":{\"provisioningState\":\"Unknown\",\"externalIP\":\"wvlqdqgb\",\"hostName\":\"ylihkaetckt\",\"publicPort\":1161915494,\"serverPort\":493965696,\"version\":\"snkymuctq\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{\"id\":\"cxerf\"},\"groupIds\":[\"tttxfvjrb\",\"rp\",\"xepcyvahfn\",\"jky\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ujqgidok\",\"actionsRequired\":\"ljyoxgvcltb\"}},\"id\":\"ncghkje\",\"name\":\"zz\",\"type\":\"bijhtxfvgxbf\"},{\"properties\":{\"provisioningState\":\"Unknown\",\"privateEndpoint\":{\"id\":\"mpvecxgodebfqk\"},\"groupIds\":[\"mpukgriw\",\"lzlfbxzpuz\",\"cispnqzahmgkbr\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ibnuqqkpik\",\"actionsRequired\":\"rgvtqag\"}},\"id\":\"uynhijg\",\"name\":\"mebf\",\"type\":\"iarbutrcvpna\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"unmpxttd\"},\"groupIds\":[\"bnlankxmyskpb\",\"enbtkcxywny\",\"nrs\",\"nlqidybyxczf\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"xdbabphlwr\",\"actionsRequired\":\"fkts\"}},\"id\":\"sucocmnyyazttbtw\",\"name\":\"rq\",\"type\":\"uedck\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"iexzfeyue\",\"privateLinkResourceId\":\"xibxujwbhqwalm\",\"provisioningState\":\"Moving\",\"requestMessage\":\"xaepdkzjancuxr\",\"fqdns\":[\"bavxbniwdjswzt\",\"dbpgnxytxhp\",\"xbzpfzab\"],\"status\":\"Disconnected\"},\"id\":\"hxw\",\"name\":\"ctyqik\",\"type\":\"bbovplwzbhvgyugu\"},{\"properties\":{\"groupId\":\"vmkfssxqu\",\"privateLinkResourceId\":\"kfplgmgsxnk\",\"provisioningState\":\"Creating\",\"requestMessage\":\"es\",\"fqdns\":[\"lopwiyig\",\"xpkd\",\"zb\"],\"status\":\"Pending\"},\"id\":\"bbaumnyquped\",\"name\":\"ojnabckhsmtxpsie\",\"type\":\"tfhvpesapskrdqmh\"},{\"properties\":{\"groupId\":\"dhtldwkyz\",\"privateLinkResourceId\":\"uutkncw\",\"provisioningState\":\"Updating\",\"requestMessage\":\"vlxotogtwrupqsx\",\"fqdns\":[\"i\",\"ykvceoveil\",\"vnotyfjfcnj\",\"k\"],\"status\":\"Rejected\"},\"id\":\"hbttkphyw\",\"name\":\"nv\",\"type\":\"t\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"mclfplphoxuscr\",\"liveTraceConfiguration\":{\"enabled\":\"gyepsbjt\",\"categories\":[{\"name\":\"gxywpmue\",\"enabled\":\"jzwf\"},{\"name\":\"q\",\"enabled\":\"ids\"},{\"name\":\"onobglaocqx\",\"enabled\":\"cmgyud\"},{\"name\":\"tlmoyrx\",\"enabled\":\"fudwpznt\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"lrqjbhckfr\",\"enabled\":\"rxsbkyvp\"},{\"name\":\"anuzbpzkafkuw\",\"enabled\":\"rnwb\"}]},\"networkACLs\":{\"defaultAction\":\"Allow\",\"publicNetwork\":{\"allow\":[\"ClientConnection\",\"RESTAPI\",\"ClientConnection\"],\"deny\":[\"RESTAPI\"]},\"privateEndpoints\":[{\"name\":\"hspkdeemao\",\"allow\":[\"ClientConnection\",\"Trace\",\"ClientConnection\",\"ClientConnection\"],\"deny\":[\"ServerConnection\",\"RESTAPI\",\"Trace\"]},{\"name\":\"qkrhahvljua\",\"allow\":[\"ServerConnection\",\"RESTAPI\",\"ClientConnection\"],\"deny\":[\"ClientConnection\",\"ServerConnection\"]}],\"ipRules\":[{\"value\":\"aex\",\"action\":\"Allow\"},{\"value\":\"adm\",\"action\":\"Allow\"},{\"value\":\"r\",\"action\":\"Allow\"},{\"value\":\"vgomz\",\"action\":\"Allow\"}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":777223423530211326},\"publicNetworkAccess\":\"ldawkzbaliourqha\",\"disableLocalAuth\":true,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"hsfwxosowzxcug\",\"resourceStopped\":\"jooxdjebw\",\"socketIO\":{\"serviceMode\":\"wwfvov\"}},\"sku\":{\"name\":\"meue\",\"tier\":\"Premium\",\"size\":\"hzceuojgjrwjue\",\"family\":\"twm\",\"capacity\":1848522994},\"kind\":\"WebPubSub\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"skxfbk\":{\"principalId\":\"rjaw\",\"clientId\":\"wgxhn\"}},\"principalId\":\"cg\",\"tenantId\":\"wndnhj\"},\"location\":\"uwhvylwzbtdhxujz\",\"tags\":{\"wpr\":\"pow\",\"xobbcswsrt\":\"qlveualupjmkh\"},\"id\":\"riplrbpbewtg\",\"name\":\"fgb\",\"type\":\"c\"}") .toObject(WebPubSubResourceInner.class); - Assertions.assertEquals("mkcdyhbpkkpwdre", model.location()); - Assertions.assertEquals("vvqfovljxyws", model.tags().get("w")); - Assertions.assertEquals("hh", model.sku().name()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.location()); + Assertions.assertEquals("pow", model.tags().get("wpr")); + Assertions.assertEquals("meue", model.sku().name()); Assertions.assertEquals(WebPubSubSkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals(42562338, model.sku().capacity()); + Assertions.assertEquals(1848522994, model.sku().capacity()); Assertions.assertEquals(ServiceKind.WEB_PUB_SUB, model.kind()); Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals(true, model.tls().clientCertEnabled()); - Assertions.assertEquals("pkeqdcvdrhvoo", model.liveTraceConfiguration().enabled()); - Assertions.assertEquals("bobzdopcjwvnhd", model.liveTraceConfiguration().categories().get(0).name()); - Assertions.assertEquals("wmgxcxrsl", model.liveTraceConfiguration().categories().get(0).enabled()); - Assertions.assertEquals("vuefywsbpfvmwyh", model.resourceLogConfiguration().categories().get(0).name()); - Assertions.assertEquals("ouyftaakc", model.resourceLogConfiguration().categories().get(0).enabled()); - Assertions.assertEquals(AclAction.DENY, model.networkACLs().defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.TRACE, model.networkACLs().publicNetwork().allow().get(0)); + Assertions.assertTrue(model.tls().clientCertEnabled()); + Assertions.assertEquals("gyepsbjt", model.liveTraceConfiguration().enabled()); + Assertions.assertEquals("gxywpmue", model.liveTraceConfiguration().categories().get(0).name()); + Assertions.assertEquals("jzwf", model.liveTraceConfiguration().categories().get(0).enabled()); + Assertions.assertEquals("lrqjbhckfr", model.resourceLogConfiguration().categories().get(0).name()); + Assertions.assertEquals("rxsbkyvp", model.resourceLogConfiguration().categories().get(0).enabled()); + Assertions.assertEquals(AclAction.ALLOW, model.networkACLs().defaultAction()); + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, + model.networkACLs().publicNetwork().allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.RESTAPI, model.networkACLs().publicNetwork().deny().get(0)); - Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.networkACLs().privateEndpoints().get(0).allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.networkACLs().privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("ojvpa", model.networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("yiba", model.networkACLs().ipRules().get(0).value()); + Assertions.assertEquals("hspkdeemao", model.networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals("aex", model.networkACLs().ipRules().get(0).value()); Assertions.assertEquals(AclAction.ALLOW, model.networkACLs().ipRules().get(0).action()); - Assertions.assertEquals("uszdtmhrkwof", model.publicNetworkAccess()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(false, model.disableAadAuth()); - Assertions.assertEquals("cpi", model.regionEndpointEnabled()); - Assertions.assertEquals("pbtg", model.resourceStopped()); - Assertions.assertEquals("wo", model.socketIO().serviceMode()); + Assertions.assertEquals(777223423530211326L, + model.applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("ldawkzbaliourqha", model.publicNetworkAccess()); + Assertions.assertTrue(model.disableLocalAuth()); + Assertions.assertTrue(model.disableAadAuth()); + Assertions.assertEquals("hsfwxosowzxcug", model.regionEndpointEnabled()); + Assertions.assertEquals("jooxdjebw", model.resourceStopped()); + Assertions.assertEquals("wwfvov", model.socketIO().serviceMode()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WebPubSubResourceInner model = new WebPubSubResourceInner().withLocation("mkcdyhbpkkpwdre") - .withTags(mapOf("w", "vvqfovljxyws", "dsytgadgvr", "yrs", "neqn", "ea", "jfqka", "arrwlquu")) - .withSku(new ResourceSku().withName("hh").withTier(WebPubSubSkuTier.PREMIUM).withCapacity(42562338)) + WebPubSubResourceInner model = new WebPubSubResourceInner().withLocation("uwhvylwzbtdhxujz") + .withTags(mapOf("wpr", "pow", "xobbcswsrt", "qlveualupjmkh")) + .withSku(new ResourceSku().withName("meue").withTier(WebPubSubSkuTier.PREMIUM).withCapacity(1848522994)) .withKind(ServiceKind.WEB_PUB_SUB) .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("qiiobyuqer", new UserAssignedIdentityProperty(), "fbtkuwhhmhyk", - new UserAssignedIdentityProperty()))) + .withUserAssignedIdentities(mapOf("skxfbk", new UserAssignedIdentityProperty()))) .withTls(new WebPubSubTlsSettings().withClientCertEnabled(true)) - .withLiveTraceConfiguration(new LiveTraceConfiguration().withEnabled("pkeqdcvdrhvoo") - .withCategories( - Arrays.asList(new LiveTraceCategory().withName("bobzdopcjwvnhd").withEnabled("wmgxcxrsl"), - new LiveTraceCategory().withName("utwu").withEnabled("grpkhjwniyqs"), - new LiveTraceCategory().withName("i").withEnabled("dggkzzlvmbmpa")))) - .withResourceLogConfiguration(new ResourceLogConfiguration().withCategories( - Arrays.asList(new ResourceLogCategory().withName("vuefywsbpfvmwyh").withEnabled("ouyftaakc"), - new ResourceLogCategory().withName("iyzvqtmnub").withEnabled("kpzksmondjmq")))) - .withNetworkACLs(new WebPubSubNetworkACLs().withDefaultAction(AclAction.DENY) - .withPublicNetwork(new NetworkAcl().withAllow(Arrays.asList(WebPubSubRequestType.TRACE)) - .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI))) - .withPrivateEndpoints(Arrays.asList( - new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.TRACE, - WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.RESTAPI)) - .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.SERVER_CONNECTION)) - .withName("ojvpa"), - new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.RESTAPI, - WebPubSubRequestType.TRACE)) - .withName("fqvm"), - new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI, - WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.SERVER_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.TRACE)) - .withName("lxprglyatddckcbc"), - new PrivateEndpointAcl().withAllow(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION)) - .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI)) - .withName("ibrhosxsdqr"))) - .withIpRules(Arrays.asList(new IpRule().withValue("yiba").withAction(AclAction.ALLOW)))) - .withPublicNetworkAccess("uszdtmhrkwof") + .withLiveTraceConfiguration(new LiveTraceConfiguration().withEnabled("gyepsbjt") + .withCategories(Arrays.asList(new LiveTraceCategory().withName("gxywpmue").withEnabled("jzwf"), + new LiveTraceCategory().withName("q").withEnabled("ids"), + new LiveTraceCategory().withName("onobglaocqx").withEnabled("cmgyud"), + new LiveTraceCategory().withName("tlmoyrx").withEnabled("fudwpznt")))) + .withResourceLogConfiguration(new ResourceLogConfiguration() + .withCategories(Arrays.asList(new ResourceLogCategory().withName("lrqjbhckfr").withEnabled("rxsbkyvp"), + new ResourceLogCategory().withName("anuzbpzkafkuw").withEnabled("rnwb")))) + .withNetworkACLs( + new WebPubSubNetworkACLs().withDefaultAction(AclAction.ALLOW) + .withPublicNetwork(new NetworkAcl() + .withAllow(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.RESTAPI, + WebPubSubRequestType.CLIENT_CONNECTION)) + .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI))) + .withPrivateEndpoints(Arrays.asList( + new PrivateEndpointAcl() + .withAllow(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.TRACE, + WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.CLIENT_CONNECTION)) + .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, + WebPubSubRequestType.RESTAPI, WebPubSubRequestType.TRACE)) + .withName("hspkdeemao"), + new PrivateEndpointAcl() + .withAllow(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, + WebPubSubRequestType.RESTAPI, WebPubSubRequestType.CLIENT_CONNECTION)) + .withDeny(Arrays.asList(WebPubSubRequestType.CLIENT_CONNECTION, + WebPubSubRequestType.SERVER_CONNECTION)) + .withName("qkrhahvljua"))) + .withIpRules(Arrays.asList(new IpRule().withValue("aex").withAction(AclAction.ALLOW), + new IpRule().withValue("adm").withAction(AclAction.ALLOW), + new IpRule().withValue("r").withAction(AclAction.ALLOW), + new IpRule().withValue("vgomz").withAction(AclAction.ALLOW)))) + .withApplicationFirewall(new ApplicationFirewallSettings() + .withClientConnectionCountRules(Arrays.asList(new ClientConnectionCountRule())) + .withClientTrafficControlRules(Arrays.asList(new ClientTrafficControlRule(), + new ClientTrafficControlRule(), new ClientTrafficControlRule())) + .withMaxClientConnectionLifetimeInSeconds(777223423530211326L)) + .withPublicNetworkAccess("ldawkzbaliourqha") .withDisableLocalAuth(true) - .withDisableAadAuth(false) - .withRegionEndpointEnabled("cpi") - .withResourceStopped("pbtg") - .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("wo")); + .withDisableAadAuth(true) + .withRegionEndpointEnabled("hsfwxosowzxcug") + .withResourceStopped("jooxdjebw") + .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("wwfvov")); model = BinaryData.fromObject(model).toObject(WebPubSubResourceInner.class); - Assertions.assertEquals("mkcdyhbpkkpwdre", model.location()); - Assertions.assertEquals("vvqfovljxyws", model.tags().get("w")); - Assertions.assertEquals("hh", model.sku().name()); + Assertions.assertEquals("uwhvylwzbtdhxujz", model.location()); + Assertions.assertEquals("pow", model.tags().get("wpr")); + Assertions.assertEquals("meue", model.sku().name()); Assertions.assertEquals(WebPubSubSkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals(42562338, model.sku().capacity()); + Assertions.assertEquals(1848522994, model.sku().capacity()); Assertions.assertEquals(ServiceKind.WEB_PUB_SUB, model.kind()); Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals(true, model.tls().clientCertEnabled()); - Assertions.assertEquals("pkeqdcvdrhvoo", model.liveTraceConfiguration().enabled()); - Assertions.assertEquals("bobzdopcjwvnhd", model.liveTraceConfiguration().categories().get(0).name()); - Assertions.assertEquals("wmgxcxrsl", model.liveTraceConfiguration().categories().get(0).enabled()); - Assertions.assertEquals("vuefywsbpfvmwyh", model.resourceLogConfiguration().categories().get(0).name()); - Assertions.assertEquals("ouyftaakc", model.resourceLogConfiguration().categories().get(0).enabled()); - Assertions.assertEquals(AclAction.DENY, model.networkACLs().defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.TRACE, model.networkACLs().publicNetwork().allow().get(0)); + Assertions.assertTrue(model.tls().clientCertEnabled()); + Assertions.assertEquals("gyepsbjt", model.liveTraceConfiguration().enabled()); + Assertions.assertEquals("gxywpmue", model.liveTraceConfiguration().categories().get(0).name()); + Assertions.assertEquals("jzwf", model.liveTraceConfiguration().categories().get(0).enabled()); + Assertions.assertEquals("lrqjbhckfr", model.resourceLogConfiguration().categories().get(0).name()); + Assertions.assertEquals("rxsbkyvp", model.resourceLogConfiguration().categories().get(0).enabled()); + Assertions.assertEquals(AclAction.ALLOW, model.networkACLs().defaultAction()); + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, + model.networkACLs().publicNetwork().allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.RESTAPI, model.networkACLs().publicNetwork().deny().get(0)); - Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.networkACLs().privateEndpoints().get(0).allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, model.networkACLs().privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("ojvpa", model.networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("yiba", model.networkACLs().ipRules().get(0).value()); + Assertions.assertEquals("hspkdeemao", model.networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals("aex", model.networkACLs().ipRules().get(0).value()); Assertions.assertEquals(AclAction.ALLOW, model.networkACLs().ipRules().get(0).action()); - Assertions.assertEquals("uszdtmhrkwof", model.publicNetworkAccess()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(false, model.disableAadAuth()); - Assertions.assertEquals("cpi", model.regionEndpointEnabled()); - Assertions.assertEquals("pbtg", model.resourceStopped()); - Assertions.assertEquals("wo", model.socketIO().serviceMode()); + Assertions.assertEquals(777223423530211326L, + model.applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("ldawkzbaliourqha", model.publicNetworkAccess()); + Assertions.assertTrue(model.disableLocalAuth()); + Assertions.assertTrue(model.disableAadAuth()); + Assertions.assertEquals("hsfwxosowzxcug", model.regionEndpointEnabled()); + Assertions.assertEquals("jooxdjebw", model.resourceStopped()); + Assertions.assertEquals("wwfvov", model.socketIO().serviceMode()); } // Use "Map.of" if available diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubResourceListTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubResourceListTests.java index 59c64766eb35..e4f0915e2996 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubResourceListTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubResourceListTests.java @@ -1,248 +1,47 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.webpubsub.fluent.models.WebPubSubResourceInner; +import com.azure.resourcemanager.webpubsub.implementation.models.WebPubSubResourceList; import com.azure.resourcemanager.webpubsub.models.AclAction; -import com.azure.resourcemanager.webpubsub.models.IpRule; -import com.azure.resourcemanager.webpubsub.models.LiveTraceCategory; -import com.azure.resourcemanager.webpubsub.models.LiveTraceConfiguration; -import com.azure.resourcemanager.webpubsub.models.ManagedIdentity; import com.azure.resourcemanager.webpubsub.models.ManagedIdentityType; -import com.azure.resourcemanager.webpubsub.models.NetworkAcl; -import com.azure.resourcemanager.webpubsub.models.PrivateEndpointAcl; -import com.azure.resourcemanager.webpubsub.models.ResourceLogCategory; -import com.azure.resourcemanager.webpubsub.models.ResourceLogConfiguration; -import com.azure.resourcemanager.webpubsub.models.ResourceSku; import com.azure.resourcemanager.webpubsub.models.ServiceKind; -import com.azure.resourcemanager.webpubsub.models.UserAssignedIdentityProperty; -import com.azure.resourcemanager.webpubsub.models.WebPubSubNetworkACLs; import com.azure.resourcemanager.webpubsub.models.WebPubSubRequestType; -import com.azure.resourcemanager.webpubsub.models.WebPubSubResourceList; import com.azure.resourcemanager.webpubsub.models.WebPubSubSkuTier; -import com.azure.resourcemanager.webpubsub.models.WebPubSubSocketIOSettings; -import com.azure.resourcemanager.webpubsub.models.WebPubSubTlsSettings; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class WebPubSubResourceListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WebPubSubResourceList model = BinaryData.fromString( - "{\"value\":[{\"sku\":{\"name\":\"tpngjcrcczsqpjh\",\"tier\":\"Free\",\"size\":\"jvnysounqe\",\"family\":\"noae\",\"capacity\":1901274446},\"properties\":{\"provisioningState\":\"Deleting\",\"externalIP\":\"trpmo\",\"hostName\":\"mcmatuokthfuiu\",\"publicPort\":1445775245,\"serverPort\":680550088,\"version\":\"pk\",\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"uozmyzydagfua\",\"name\":\"bezy\",\"type\":\"uokktwhrdxwz\"},{\"properties\":{},\"id\":\"sm\",\"name\":\"surex\",\"type\":\"moryocfsfksym\"},{\"properties\":{},\"id\":\"stkiiuxhqyud\",\"name\":\"o\",\"type\":\"rq\"},{\"properties\":{},\"id\":\"oczvy\",\"name\":\"fqrvkdvjsllrmvvd\",\"type\":\"watkpnpulexxb\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"ruwiqzbqjvsov\",\"privateLinkResourceId\":\"yokacspkw\"},\"id\":\"zdobpxjmflbvvnch\",\"name\":\"kcciwwzjuqkhr\",\"type\":\"ajiwkuo\"},{\"properties\":{\"groupId\":\"skghsauuimj\",\"privateLinkResourceId\":\"vxieduugidyj\"},\"id\":\"f\",\"name\":\"y\",\"type\":\"osvexcsonpclhoc\"},{\"properties\":{\"groupId\":\"slkevle\",\"privateLinkResourceId\":\"gz\"},\"id\":\"u\",\"name\":\"fmvfaxkffeiit\",\"type\":\"lvmezyvshxmzsbbz\"},{\"properties\":{\"groupId\":\"gigr\",\"privateLinkResourceId\":\"wburvjxxjnspydpt\"},\"id\":\"enkouknvudw\",\"name\":\"iukbldngkpoci\",\"type\":\"azyxoegukg\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"cgygev\",\"liveTraceConfiguration\":{\"enabled\":\"typmrbpizcdrqjsd\",\"categories\":[{},{},{},{}]},\"resourceLogConfiguration\":{\"categories\":[{},{},{},{}]},\"networkACLs\":{\"defaultAction\":\"Allow\",\"publicNetwork\":{\"allow\":[\"RESTAPI\",\"ClientConnection\",\"RESTAPI\"],\"deny\":[\"Trace\"]},\"privateEndpoints\":[{\"name\":\"jttgzf\"},{\"name\":\"ishc\"},{\"name\":\"khaj\"}],\"ipRules\":[{},{},{},{}]},\"publicNetworkAccess\":\"a\",\"disableLocalAuth\":false,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"alpbuxwgipwhon\",\"resourceStopped\":\"kgshwa\",\"socketIO\":{\"serviceMode\":\"xzbinjeputt\"}},\"kind\":\"WebPubSub\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"qqn\":{\"principalId\":\"ftiyqzrnkcq\",\"clientId\":\"xlwhzlsicoh\"},\"mqhgyxzkonocuk\":{\"principalId\":\"lryav\",\"clientId\":\"heun\"},\"eyp\":{\"principalId\":\"lyaxuc\",\"clientId\":\"uqszfk\"},\"frzpwvlqdqgb\":{\"principalId\":\"rmjmwvvjektc\",\"clientId\":\"enhwlrs\"}},\"principalId\":\"ylihkaetckt\",\"tenantId\":\"civfsnkymuctq\"},\"location\":\"fbebrjcxer\",\"tags\":{\"xepcyvahfn\":\"utttxfvjrbirp\",\"xjvuujqgidokg\":\"jky\",\"sncghkjeszz\":\"ljyoxgvcltb\"},\"id\":\"bijhtxfvgxbf\",\"name\":\"mxnehmp\",\"type\":\"ec\"},{\"sku\":{\"name\":\"odebfqkkrbmpu\",\"tier\":\"Standard\",\"size\":\"wflzlfbxzpuzy\",\"family\":\"spnqzahmgkb\",\"capacity\":567432535},\"properties\":{\"provisioningState\":\"Deleting\",\"externalIP\":\"bnuqqkpik\",\"hostName\":\"rgvtqag\",\"publicPort\":1873718862,\"serverPort\":855671205,\"version\":\"ijggmebfsiar\",\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"vpnazzm\",\"name\":\"jrunmpxtt\",\"type\":\"bh\"},{\"properties\":{},\"id\":\"l\",\"name\":\"nkxmyskpbhenbtk\",\"type\":\"xywnytnrsynlqidy\"},{\"properties\":{},\"id\":\"czfc\",\"name\":\"haaxdbabphl\",\"type\":\"rqlfktsthsucocmn\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"t\",\"privateLinkResourceId\":\"bt\"},\"id\":\"rq\",\"name\":\"uedck\",\"type\":\"ywbiexzfeyueax\"}],\"tls\":{\"clientCertEnabled\":false},\"hostNamePrefix\":\"wbhqwal\",\"liveTraceConfiguration\":{\"enabled\":\"yoxa\",\"categories\":[{},{},{}]},\"resourceLogConfiguration\":{\"categories\":[{},{}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"Trace\",\"ClientConnection\",\"RESTAPI\"],\"deny\":[\"ClientConnection\",\"ServerConnection\",\"ServerConnection\",\"ServerConnection\"]},\"privateEndpoints\":[{\"name\":\"djswztsdbp\"}],\"ipRules\":[{},{},{}]},\"publicNetworkAccess\":\"txhp\",\"disableLocalAuth\":false,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"zabglcuhxwt\",\"resourceStopped\":\"yqiklbbovplwzb\",\"socketIO\":{\"serviceMode\":\"yuguosvmkfssx\"}},\"kind\":\"WebPubSub\",\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"xpkd\":{\"principalId\":\"gsxnkjzkdeslpv\",\"clientId\":\"pwiyig\"},\"ojnabckhsmtxpsie\":{\"principalId\":\"baiuebbaumny\",\"clientId\":\"ped\"},\"jdhtldwkyzxu\":{\"principalId\":\"fhvpesaps\",\"clientId\":\"dqmh\"}},\"principalId\":\"kn\",\"tenantId\":\"scwsv\"},\"location\":\"otogtwrupqs\",\"tags\":{\"notyfjfcnjbkcn\":\"micykvceoveilo\"},\"id\":\"dhbt\",\"name\":\"kphywpnvjto\",\"type\":\"nermcl\"},{\"sku\":{\"name\":\"lphox\",\"tier\":\"Basic\",\"size\":\"pabgyeps\",\"family\":\"tazqugxywpmueefj\",\"capacity\":1541291640},\"properties\":{\"provisioningState\":\"Deleting\",\"externalIP\":\"jidsuyonobglaoc\",\"hostName\":\"tcc\",\"publicPort\":528280521,\"serverPort\":1054992005,\"version\":\"ytlmoyrxvwfud\",\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"xhdzhlrqjbhckf\",\"name\":\"lhrxsbkyvpyc\",\"type\":\"n\"},{\"properties\":{},\"id\":\"p\",\"name\":\"kafkuwbcrnwbm\",\"type\":\"hhseyv\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"tslhspkdeem\",\"privateLinkResourceId\":\"ofmxagkvtmelmqkr\"},\"id\":\"hvljuahaquh\",\"name\":\"dhmdua\",\"type\":\"aex\"},{\"properties\":{\"groupId\":\"vfadmws\",\"privateLinkResourceId\":\"crgvxpvgom\"},\"id\":\"fmisg\",\"name\":\"bnbbeldawkz\",\"type\":\"ali\"},{\"properties\":{\"groupId\":\"rqhakauha\",\"privateLinkResourceId\":\"hsfwxosowzxcug\"},\"id\":\"jooxdjebw\",\"name\":\"ucww\",\"type\":\"vo\"},{\"properties\":{\"groupId\":\"vmeueci\",\"privateLinkResourceId\":\"yhz\"},\"id\":\"uojgj\",\"name\":\"wjue\",\"type\":\"otwmcdyt\"}],\"tls\":{\"clientCertEnabled\":false},\"hostNamePrefix\":\"xnrj\",\"liveTraceConfiguration\":{\"enabled\":\"qwgxhniskx\",\"categories\":[{},{},{},{}]},\"resourceLogConfiguration\":{\"categories\":[{}]},\"networkACLs\":{\"defaultAction\":\"Allow\",\"publicNetwork\":{\"allow\":[\"ServerConnection\",\"RESTAPI\",\"ServerConnection\",\"Trace\"],\"deny\":[\"ServerConnection\",\"ServerConnection\",\"RESTAPI\",\"ClientConnection\"]},\"privateEndpoints\":[{\"name\":\"zbtd\"},{\"name\":\"xujznbmpowu\"}],\"ipRules\":[{},{}]},\"publicNetworkAccess\":\"qlveualupjmkh\",\"disableLocalAuth\":false,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"sw\",\"resourceStopped\":\"tjrip\",\"socketIO\":{\"serviceMode\":\"pbewtghfgblcgwx\"}},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"wrtz\":{\"principalId\":\"egibtnmxiebww\",\"clientId\":\"oayqc\"},\"xongmtsavjcbpwxq\":{\"principalId\":\"zg\",\"clientId\":\"zmh\"}},\"principalId\":\"rknftguvriuhprwm\",\"tenantId\":\"vxqtayriwwroyqbe\"},\"location\":\"mcqibycnojv\",\"tags\":{\"qsgzvahapj\":\"e\",\"zlmwlxkvugfhz\":\"zhpvgqzcjrvxd\",\"hnnpr\":\"vawjvzunlu\",\"ultskzbbtdz\":\"xipeilpjzuaejx\"},\"id\":\"mv\",\"name\":\"ekg\",\"type\":\"wozuhkf\"},{\"sku\":{\"name\":\"sjyofdx\",\"tier\":\"Free\",\"size\":\"dttouwaboekqvkel\",\"family\":\"mvb\",\"capacity\":1393240700},\"properties\":{\"provisioningState\":\"Canceled\",\"externalIP\":\"hhcaal\",\"hostName\":\"ixisxyawjoy\",\"publicPort\":1772436776,\"serverPort\":1260853084,\"version\":\"jpkiidzyexznelix\",\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"folhbnxknal\",\"name\":\"ulppggdtpnapnyir\",\"type\":\"pu\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"vpgylgqgitxmed\",\"privateLinkResourceId\":\"v\"},\"id\":\"lynqwwncwzzh\",\"name\":\"gktrmgucnapkte\",\"type\":\"ellwptfdy\"},{\"properties\":{\"groupId\":\"fqbuaceopzf\",\"privateLinkResourceId\":\"rhhuaopppcqeqx\"},\"id\":\"z\",\"name\":\"ahzxctobgbk\",\"type\":\"moizpos\"}],\"tls\":{\"clientCertEnabled\":false},\"hostNamePrefix\":\"fbunrmfqjhhk\",\"liveTraceConfiguration\":{\"enabled\":\"vjymjhxxjyngud\",\"categories\":[{},{},{}]},\"resourceLogConfiguration\":{\"categories\":[{},{}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"Trace\",\"ClientConnection\",\"RESTAPI\",\"RESTAPI\"],\"deny\":[\"ServerConnection\",\"ClientConnection\",\"Trace\"]},\"privateEndpoints\":[{\"name\":\"xivetvt\"},{\"name\":\"qaqtdoqmcbxvwvxy\"}],\"ipRules\":[{},{},{}]},\"publicNetworkAccess\":\"hsfxoblytkb\",\"disableLocalAuth\":false,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"wfbkrvrns\",\"resourceStopped\":\"hqjohxcrsbfova\",\"socketIO\":{\"serviceMode\":\"uvwbhsqfs\"}},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"sotftpvj\":{\"principalId\":\"bpybsrfbjf\",\"clientId\":\"w\"},\"jhwqytjrybnw\":{\"principalId\":\"exilzznfqqnvwpmq\",\"clientId\":\"ruoujmk\"}},\"principalId\":\"wgdrjervnaenqp\",\"tenantId\":\"indoygmifthnzd\"},\"location\":\"sl\",\"tags\":{\"gynduha\":\"yq\",\"bgycduiertgccym\":\"hqlkthumaqo\",\"lqlfm\":\"aolps\"},\"id\":\"dnbbglzps\",\"name\":\"iydmcwyhzdxs\",\"type\":\"adbzmnvdfznud\"}],\"nextLink\":\"dvxzbncblylpst\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Moving\",\"externalIP\":\"mueedndrdvstk\",\"hostName\":\"qtc\",\"publicPort\":646701908,\"serverPort\":848929691,\"version\":\"mtdaa\",\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"vgpiohgwxrt\",\"name\":\"udxepxgyqagv\",\"type\":\"vmnpkukghimdblx\"},{\"properties\":{},\"id\":\"mfnjh\",\"name\":\"j\",\"type\":\"wmszkk\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"eyfkzikfja\",\"privateLinkResourceId\":\"n\"},\"id\":\"ivx\",\"name\":\"czelpcirel\",\"type\":\"feaenwab\"},{\"properties\":{\"groupId\":\"tkl\",\"privateLinkResourceId\":\"dxbjhwuaanozj\"},\"id\":\"ph\",\"name\":\"oulpjrv\",\"type\":\"ag\"}],\"tls\":{\"clientCertEnabled\":false},\"hostNamePrefix\":\"jwosytxitcskfck\",\"liveTraceConfiguration\":{\"enabled\":\"miekkezzikhlyfjh\",\"categories\":[{}]},\"resourceLogConfiguration\":{\"categories\":[{},{}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"Trace\"],\"deny\":[\"ClientConnection\",\"ClientConnection\",\"Trace\",\"Trace\"]},\"privateEndpoints\":[{\"name\":\"t\"},{\"name\":\"xllrxcyjm\"}],\"ipRules\":[{},{},{},{}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":3120227000201481868},\"publicNetworkAccess\":\"mjsjqb\",\"disableLocalAuth\":true,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"rw\",\"resourceStopped\":\"co\",\"socketIO\":{\"serviceMode\":\"p\"}},\"sku\":{\"name\":\"kgymareqnajxqug\",\"tier\":\"Free\",\"size\":\"cubeddgssofw\",\"family\":\"zqalkrmnjijpx\",\"capacity\":222517676},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"uzqogsexnevf\":{\"principalId\":\"baaa\",\"clientId\":\"yvayffimrzr\"},\"trthzvaytdwkqbr\":{\"principalId\":\"wnwmewzs\",\"clientId\":\"ceuzsoibjudpfr\"},\"tdqoaxoruzfgsq\":{\"principalId\":\"bpaxhexiilivpdt\",\"clientId\":\"r\"},\"uqlcvydy\":{\"principalId\":\"fxrxxle\",\"clientId\":\"ramxjezwlwnw\"}},\"principalId\":\"tdooaoj\",\"tenantId\":\"iodkooebwnujhem\"},\"location\":\"bvdkcrodtjin\",\"tags\":{\"jvefkdlfoakggkfp\":\"lfltka\",\"qjnsjervtia\":\"gaowpulpqblylsyx\",\"kfzbeyvpnqicvi\":\"xsdszuempsb\",\"jjxd\":\"v\"},\"id\":\"rbuukzclewyhmlwp\",\"name\":\"ztzp\",\"type\":\"fn\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"externalIP\":\"fz\",\"hostName\":\"hxx\",\"publicPort\":367050204,\"serverPort\":27324889,\"version\":\"zfeqztppri\",\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"jaltolmnc\",\"name\":\"sobqw\",\"type\":\"sdbnwdcfhucqdpf\"},{\"properties\":{},\"id\":\"lsbjjcanvxbv\",\"name\":\"vudutncor\",\"type\":\"r\"},{\"properties\":{},\"id\":\"tvcof\",\"name\":\"dflvkg\",\"type\":\"u\"},{\"properties\":{},\"id\":\"knnqvsaznq\",\"name\":\"tor\",\"type\":\"dsg\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"kycgrauwj\",\"privateLinkResourceId\":\"etaebu\"},\"id\":\"vdmovsmzlxwabm\",\"name\":\"oefki\",\"type\":\"rvtp\"}],\"tls\":{\"clientCertEnabled\":false},\"hostNamePrefix\":\"qlgkfbtn\",\"liveTraceConfiguration\":{\"enabled\":\"ongbjcnt\",\"categories\":[{}]},\"resourceLogConfiguration\":{\"categories\":[{}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"ClientConnection\",\"RESTAPI\",\"ClientConnection\"],\"deny\":[\"Trace\",\"ClientConnection\",\"ServerConnection\"]},\"privateEndpoints\":[{\"name\":\"zfoqouicybxar\"},{\"name\":\"gszufoxciqopid\"}],\"ipRules\":[{},{},{},{}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":2447922519823855507},\"publicNetworkAccess\":\"xkhnzbonlwnto\",\"disableLocalAuth\":false,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"bwh\",\"resourceStopped\":\"z\",\"socketIO\":{\"serviceMode\":\"rvexztvb\"}},\"sku\":{\"name\":\"gsfraoyzkoow\",\"tier\":\"Premium\",\"size\":\"guxawqaldsyuuxi\",\"family\":\"rqf\",\"capacity\":62182202},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"sd\":{\"principalId\":\"t\",\"clientId\":\"fhpagmhrskdsnf\"},\"ewpusdsttwvogvb\":{\"principalId\":\"kgtdlmkkze\",\"clientId\":\"l\"}},\"principalId\":\"jdcngqqm\",\"tenantId\":\"kufgmj\"},\"location\":\"wr\",\"tags\":{\"bminrfdwoyuhhzi\":\"twaenuuzko\",\"zqhof\":\"iefozbhdmsml\",\"ah\":\"rmaequ\"},\"id\":\"icslfaoq\",\"name\":\"piyylhalnswhccsp\",\"type\":\"kaivwit\"},{\"properties\":{\"provisioningState\":\"Running\",\"externalIP\":\"uggwolu\",\"hostName\":\"zbwemh\",\"publicPort\":200585156,\"serverPort\":1060937316,\"version\":\"gzd\",\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"ypqwdxggiccc\",\"name\":\"xqhuexm\",\"type\":\"ttlstvlzywemhz\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"dtclusiypb\",\"privateLinkResourceId\":\"fgytguslfeadcyg\"},\"id\":\"kyhejhzisxgf\",\"name\":\"elolppvksrpqvuj\",\"type\":\"raehtwdwrft\"},{\"properties\":{\"groupId\":\"iby\",\"privateLinkResourceId\":\"cdl\"},\"id\":\"shfwpracstwity\",\"name\":\"hevxcced\",\"type\":\"pnmdyodnwzxltjcv\"},{\"properties\":{\"groupId\":\"ltiugcxnavv\",\"privateLinkResourceId\":\"xqi\"},\"id\":\"qunyowxwlmdjr\",\"name\":\"vfgbvfvpdboda\",\"type\":\"izsjqlhkrr\"},{\"properties\":{\"groupId\":\"deibqip\",\"privateLinkResourceId\":\"kghv\"},\"id\":\"dzwmkrefajpj\",\"name\":\"rwkq\",\"type\":\"yhgbijtjivfx\"}],\"tls\":{\"clientCertEnabled\":false},\"hostNamePrefix\":\"ibsystawf\",\"liveTraceConfiguration\":{\"enabled\":\"pvkvpbjxbk\",\"categories\":[{},{}]},\"resourceLogConfiguration\":{\"categories\":[{},{},{}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"RESTAPI\",\"Trace\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"ServerConnection\"]},\"privateEndpoints\":[{\"name\":\"kzhjj\"}],\"ipRules\":[{},{},{}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":3068271003586260476},\"publicNetworkAccess\":\"zrfze\",\"disableLocalAuth\":true,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"ikayuhqlbjbsybb\",\"resourceStopped\":\"r\",\"socketIO\":{\"serviceMode\":\"dgmfpgvmpipasl\"}},\"sku\":{\"name\":\"aqfxss\",\"tier\":\"Free\",\"size\":\"wbdsr\",\"family\":\"pdrhne\",\"capacity\":744673253},\"kind\":\"WebPubSub\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"av\":{\"principalId\":\"sibircgpi\",\"clientId\":\"zimejzanlfzx\"}},\"principalId\":\"bzonok\",\"tenantId\":\"rjqc\"},\"location\":\"gzpfrla\",\"tags\":{\"pj\":\"rnwoiindfp\"},\"id\":\"lwbtlhf\",\"name\":\"sj\",\"type\":\"dhszfjv\"}],\"nextLink\":\"gofel\"}") .toObject(WebPubSubResourceList.class); - Assertions.assertEquals("fbebrjcxer", model.value().get(0).location()); - Assertions.assertEquals("utttxfvjrbirp", model.value().get(0).tags().get("xepcyvahfn")); - Assertions.assertEquals("tpngjcrcczsqpjh", model.value().get(0).sku().name()); + Assertions.assertEquals("bvdkcrodtjin", model.value().get(0).location()); + Assertions.assertEquals("lfltka", model.value().get(0).tags().get("jvefkdlfoakggkfp")); + Assertions.assertEquals("kgymareqnajxqug", model.value().get(0).sku().name()); Assertions.assertEquals(WebPubSubSkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals(1901274446, model.value().get(0).sku().capacity()); - Assertions.assertEquals(ServiceKind.WEB_PUB_SUB, model.value().get(0).kind()); + Assertions.assertEquals(222517676, model.value().get(0).sku().capacity()); + Assertions.assertEquals(ServiceKind.SOCKET_IO, model.value().get(0).kind()); Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(true, model.value().get(0).tls().clientCertEnabled()); - Assertions.assertEquals("typmrbpizcdrqjsd", model.value().get(0).liveTraceConfiguration().enabled()); - Assertions.assertEquals(AclAction.ALLOW, model.value().get(0).networkACLs().defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.RESTAPI, - model.value().get(0).networkACLs().publicNetwork().allow().get(0)); + Assertions.assertFalse(model.value().get(0).tls().clientCertEnabled()); + Assertions.assertEquals("miekkezzikhlyfjh", model.value().get(0).liveTraceConfiguration().enabled()); + Assertions.assertEquals(AclAction.DENY, model.value().get(0).networkACLs().defaultAction()); Assertions.assertEquals(WebPubSubRequestType.TRACE, - model.value().get(0).networkACLs().publicNetwork().deny().get(0)); - Assertions.assertEquals("jttgzf", model.value().get(0).networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("a", model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals(false, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(true, model.value().get(0).disableAadAuth()); - Assertions.assertEquals("alpbuxwgipwhon", model.value().get(0).regionEndpointEnabled()); - Assertions.assertEquals("kgshwa", model.value().get(0).resourceStopped()); - Assertions.assertEquals("xzbinjeputt", model.value().get(0).socketIO().serviceMode()); - Assertions.assertEquals("dvxzbncblylpst", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WebPubSubResourceList model - = new WebPubSubResourceList() - .withValue( - Arrays - .asList( - new WebPubSubResourceInner().withLocation("fbebrjcxer") - .withTags(mapOf("xepcyvahfn", "utttxfvjrbirp", "xjvuujqgidokg", "jky", "sncghkjeszz", - "ljyoxgvcltb")) - .withSku(new ResourceSku().withName("tpngjcrcczsqpjh") - .withTier(WebPubSubSkuTier.FREE) - .withCapacity(1901274446)) - .withKind(ServiceKind.WEB_PUB_SUB) - .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("qqn", new UserAssignedIdentityProperty(), - "mqhgyxzkonocuk", new UserAssignedIdentityProperty(), "eyp", - new UserAssignedIdentityProperty(), "frzpwvlqdqgb", - new UserAssignedIdentityProperty()))) - .withTls(new WebPubSubTlsSettings().withClientCertEnabled(true)) - .withLiveTraceConfiguration(new LiveTraceConfiguration().withEnabled("typmrbpizcdrqjsd") - .withCategories(Arrays.asList(new LiveTraceCategory(), new LiveTraceCategory(), - new LiveTraceCategory(), new LiveTraceCategory()))) - .withResourceLogConfiguration(new ResourceLogConfiguration().withCategories( - Arrays.asList(new ResourceLogCategory(), new ResourceLogCategory(), - new ResourceLogCategory(), new ResourceLogCategory()))) - .withNetworkACLs(new WebPubSubNetworkACLs().withDefaultAction(AclAction.ALLOW) - .withPublicNetwork(new NetworkAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI, - WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.RESTAPI)) - .withDeny(Arrays.asList(WebPubSubRequestType.TRACE))) - .withPrivateEndpoints(Arrays.asList( - new PrivateEndpointAcl().withName("jttgzf"), - new PrivateEndpointAcl().withName("ishc"), - new PrivateEndpointAcl().withName("khaj"))) - .withIpRules(Arrays.asList(new IpRule(), new IpRule(), new IpRule(), new IpRule()))) - .withPublicNetworkAccess("a") - .withDisableLocalAuth(false) - .withDisableAadAuth(true) - .withRegionEndpointEnabled("alpbuxwgipwhon") - .withResourceStopped("kgshwa") - .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("xzbinjeputt")), - new WebPubSubResourceInner().withLocation("otogtwrupqs") - .withTags(mapOf("notyfjfcnjbkcn", "micykvceoveilo")) - .withSku(new ResourceSku().withName("odebfqkkrbmpu") - .withTier(WebPubSubSkuTier.STANDARD) - .withCapacity(567432535)) - .withKind(ServiceKind.WEB_PUB_SUB) - .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.NONE) - .withUserAssignedIdentities(mapOf("xpkd", new UserAssignedIdentityProperty(), - "ojnabckhsmtxpsie", new UserAssignedIdentityProperty(), "jdhtldwkyzxu", - new UserAssignedIdentityProperty()))) - .withTls(new WebPubSubTlsSettings().withClientCertEnabled(false)) - .withLiveTraceConfiguration(new LiveTraceConfiguration() - .withEnabled("yoxa") - .withCategories( - Arrays.asList(new LiveTraceCategory(), new LiveTraceCategory(), - new LiveTraceCategory()))) - .withResourceLogConfiguration(new ResourceLogConfiguration().withCategories( - Arrays.asList(new ResourceLogCategory(), new ResourceLogCategory()))) - .withNetworkACLs(new WebPubSubNetworkACLs().withDefaultAction(AclAction.DENY) - .withPublicNetwork(new NetworkAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.TRACE, - WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.RESTAPI)) - .withDeny(Arrays.asList( - WebPubSubRequestType.CLIENT_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION))) - .withPrivateEndpoints( - Arrays.asList(new PrivateEndpointAcl().withName("djswztsdbp"))) - .withIpRules(Arrays.asList(new IpRule(), new IpRule(), new IpRule()))) - .withPublicNetworkAccess("txhp") - .withDisableLocalAuth(false) - .withDisableAadAuth(false) - .withRegionEndpointEnabled("zabglcuhxwt") - .withResourceStopped("yqiklbbovplwzb") - .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("yuguosvmkfssx")), - new WebPubSubResourceInner().withLocation("mcqibycnojv") - .withTags(mapOf("qsgzvahapj", "e", "zlmwlxkvugfhz", "zhpvgqzcjrvxd", "hnnpr", - "vawjvzunlu", "ultskzbbtdz", "xipeilpjzuaejx")) - .withSku(new ResourceSku().withName("lphox") - .withTier(WebPubSubSkuTier.BASIC) - .withCapacity(1541291640)) - .withKind(ServiceKind.SOCKET_IO) - .withIdentity(new ManagedIdentity() - .withType(ManagedIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("wrtz", new UserAssignedIdentityProperty(), - "xongmtsavjcbpwxq", new UserAssignedIdentityProperty()))) - .withTls(new WebPubSubTlsSettings().withClientCertEnabled(false)) - .withLiveTraceConfiguration(new LiveTraceConfiguration() - .withEnabled("qwgxhniskx") - .withCategories( - Arrays.asList(new LiveTraceCategory(), new LiveTraceCategory(), - new LiveTraceCategory(), new LiveTraceCategory()))) - .withResourceLogConfiguration(new ResourceLogConfiguration() - .withCategories(Arrays.asList(new ResourceLogCategory()))) - .withNetworkACLs(new WebPubSubNetworkACLs().withDefaultAction(AclAction.ALLOW) - .withPublicNetwork(new NetworkAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.RESTAPI, WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.TRACE)) - .withDeny( - Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.RESTAPI, - WebPubSubRequestType.CLIENT_CONNECTION))) - .withPrivateEndpoints(Arrays.asList( - new PrivateEndpointAcl().withName("zbtd"), - new PrivateEndpointAcl().withName("xujznbmpowu"))) - .withIpRules(Arrays.asList(new IpRule(), new IpRule()))) - .withPublicNetworkAccess("qlveualupjmkh") - .withDisableLocalAuth(false) - .withDisableAadAuth(false) - .withRegionEndpointEnabled("sw") - .withResourceStopped("tjrip") - .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("pbewtghfgblcgwx")), - new WebPubSubResourceInner().withLocation("sl") - .withTags(mapOf("gynduha", "yq", "bgycduiertgccym", "hqlkthumaqo", "lqlfm", "aolps")) - .withSku(new ResourceSku().withName("sjyofdx") - .withTier(WebPubSubSkuTier.FREE) - .withCapacity(1393240700)) - .withKind(ServiceKind.SOCKET_IO) - .withIdentity(new ManagedIdentity() - .withType(ManagedIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("sotftpvj", new UserAssignedIdentityProperty(), - "jhwqytjrybnw", new UserAssignedIdentityProperty()))) - .withTls(new WebPubSubTlsSettings().withClientCertEnabled(false)) - .withLiveTraceConfiguration(new LiveTraceConfiguration().withEnabled("vjymjhxxjyngud") - .withCategories(Arrays.asList(new LiveTraceCategory(), new LiveTraceCategory(), - new LiveTraceCategory()))) - .withResourceLogConfiguration(new ResourceLogConfiguration().withCategories( - Arrays.asList(new ResourceLogCategory(), new ResourceLogCategory()))) - .withNetworkACLs(new WebPubSubNetworkACLs().withDefaultAction(AclAction.DENY) - .withPublicNetwork(new NetworkAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.TRACE, - WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.RESTAPI, - WebPubSubRequestType.RESTAPI)) - .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, - WebPubSubRequestType.CLIENT_CONNECTION, WebPubSubRequestType.TRACE))) - .withPrivateEndpoints(Arrays.asList(new PrivateEndpointAcl().withName("xivetvt"), - new PrivateEndpointAcl().withName("qaqtdoqmcbxvwvxy"))) - .withIpRules(Arrays.asList(new IpRule(), new IpRule(), new IpRule()))) - .withPublicNetworkAccess("hsfxoblytkb") - .withDisableLocalAuth(false) - .withDisableAadAuth(false) - .withRegionEndpointEnabled("wfbkrvrns") - .withResourceStopped("hqjohxcrsbfova") - .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("uvwbhsqfs")))) - .withNextLink("dvxzbncblylpst"); - model = BinaryData.fromObject(model).toObject(WebPubSubResourceList.class); - Assertions.assertEquals("fbebrjcxer", model.value().get(0).location()); - Assertions.assertEquals("utttxfvjrbirp", model.value().get(0).tags().get("xepcyvahfn")); - Assertions.assertEquals("tpngjcrcczsqpjh", model.value().get(0).sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.FREE, model.value().get(0).sku().tier()); - Assertions.assertEquals(1901274446, model.value().get(0).sku().capacity()); - Assertions.assertEquals(ServiceKind.WEB_PUB_SUB, model.value().get(0).kind()); - Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals(true, model.value().get(0).tls().clientCertEnabled()); - Assertions.assertEquals("typmrbpizcdrqjsd", model.value().get(0).liveTraceConfiguration().enabled()); - Assertions.assertEquals(AclAction.ALLOW, model.value().get(0).networkACLs().defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.RESTAPI, model.value().get(0).networkACLs().publicNetwork().allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.TRACE, + Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, model.value().get(0).networkACLs().publicNetwork().deny().get(0)); - Assertions.assertEquals("jttgzf", model.value().get(0).networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("a", model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals(false, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(true, model.value().get(0).disableAadAuth()); - Assertions.assertEquals("alpbuxwgipwhon", model.value().get(0).regionEndpointEnabled()); - Assertions.assertEquals("kgshwa", model.value().get(0).resourceStopped()); - Assertions.assertEquals("xzbinjeputt", model.value().get(0).socketIO().serviceMode()); - Assertions.assertEquals("dvxzbncblylpst", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("t", model.value().get(0).networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals(3120227000201481868L, + model.value().get(0).applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("mjsjqb", model.value().get(0).publicNetworkAccess()); + Assertions.assertTrue(model.value().get(0).disableLocalAuth()); + Assertions.assertFalse(model.value().get(0).disableAadAuth()); + Assertions.assertEquals("rw", model.value().get(0).regionEndpointEnabled()); + Assertions.assertEquals("co", model.value().get(0).resourceStopped()); + Assertions.assertEquals("p", model.value().get(0).socketIO().serviceMode()); + Assertions.assertEquals("gofel", model.nextLink()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesCreateOrUpdateMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesCreateOrUpdateMockTests.java index 2b530109d2d3..4742383f331b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesCreateOrUpdateMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesCreateOrUpdateMockTests.java @@ -1,18 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResource; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -21,25 +22,27 @@ public final class WebPubSubSharedPrivateLinkResourcesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"groupId\":\"sxlghieegjlg\",\"privateLinkResourceId\":\"vpaseksgbu\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"uygdhgaqipirp\",\"status\":\"Pending\"},\"id\":\"ofulopmjnle\",\"name\":\"whc\",\"type\":\"jpib\"}"; + = "{\"properties\":{\"groupId\":\"v\",\"privateLinkResourceId\":\"tnrzvuljra\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"nok\",\"fqdns\":[\"kkjqnvbroylaxxu\",\"cdisd\",\"sfjbjsvg\",\"rwhryvycytd\"],\"status\":\"Pending\"},\"id\":\"ccknfnwmbtmvp\",\"name\":\"vjdhttzaefedxih\",\"type\":\"hrphkmcrjdqn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SharedPrivateLinkResource response = manager.webPubSubSharedPrivateLinkResources() - .define("ajqfutlx") - .withExistingWebPubSub("oqza", "unwqr") - .withGroupId("frgqhaohcm") - .withPrivateLinkResourceId("uocnjrohmbpyr") - .withRequestMessage("eblydyv") + .define("cbslhhx") + .withExistingWebPubSub("dmdqb", "pypqtgsfj") + .withGroupId("bxv") + .withPrivateLinkResourceId("d") + .withRequestMessage("irudh") + .withFqdns(Arrays.asList("es")) .create(); - Assertions.assertEquals("sxlghieegjlg", response.groupId()); - Assertions.assertEquals("vpaseksgbu", response.privateLinkResourceId()); - Assertions.assertEquals("uygdhgaqipirp", response.requestMessage()); + Assertions.assertEquals("v", response.groupId()); + Assertions.assertEquals("tnrzvuljra", response.privateLinkResourceId()); + Assertions.assertEquals("nok", response.requestMessage()); + Assertions.assertEquals("kkjqnvbroylaxxu", response.fqdns().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesDeleteMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesDeleteMockTests.java index 1a77074bbd1f..25f8393f1caa 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesDeleteMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDelete() throws Exception { WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.webPubSubSharedPrivateLinkResources() - .delete("uatmzwcjjncqtj", "mizvgbgatzuuvbx", "grebwggahttzlsw", com.azure.core.util.Context.NONE); + .delete("yxkyxvx", "vblbjednljlageua", "lxunsmjbnkppxy", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesGetWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesGetWithResponseMockTests.java index a89d4d1b6059..65387edc141e 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesGetWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResource; @@ -21,21 +21,22 @@ public final class WebPubSubSharedPrivateLinkResourcesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"groupId\":\"nzxojpslsvjgpli\",\"privateLinkResourceId\":\"fiqwoy\",\"provisioningState\":\"Unknown\",\"requestMessage\":\"pcohhoucqpqojx\",\"status\":\"Pending\"},\"id\":\"zdcgdzbenr\",\"name\":\"bcawetz\",\"type\":\"ddtjwfljhznam\"}"; + = "{\"properties\":{\"groupId\":\"asqvd\",\"privateLinkResourceId\":\"e\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"xakjsqzhzb\",\"fqdns\":[\"gims\",\"dxasicddyvv\",\"skgfmocwahpq\"],\"status\":\"Rejected\"},\"id\":\"eaahhvjhhn\",\"name\":\"kzyb\",\"type\":\"jjidjk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SharedPrivateLinkResource response = manager.webPubSubSharedPrivateLinkResources() - .getWithResponse("uem", "anbwzohmnrxxbso", "klinhmdptysprq", com.azure.core.util.Context.NONE) + .getWithResponse("ealzxwhcansymoyq", "lwigdivbkbx", "omfaj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("nzxojpslsvjgpli", response.groupId()); - Assertions.assertEquals("fiqwoy", response.privateLinkResourceId()); - Assertions.assertEquals("pcohhoucqpqojx", response.requestMessage()); + Assertions.assertEquals("asqvd", response.groupId()); + Assertions.assertEquals("e", response.privateLinkResourceId()); + Assertions.assertEquals("xakjsqzhzb", response.requestMessage()); + Assertions.assertEquals("gims", response.fqdns().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesListMockTests.java index 4f040a623562..62c8c1bb91d8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSharedPrivateLinkResourcesListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResource; @@ -22,20 +22,21 @@ public final class WebPubSubSharedPrivateLinkResourcesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"ela\",\"privateLinkResourceId\":\"acigel\",\"provisioningState\":\"Succeeded\",\"requestMessage\":\"bvqvwzkjopwbeo\",\"status\":\"Disconnected\"},\"id\":\"wzdqybxceakxcpts\",\"name\":\"qfyiaseqchkr\",\"type\":\"tzrazisgyk\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"ktp\",\"privateLinkResourceId\":\"ymerteeammxq\",\"provisioningState\":\"Running\",\"requestMessage\":\"kzddrtkgdojbmxva\",\"fqdns\":[\"fdeesvecuijpxtx\",\"uwprtujwsawd\"],\"status\":\"Disconnected\"},\"id\":\"abxvi\",\"name\":\"itvtzeexavo\",\"type\":\"tfgle\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.webPubSubSharedPrivateLinkResources().list("afcbqw", "e", com.azure.core.util.Context.NONE); + PagedIterable response = manager.webPubSubSharedPrivateLinkResources() + .list("enlsvxeizzgwkln", "rmffeyc", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ela", response.iterator().next().groupId()); - Assertions.assertEquals("acigel", response.iterator().next().privateLinkResourceId()); - Assertions.assertEquals("bvqvwzkjopwbeo", response.iterator().next().requestMessage()); + Assertions.assertEquals("ktp", response.iterator().next().groupId()); + Assertions.assertEquals("ymerteeammxq", response.iterator().next().privateLinkResourceId()); + Assertions.assertEquals("kzddrtkgdojbmxva", response.iterator().next().requestMessage()); + Assertions.assertEquals("fdeesvecuijpxtx", response.iterator().next().fqdns().get(0)); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSocketIOSettingsTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSocketIOSettingsTests.java index 63b2c9217056..c4d38c548cfe 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSocketIOSettingsTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubSocketIOSettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -12,14 +12,14 @@ public final class WebPubSubSocketIOSettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WebPubSubSocketIOSettings model - = BinaryData.fromString("{\"serviceMode\":\"ukyhejhzis\"}").toObject(WebPubSubSocketIOSettings.class); - Assertions.assertEquals("ukyhejhzis", model.serviceMode()); + = BinaryData.fromString("{\"serviceMode\":\"xiy\"}").toObject(WebPubSubSocketIOSettings.class); + Assertions.assertEquals("xiy", model.serviceMode()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WebPubSubSocketIOSettings model = new WebPubSubSocketIOSettings().withServiceMode("ukyhejhzis"); + WebPubSubSocketIOSettings model = new WebPubSubSocketIOSettings().withServiceMode("xiy"); model = BinaryData.fromObject(model).toObject(WebPubSubSocketIOSettings.class); - Assertions.assertEquals("ukyhejhzis", model.serviceMode()); + Assertions.assertEquals("xiy", model.serviceMode()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubTlsSettingsTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubTlsSettingsTests.java index f0ff1cd4a121..21af808f4991 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubTlsSettingsTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubTlsSettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; @@ -13,13 +13,13 @@ public final class WebPubSubTlsSettingsTests { public void testDeserialize() throws Exception { WebPubSubTlsSettings model = BinaryData.fromString("{\"clientCertEnabled\":true}").toObject(WebPubSubTlsSettings.class); - Assertions.assertEquals(true, model.clientCertEnabled()); + Assertions.assertTrue(model.clientCertEnabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { WebPubSubTlsSettings model = new WebPubSubTlsSettings().withClientCertEnabled(true); model = BinaryData.fromObject(model).toObject(WebPubSubTlsSettings.class); - Assertions.assertEquals(true, model.clientCertEnabled()); + Assertions.assertTrue(model.clientCertEnabled()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsCheckNameAvailabilityWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsCheckNameAvailabilityWithResponseMockTests.java index 0e9d0a7b6cf5..69a5bd51f3c0 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsCheckNameAvailabilityWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.NameAvailability; @@ -21,23 +21,23 @@ public final class WebPubSubsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"xylfsb\",\"message\":\"adpysownbt\"}"; + String responseStr = "{\"nameAvailable\":false,\"reason\":\"jmxmcuqud\",\"message\":\"vclx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); NameAvailability response = manager.webPubSubs() - .checkNameAvailabilityWithResponse("iagtc", - new NameAvailabilityParameters().withType("jocqwogfnzjvusf").withName("ld"), + .checkNameAvailabilityWithResponse("ttgplucfotangcf", + new NameAvailabilityParameters().withType("nykzcugswvxwlm").withName("qwm"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(true, response.nameAvailable()); - Assertions.assertEquals("xylfsb", response.reason()); - Assertions.assertEquals("adpysownbt", response.message()); + Assertions.assertFalse(response.nameAvailable()); + Assertions.assertEquals("jmxmcuqud", response.reason()); + Assertions.assertEquals("vclx", response.message()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsCreateOrUpdateMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsCreateOrUpdateMockTests.java index 6016831686c1..438d52c8a066 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsCreateOrUpdateMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsCreateOrUpdateMockTests.java @@ -1,16 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.AclAction; +import com.azure.resourcemanager.webpubsub.models.ApplicationFirewallSettings; +import com.azure.resourcemanager.webpubsub.models.ClientConnectionCountRule; +import com.azure.resourcemanager.webpubsub.models.ClientTrafficControlRule; import com.azure.resourcemanager.webpubsub.models.IpRule; import com.azure.resourcemanager.webpubsub.models.LiveTraceCategory; import com.azure.resourcemanager.webpubsub.models.LiveTraceConfiguration; @@ -42,90 +45,105 @@ public final class WebPubSubsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"sku\":{\"name\":\"tctbrxkjzwrgxffm\",\"tier\":\"Basic\",\"size\":\"fbkgozxwopdby\",\"family\":\"izqaclnapxbiyg\",\"capacity\":966053961},\"properties\":{\"provisioningState\":\"Succeeded\",\"externalIP\":\"smfcttuxuuyilfl\",\"hostName\":\"iquvrehm\",\"publicPort\":1061957314,\"serverPort\":1799585778,\"version\":\"ujztcz\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{},\"groupIds\":[\"unfprnjletlxs\",\"rpddouifamo\",\"aziynknlqwzdv\",\"iwhxqszdtmaajq\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"xylrjvmtygjbmz\",\"name\":\"ospspshckf\",\"type\":\"yjpmspbpssdfppyo\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{},\"groupIds\":[\"tvczkcnyxr\",\"munjdxvglnkvx\",\"xpaglqivbgkc\",\"khpzvuqdflv\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"yp\",\"name\":\"pubcpzgpxtivhjk\",\"type\":\"idibgqjxgpn\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"vfgpikqmhhaowjrm\",\"privateLinkResourceId\":\"vuporqzdfuydzv\",\"provisioningState\":\"Running\",\"requestMessage\":\"cnqmxqpsw\",\"status\":\"Pending\"},\"id\":\"khlg\",\"name\":\"dhbemzqkzszu\",\"type\":\"iwtglxxhljfpg\"},{\"properties\":{\"groupId\":\"crmnzhrgmqgjs\",\"privateLinkResourceId\":\"vpqcb\",\"provisioningState\":\"Unknown\",\"requestMessage\":\"odth\",\"status\":\"Disconnected\"},\"id\":\"vriibakclacjfr\",\"name\":\"xousxauzl\",\"type\":\"vsg\"},{\"properties\":{\"groupId\":\"ohqfzizv\",\"privateLinkResourceId\":\"xmmkjs\",\"provisioningState\":\"Failed\",\"requestMessage\":\"wpztekovmribia\",\"status\":\"Pending\"},\"id\":\"lu\",\"name\":\"fotang\",\"type\":\"fhnykzcugs\"},{\"properties\":{\"groupId\":\"x\",\"privateLinkResourceId\":\"lmzqwmvtxnjmx\",\"provisioningState\":\"Canceled\",\"requestMessage\":\"udtc\",\"status\":\"Disconnected\"},\"id\":\"ynpdkvgfab\",\"name\":\"iyji\",\"type\":\"uzphdugnei\"}],\"tls\":{\"clientCertEnabled\":false},\"hostNamePrefix\":\"xgjiuqh\",\"liveTraceConfiguration\":{\"enabled\":\"ozipqwjedmurrxx\",\"categories\":[{\"name\":\"ktvqylkmqpzoy\",\"enabled\":\"fbcgwgcloxoebqin\"},{\"name\":\"pnwjfujq\",\"enabled\":\"fcbahhp\"},{\"name\":\"ofoiy\",\"enabled\":\"p\"},{\"name\":\"lkmkkholvdndvi\",\"enabled\":\"ogphuartvtiu\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"hnmnahmnx\",\"enabled\":\"xjqirwrweoox\"},{\"name\":\"i\",\"enabled\":\"xwrsnew\"}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"Trace\",\"Trace\"],\"deny\":[\"ClientConnection\",\"RESTAPI\",\"RESTAPI\",\"RESTAPI\"]},\"privateEndpoints\":[{\"name\":\"hxzga\",\"allow\":[\"ClientConnection\",\"ClientConnection\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"RESTAPI\",\"RESTAPI\"]},{\"name\":\"qhppubowsepdfgk\",\"allow\":[\"ServerConnection\",\"Trace\",\"Trace\"],\"deny\":[\"ServerConnection\"]},{\"name\":\"tcjuahokqto\",\"allow\":[\"Trace\",\"ClientConnection\",\"Trace\"],\"deny\":[\"Trace\"]},{\"name\":\"fphwpnu\",\"allow\":[\"RESTAPI\",\"RESTAPI\"],\"deny\":[\"ClientConnection\"]}],\"ipRules\":[{\"value\":\"slwkojpl\",\"action\":\"Deny\"},{\"value\":\"pdwrpqafgfugsn\",\"action\":\"Allow\"}]},\"publicNetworkAccess\":\"et\",\"disableLocalAuth\":true,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"octfjgtixrjvzuyt\",\"resourceStopped\":\"mlmuowol\",\"socketIO\":{\"serviceMode\":\"iropionszon\"}},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ekhenl\":{\"principalId\":\"ixjawrtm\",\"clientId\":\"jmyccxlzhcoxov\"}},\"principalId\":\"fnrdtjxtxr\",\"tenantId\":\"qtj\"},\"location\":\"dt\",\"tags\":{\"cvuwkasiz\":\"puslvyj\"},\"id\":\"esfuught\",\"name\":\"qfecjxeygtuhx\",\"type\":\"ic\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"externalIP\":\"arfdlpukhpyrnei\",\"hostName\":\"cpeogkhnmgbrou\",\"publicPort\":1363231330,\"serverPort\":1509043330,\"version\":\"hpfpazjzoywjxhp\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Running\",\"privateEndpoint\":{},\"groupIds\":[\"pqwtehtue\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"rljyoogwxhnsdu\",\"name\":\"gwbsreurf\",\"type\":\"kfuarenlv\"},{\"properties\":{\"provisioningState\":\"Moving\",\"privateEndpoint\":{},\"groupIds\":[\"nafvvkyfedev\",\"bo\",\"lcqxypokk\",\"minqcym\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"gn\",\"name\":\"dxxewuninv\",\"type\":\"db\"},{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{},\"groupIds\":[\"qecrqctmxx\",\"tddmf\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"ytxzvtznapxbanno\",\"name\":\"voxczytpr\",\"type\":\"nwvroevytlyokrr\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"xv\",\"privateLinkResourceId\":\"sasbcrymodizrx\",\"provisioningState\":\"Deleting\",\"requestMessage\":\"d\",\"fqdns\":[\"zpmkmlmvev\",\"xzopjhbzxl\",\"ohrdddt\"],\"status\":\"Timeout\"},\"id\":\"ba\",\"name\":\"pcbbnzqcykna\",\"type\":\"qofyuicdhzbdy\"},{\"properties\":{\"groupId\":\"wgbdvibidmhmwffp\",\"privateLinkResourceId\":\"fmuvapckccr\",\"provisioningState\":\"Canceled\",\"requestMessage\":\"yoxoy\",\"fqdns\":[\"phaimmoi\"],\"status\":\"Rejected\"},\"id\":\"oshbragapyy\",\"name\":\"mfsvbpav\",\"type\":\"opfppdbwnupgah\"},{\"properties\":{\"groupId\":\"um\",\"privateLinkResourceId\":\"sjcaacfdmmcpugm\",\"provisioningState\":\"Canceled\",\"requestMessage\":\"pvufhbze\",\"fqdns\":[\"hoqhnl\",\"qnbldxe\",\"clgsc\",\"orim\"],\"status\":\"Approved\"},\"id\":\"rmoucsofl\",\"name\":\"puviyfcaabe\",\"type\":\"lhbhl\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"qi\",\"liveTraceConfiguration\":{\"enabled\":\"tkcudfbsfarfsiow\",\"categories\":[{\"name\":\"nqpvwgfstmhqykiz\",\"enabled\":\"ksaoafcluqvox\"},{\"name\":\"cjimryvwgcwwpbmz\",\"enabled\":\"esyds\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"hecbvopwndyq\",\"enabled\":\"allklmtkhlowk\"}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"RESTAPI\",\"ServerConnection\",\"RESTAPI\",\"RESTAPI\"],\"deny\":[\"ServerConnection\",\"RESTAPI\",\"Trace\"]},\"privateEndpoints\":[{\"name\":\"lhikcyychunsj\",\"allow\":[\"ClientConnection\",\"RESTAPI\"],\"deny\":[\"ServerConnection\"]},{\"name\":\"hv\",\"allow\":[\"ClientConnection\",\"RESTAPI\",\"Trace\"],\"deny\":[\"RESTAPI\",\"ClientConnection\"]},{\"name\":\"mhwrb\",\"allow\":[\"Trace\"],\"deny\":[\"ServerConnection\",\"ServerConnection\"]}],\"ipRules\":[{\"value\":\"glrocuy\",\"action\":\"Deny\"},{\"value\":\"hmem\",\"action\":\"Allow\"},{\"value\":\"lutnpqme\",\"action\":\"Deny\"},{\"value\":\"kmmykyujxsglh\",\"action\":\"Deny\"}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":216987996286341841},\"publicNetworkAccess\":\"zudnigrfiho\",\"disableLocalAuth\":false,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"xuzzjgnrefq\",\"resourceStopped\":\"qotoihiqakydiwfb\",\"socketIO\":{\"serviceMode\":\"pzdqtvhcspod\"}},\"sku\":{\"name\":\"axsipietgb\",\"tier\":\"Standard\",\"size\":\"ulbmoichdlp\",\"family\":\"pubntnbatz\",\"capacity\":331637296},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"plrvkmjcwmjvlg\":{\"principalId\":\"cat\",\"clientId\":\"ju\"}},\"principalId\":\"gcvkyyli\",\"tenantId\":\"zbj\"},\"location\":\"fxsfuztlvtmv\",\"tags\":{\"dqlvhukoveof\":\"w\",\"lkujrllfojui\":\"zrvjfnmjmvlwyzgi\"},\"id\":\"jpu\",\"name\":\"yjucejikzoeo\",\"type\":\"vtzejetjklnti\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WebPubSubResource response = manager.webPubSubs() - .define("tswbzuwfmd") - .withRegion("ulkpakd") - .withExistingResourceGroup("ivqiheb") - .withTags( - mapOf("bpxuckpggqoweyi", "mjnnawtq", "ruwnpqxpx", "dhlisngwflqqmpi", "ixtmkzjvkviirhgf", "wfcngjsaas")) - .withSku(new ResourceSku().withName("agegiz").withTier(WebPubSubSkuTier.PREMIUM).withCapacity(1377938879)) + .define("fabuiyjibu") + .withRegion("nchrszizoyu") + .withExistingResourceGroup("npdkv") + .withTags(mapOf("nlgmtrwahzjmu", "etndnbfqyggagf", "kpigqfusu", "ftbyrplro")) + .withSku(new ResourceSku().withName("rbuhhlky").withTier(WebPubSubSkuTier.STANDARD).withCapacity(35443299)) .withKind(ServiceKind.WEB_PUB_SUB) - .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("wtlmjjyuo", new UserAssignedIdentityProperty(), "fjkwrusnkq", - new UserAssignedIdentityProperty()))) + .withIdentity(new ManagedIdentity().withType(ManagedIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("qxfzyjqttvwk", new UserAssignedIdentityProperty(), "guaucmfdjwnla", + new UserAssignedIdentityProperty(), "sserxhtvsoxhlwn", new UserAssignedIdentityProperty()))) .withTls(new WebPubSubTlsSettings().withClientCertEnabled(true)) - .withLiveTraceConfiguration(new LiveTraceConfiguration().withEnabled("hokzrusw") - .withCategories(Arrays.asList(new LiveTraceCategory().withName("zznvfbyc").withEnabled("xjww"), - new LiveTraceCategory().withName("z").withEnabled("mwmxqhndvnoamld")))) - .withResourceLogConfiguration(new ResourceLogConfiguration() - .withCategories(Arrays.asList(new ResourceLogCategory().withName("hdjhhflz").withEnabled("xcoxpelnjet"), - new ResourceLogCategory().withName("ltsxoatf").withEnabled("zpnpbswv")))) + .withLiveTraceConfiguration(new LiveTraceConfiguration().withEnabled("jmyccxlzhcoxov") + .withCategories(Arrays.asList(new LiveTraceCategory().withName("enlusfn").withEnabled("tjxtxr"), + new LiveTraceCategory().withName("qtj").withEnabled("dt")))) + .withResourceLogConfiguration(new ResourceLogConfiguration().withCategories( + Arrays.asList(new ResourceLogCategory().withName("slvyjtcvuwkasi").withEnabled("esfuught"), + new ResourceLogCategory().withName("fecjxeygtuhx").withEnabled("cbuewmrswnjlxuz")))) .withNetworkACLs(new WebPubSubNetworkACLs().withDefaultAction(AclAction.ALLOW) .withPublicNetwork(new NetworkAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.CLIENT_CONNECTION, - WebPubSubRequestType.RESTAPI)) - .withDeny(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.CLIENT_CONNECTION, - WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.TRACE))) + .withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI, + WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.SERVER_CONNECTION)) + .withDeny( + Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.CLIENT_CONNECTION))) .withPrivateEndpoints(Arrays.asList( new PrivateEndpointAcl() - .withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI)) - .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.TRACE, - WebPubSubRequestType.TRACE, WebPubSubRequestType.CLIENT_CONNECTION)) - .withName("wtxxpkyjcx"), + .withAllow(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.RESTAPI, + WebPubSubRequestType.RESTAPI)) + .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.SERVER_CONNECTION)) + .withName("hzjqatucoige"), + new PrivateEndpointAcl() + .withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.SERVER_CONNECTION, + WebPubSubRequestType.CLIENT_CONNECTION)) + .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.RESTAPI)) + .withName("nwgfmxjgcgbjbgd"), + new PrivateEndpointAcl().withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI)) + .withDeny(Arrays.asList(WebPubSubRequestType.SERVER_CONNECTION)) + .withName("uflqbctq"), new PrivateEndpointAcl().withAllow(Arrays.asList(WebPubSubRequestType.RESTAPI)) - .withDeny(Arrays.asList(WebPubSubRequestType.RESTAPI, WebPubSubRequestType.CLIENT_CONNECTION, - WebPubSubRequestType.RESTAPI, WebPubSubRequestType.SERVER_CONNECTION)) - .withName("ycilrmcaykggnox"))) - .withIpRules(Arrays.asList(new IpRule().withValue("pfnznthjtwkj").withAction(AclAction.DENY), - new IpRule().withValue("xuzvoamktcqi").withAction(AclAction.DENY), - new IpRule().withValue("bzahgxqd").withAction(AclAction.ALLOW)))) - .withPublicNetworkAccess("ltlaprltzkatbhj") - .withDisableLocalAuth(true) - .withDisableAadAuth(true) - .withRegionEndpointEnabled("oqeq") - .withResourceStopped("arvlagunbt") - .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("bwln")) + .withDeny(Arrays.asList(WebPubSubRequestType.TRACE, WebPubSubRequestType.CLIENT_CONNECTION, + WebPubSubRequestType.SERVER_CONNECTION, WebPubSubRequestType.CLIENT_CONNECTION)) + .withName("dkq"))) + .withIpRules(Arrays.asList(new IpRule().withValue("dfzantkwcegy").withAction(AclAction.ALLOW), + new IpRule().withValue("nseqacjjvp").withAction(AclAction.DENY), + new IpRule().withValue("ooqjagmditgueio").withAction(AclAction.DENY), + new IpRule().withValue("sahrtdtpdel").withAction(AclAction.DENY)))) + .withApplicationFirewall(new ApplicationFirewallSettings() + .withClientConnectionCountRules(Arrays.asList(new ClientConnectionCountRule())) + .withClientTrafficControlRules( + Arrays.asList(new ClientTrafficControlRule(), new ClientTrafficControlRule())) + .withMaxClientConnectionLifetimeInSeconds(635778272678481965L)) + .withPublicNetworkAccess("fxof") + .withDisableLocalAuth(false) + .withDisableAadAuth(false) + .withRegionEndpointEnabled("irazftxejwabmd") + .withResourceStopped("tmvcop") + .withSocketIO(new WebPubSubSocketIOSettings().withServiceMode("m")) .create(); - Assertions.assertEquals("dt", response.location()); - Assertions.assertEquals("puslvyj", response.tags().get("cvuwkasiz")); - Assertions.assertEquals("tctbrxkjzwrgxffm", response.sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.BASIC, response.sku().tier()); - Assertions.assertEquals(966053961, response.sku().capacity()); + Assertions.assertEquals("fxsfuztlvtmv", response.location()); + Assertions.assertEquals("w", response.tags().get("dqlvhukoveof")); + Assertions.assertEquals("axsipietgb", response.sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.STANDARD, response.sku().tier()); + Assertions.assertEquals(331637296, response.sku().capacity()); Assertions.assertEquals(ServiceKind.SOCKET_IO, response.kind()); - Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals(false, response.tls().clientCertEnabled()); - Assertions.assertEquals("ozipqwjedmurrxx", response.liveTraceConfiguration().enabled()); - Assertions.assertEquals("ktvqylkmqpzoy", response.liveTraceConfiguration().categories().get(0).name()); - Assertions.assertEquals("fbcgwgcloxoebqin", response.liveTraceConfiguration().categories().get(0).enabled()); - Assertions.assertEquals("hnmnahmnx", response.resourceLogConfiguration().categories().get(0).name()); - Assertions.assertEquals("xjqirwrweoox", response.resourceLogConfiguration().categories().get(0).enabled()); + Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED, response.identity().type()); + Assertions.assertTrue(response.tls().clientCertEnabled()); + Assertions.assertEquals("tkcudfbsfarfsiow", response.liveTraceConfiguration().enabled()); + Assertions.assertEquals("nqpvwgfstmhqykiz", response.liveTraceConfiguration().categories().get(0).name()); + Assertions.assertEquals("ksaoafcluqvox", response.liveTraceConfiguration().categories().get(0).enabled()); + Assertions.assertEquals("hecbvopwndyq", response.resourceLogConfiguration().categories().get(0).name()); + Assertions.assertEquals("allklmtkhlowk", response.resourceLogConfiguration().categories().get(0).enabled()); Assertions.assertEquals(AclAction.DENY, response.networkACLs().defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.TRACE, response.networkACLs().publicNetwork().allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, + Assertions.assertEquals(WebPubSubRequestType.RESTAPI, response.networkACLs().publicNetwork().allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, response.networkACLs().publicNetwork().deny().get(0)); Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, response.networkACLs().privateEndpoints().get(0).allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.RESTAPI, + Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, response.networkACLs().privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("hxzga", response.networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("slwkojpl", response.networkACLs().ipRules().get(0).value()); + Assertions.assertEquals("lhikcyychunsj", response.networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals("glrocuy", response.networkACLs().ipRules().get(0).value()); Assertions.assertEquals(AclAction.DENY, response.networkACLs().ipRules().get(0).action()); - Assertions.assertEquals("et", response.publicNetworkAccess()); - Assertions.assertEquals(true, response.disableLocalAuth()); - Assertions.assertEquals(false, response.disableAadAuth()); - Assertions.assertEquals("octfjgtixrjvzuyt", response.regionEndpointEnabled()); - Assertions.assertEquals("mlmuowol", response.resourceStopped()); - Assertions.assertEquals("iropionszon", response.socketIO().serviceMode()); + Assertions.assertEquals(216987996286341841L, + response.applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("zudnigrfiho", response.publicNetworkAccess()); + Assertions.assertFalse(response.disableLocalAuth()); + Assertions.assertTrue(response.disableAadAuth()); + Assertions.assertEquals("xuzzjgnrefq", response.regionEndpointEnabled()); + Assertions.assertEquals("qotoihiqakydiwfb", response.resourceStopped()); + Assertions.assertEquals("pzdqtvhcspod", response.socketIO().serviceMode()); } // Use "Map.of" if available diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsDeleteMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsDeleteMockTests.java index 302b4af2b081..c6c8db8c6c6a 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsDeleteMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsDeleteMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.webPubSubs().delete("apjwogqqnobpudcd", "btqwpwyawbzas", com.azure.core.util.Context.NONE); + manager.webPubSubs().delete("ciqdsme", "iitdfuxt", com.azure.core.util.Context.NONE); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsGetByResourceGroupWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsGetByResourceGroupWithResponseMockTests.java index aca4e3966f3c..0dc5b1107db7 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsGetByResourceGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.AclAction; @@ -26,48 +26,49 @@ public final class WebPubSubsGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"sku\":{\"name\":\"hxgsrboldfor\",\"tier\":\"Standard\",\"size\":\"lvizb\",\"family\":\"fovvacqpbtuodxes\",\"capacity\":1481188049},\"properties\":{\"provisioningState\":\"Failed\",\"externalIP\":\"wumuaslzk\",\"hostName\":\"rwoycqucwyh\",\"publicPort\":1173468754,\"serverPort\":679265524,\"version\":\"rkywuhpsvfuu\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Running\",\"privateEndpoint\":{},\"groupIds\":[\"lalniex\",\"srzpgepqtybbww\",\"gdakchz\",\"vl\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"nrkcxkj\",\"name\":\"bn\",\"type\":\"mysu\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{},\"groupIds\":[\"vl\",\"ijpstte\",\"oqq\",\"wcyyufmhruncu\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"spkcdqzh\",\"name\":\"ctddun\",\"type\":\"ndy\"},{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{},\"groupIds\":[\"njjrcgegydcwbox\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"vqqolih\",\"name\":\"raiouaubrjtl\",\"type\":\"qxfuojrngif\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{},\"groupIds\":[\"cb\",\"uimzdlyjd\",\"qwmkyoquf\",\"vruzslzojhpctfnm\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"tngfdgugeyzihgr\",\"name\":\"yui\",\"type\":\"absnmfpp\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"evy\",\"privateLinkResourceId\":\"yhsgz\",\"provisioningState\":\"Moving\",\"requestMessage\":\"gomfgbeglq\",\"status\":\"Rejected\"},\"id\":\"hibetnluankrr\",\"name\":\"xeeebtijvacvbmqz\",\"type\":\"qqxlajr\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"evehjkuyxoaf\",\"liveTraceConfiguration\":{\"enabled\":\"qltfaey\",\"categories\":[{\"name\":\"fgvxirpghriypoqe\",\"enabled\":\"lqhykprlpyz\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"dsmexiitdfux\",\"enabled\":\"asiibmiybnnust\"}]},\"networkACLs\":{\"defaultAction\":\"Allow\",\"publicNetwork\":{\"allow\":[\"ClientConnection\",\"Trace\",\"Trace\",\"RESTAPI\"],\"deny\":[\"RESTAPI\",\"ServerConnection\"]},\"privateEndpoints\":[{\"name\":\"foudor\",\"allow\":[\"RESTAPI\",\"ServerConnection\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"ClientConnection\",\"RESTAPI\"]},{\"name\":\"pundmbxhug\",\"allow\":[\"ClientConnection\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"ClientConnection\"]},{\"name\":\"rb\",\"allow\":[\"ServerConnection\"],\"deny\":[\"ServerConnection\",\"Trace\",\"Trace\",\"Trace\"]}],\"ipRules\":[{\"value\":\"vnzcyjto\",\"action\":\"Allow\"},{\"value\":\"pvpbdbzqgqqiheds\",\"action\":\"Allow\"}]},\"publicNetworkAccess\":\"hmkyibc\",\"disableLocalAuth\":false,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"qcwdhoh\",\"resourceStopped\":\"tmcdzsufcohd\",\"socketIO\":{\"serviceMode\":\"lm\"}},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"kfkbgbzbowxeqocl\":{\"principalId\":\"bevwqqxeys\",\"clientId\":\"nqzi\"},\"e\":{\"principalId\":\"ygvkzqkjj\",\"clientId\":\"kbzefezrxcczurt\"},\"gnzvdfbzdixzm\":{\"principalId\":\"q\",\"clientId\":\"kwv\"},\"jptmcgsbost\":{\"principalId\":\"noda\",\"clientId\":\"pqhe\"}},\"principalId\":\"lnd\",\"tenantId\":\"tutmzl\"},\"location\":\"ojlvfhrbbpneqvc\",\"tags\":{\"mo\":\"yurmochpprprs\",\"cpilj\":\"ayzejnhlbkpbz\",\"zv\":\"a\",\"olewjwi\":\"chndbnwie\"},\"id\":\"ubwefqs\",\"name\":\"ap\",\"type\":\"qtferrqwexjkmf\"}"; + = "{\"properties\":{\"provisioningState\":\"Running\",\"externalIP\":\"w\",\"hostName\":\"okvbwnhhtqlgehg\",\"publicPort\":1116935254,\"serverPort\":1296977531,\"version\":\"hpfeoajvgcxtxjc\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"privateEndpoint\":{},\"groupIds\":[\"ugsresmkssjhoi\",\"txfkfweg\",\"rhptilluc\",\"iqtgdqoh\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"sldrizetpwbral\",\"name\":\"libph\",\"type\":\"qzmiza\"},{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{},\"groupIds\":[\"p\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"zhajoylhjlmuo\",\"name\":\"xprimrsop\",\"type\":\"eecjmeis\"},{\"properties\":{\"provisioningState\":\"Moving\",\"privateEndpoint\":{},\"groupIds\":[\"lwxdzaum\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"ohguuf\",\"name\":\"zboyjathwt\",\"type\":\"olbaemwmdx\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{},\"groupIds\":[\"jpahlxvea\",\"f\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"mwmqtibx\",\"name\":\"ijddtvqc\",\"type\":\"tad\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"ukm\",\"privateLinkResourceId\":\"sieekpndzaapm\",\"provisioningState\":\"Updating\",\"requestMessage\":\"eqw\",\"fqdns\":[\"ibudqwy\",\"eb\",\"ybpmzznrtffyaq\",\"tmhheioqa\"],\"status\":\"Disconnected\"},\"id\":\"eufuqyrxpdlcgql\",\"name\":\"ismjqfrddgamqu\",\"type\":\"iosrsjuivfcdis\"},{\"properties\":{\"groupId\":\"rnxzh\",\"privateLinkResourceId\":\"zexrxzbujrt\",\"provisioningState\":\"Moving\",\"requestMessage\":\"wrevkhgnlnzon\",\"fqdns\":[\"piqywnc\",\"jtszcof\",\"zehtdhgb\"],\"status\":\"Timeout\"},\"id\":\"eljeamurvzmlovua\",\"name\":\"ashcxlpmjerbdk\",\"type\":\"lvidizozs\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"jmonfdgn\",\"liveTraceConfiguration\":{\"enabled\":\"ypuuwwltvuqjctze\",\"categories\":[{\"name\":\"fzzhmkdasv\",\"enabled\":\"yhbxcudchxgs\"},{\"name\":\"oldforobw\",\"enabled\":\"vizbfhfo\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"pbt\",\"enabled\":\"dxe\"},{\"name\":\"abbelawumuaslzk\",\"enabled\":\"rwoycqucwyh\"}]},\"networkACLs\":{\"defaultAction\":\"Allow\",\"publicNetwork\":{\"allow\":[\"RESTAPI\",\"RESTAPI\",\"RESTAPI\"],\"deny\":[\"Trace\",\"Trace\"]},\"privateEndpoints\":[{\"name\":\"uurutlwexxwlalni\",\"allow\":[\"Trace\",\"ServerConnection\",\"ServerConnection\"],\"deny\":[\"ServerConnection\",\"ServerConnection\",\"ClientConnection\"]},{\"name\":\"tybbwwpgda\",\"allow\":[\"ServerConnection\",\"RESTAPI\",\"ClientConnection\",\"Trace\"],\"deny\":[\"ClientConnection\",\"ServerConnection\"]},{\"name\":\"rkcxkj\",\"allow\":[\"Trace\"],\"deny\":[\"Trace\"]}],\"ipRules\":[{\"value\":\"wq\",\"action\":\"Deny\"}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":5056102068378234557},\"publicNetworkAccess\":\"exoqqpwcyyufm\",\"disableLocalAuth\":false,\"disableAadAuth\":false,\"regionEndpointEnabled\":\"wmqs\",\"resourceStopped\":\"cdqzhlctddu\",\"socketIO\":{\"serviceMode\":\"dyfpchrqbnj\"}},\"sku\":{\"name\":\"cgegydcwbo\",\"tier\":\"Free\",\"size\":\"vqqolih\",\"family\":\"aiouaubrjt\",\"capacity\":617532608},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"kyoqufdv\":{\"principalId\":\"iflrzpasccbiu\",\"clientId\":\"zdlyjdfqw\"},\"fdgugeyzi\":{\"principalId\":\"zslzojhp\",\"clientId\":\"fnmdxotn\"},\"jee\":{\"principalId\":\"rkyui\",\"clientId\":\"bsnmfpph\"},\"gleohi\":{\"principalId\":\"hyhsgzfczbg\",\"clientId\":\"fgbegl\"}},\"principalId\":\"tnluankrr\",\"tenantId\":\"eeebtijvacv\"},\"location\":\"qzbqqxlajrnwxa\",\"tags\":{\"xoafgaoqltfae\":\"ehjku\"},\"id\":\"linmfgv\",\"name\":\"irpghriypoqeyh\",\"type\":\"qhykprlpyzn\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WebPubSubResource response = manager.webPubSubs() - .getByResourceGroupWithResponse("hmkdasvfl", "hbxcu", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("dfzpbgtgkylkdg", "rjeuut", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ojlvfhrbbpneqvc", response.location()); - Assertions.assertEquals("yurmochpprprs", response.tags().get("mo")); - Assertions.assertEquals("hxgsrboldfor", response.sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals(1481188049, response.sku().capacity()); + Assertions.assertEquals("qzbqqxlajrnwxa", response.location()); + Assertions.assertEquals("ehjku", response.tags().get("xoafgaoqltfae")); + Assertions.assertEquals("cgegydcwbo", response.sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.FREE, response.sku().tier()); + Assertions.assertEquals(617532608, response.sku().capacity()); Assertions.assertEquals(ServiceKind.SOCKET_IO, response.kind()); Assertions.assertEquals(ManagedIdentityType.NONE, response.identity().type()); - Assertions.assertEquals(true, response.tls().clientCertEnabled()); - Assertions.assertEquals("qltfaey", response.liveTraceConfiguration().enabled()); - Assertions.assertEquals("fgvxirpghriypoqe", response.liveTraceConfiguration().categories().get(0).name()); - Assertions.assertEquals("lqhykprlpyz", response.liveTraceConfiguration().categories().get(0).enabled()); - Assertions.assertEquals("dsmexiitdfux", response.resourceLogConfiguration().categories().get(0).name()); - Assertions.assertEquals("asiibmiybnnust", response.resourceLogConfiguration().categories().get(0).enabled()); + Assertions.assertTrue(response.tls().clientCertEnabled()); + Assertions.assertEquals("ypuuwwltvuqjctze", response.liveTraceConfiguration().enabled()); + Assertions.assertEquals("fzzhmkdasv", response.liveTraceConfiguration().categories().get(0).name()); + Assertions.assertEquals("yhbxcudchxgs", response.liveTraceConfiguration().categories().get(0).enabled()); + Assertions.assertEquals("pbt", response.resourceLogConfiguration().categories().get(0).name()); + Assertions.assertEquals("dxe", response.resourceLogConfiguration().categories().get(0).enabled()); Assertions.assertEquals(AclAction.ALLOW, response.networkACLs().defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, - response.networkACLs().publicNetwork().allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.RESTAPI, response.networkACLs().publicNetwork().deny().get(0)); - Assertions.assertEquals(WebPubSubRequestType.RESTAPI, + Assertions.assertEquals(WebPubSubRequestType.RESTAPI, response.networkACLs().publicNetwork().allow().get(0)); + Assertions.assertEquals(WebPubSubRequestType.TRACE, response.networkACLs().publicNetwork().deny().get(0)); + Assertions.assertEquals(WebPubSubRequestType.TRACE, response.networkACLs().privateEndpoints().get(0).allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.RESTAPI, + Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, response.networkACLs().privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("foudor", response.networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("vnzcyjto", response.networkACLs().ipRules().get(0).value()); - Assertions.assertEquals(AclAction.ALLOW, response.networkACLs().ipRules().get(0).action()); - Assertions.assertEquals("hmkyibc", response.publicNetworkAccess()); - Assertions.assertEquals(false, response.disableLocalAuth()); - Assertions.assertEquals(false, response.disableAadAuth()); - Assertions.assertEquals("qcwdhoh", response.regionEndpointEnabled()); - Assertions.assertEquals("tmcdzsufcohd", response.resourceStopped()); - Assertions.assertEquals("lm", response.socketIO().serviceMode()); + Assertions.assertEquals("uurutlwexxwlalni", response.networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals("wq", response.networkACLs().ipRules().get(0).value()); + Assertions.assertEquals(AclAction.DENY, response.networkACLs().ipRules().get(0).action()); + Assertions.assertEquals(5056102068378234557L, + response.applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("exoqqpwcyyufm", response.publicNetworkAccess()); + Assertions.assertFalse(response.disableLocalAuth()); + Assertions.assertFalse(response.disableAadAuth()); + Assertions.assertEquals("wmqs", response.regionEndpointEnabled()); + Assertions.assertEquals("cdqzhlctddu", response.resourceStopped()); + Assertions.assertEquals("dyfpchrqbnj", response.socketIO().serviceMode()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListByResourceGroupMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListByResourceGroupMockTests.java index 3dcffe91531a..2b240347d70c 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListByResourceGroupMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListByResourceGroupMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.AclAction; @@ -27,51 +27,54 @@ public final class WebPubSubsListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"sku\":{\"name\":\"merteeammxqiek\",\"tier\":\"Basic\",\"size\":\"drtkgdoj\",\"family\":\"xv\",\"capacity\":1550017967},\"properties\":{\"provisioningState\":\"Moving\",\"externalIP\":\"esvecuijpx\",\"hostName\":\"s\",\"publicPort\":629028889,\"serverPort\":107298058,\"version\":\"jwsawddjibab\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{},\"groupIds\":[\"eexavo\",\"tfgle\",\"dmdqb\",\"pypqtgsfj\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"slhhxudbxv\",\"name\":\"d\",\"type\":\"tnsi\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{},\"groupIds\":[\"es\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"lpagzrcx\",\"name\":\"a\",\"type\":\"lc\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{},\"groupIds\":[\"xdfgsftufqobr\",\"lnacgcc\",\"knh\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"zvytnrzvuljraaer\",\"name\":\"nok\",\"type\":\"gukkjqnvbroy\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"privateEndpoint\":{},\"groupIds\":[\"disdosfjbjsvgj\",\"whryvycytdcl\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"cknfnwmbtmvpd\",\"name\":\"jdhttzaefedxi\",\"type\":\"ch\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"m\",\"privateLinkResourceId\":\"rjdqnsdfzp\",\"provisioningState\":\"Failed\",\"requestMessage\":\"kylkdghrj\",\"status\":\"Approved\"},\"id\":\"lwxezwzhokvbwnh\",\"name\":\"tqlgehgppi\",\"type\":\"ifhpf\"}],\"tls\":{\"clientCertEnabled\":false},\"hostNamePrefix\":\"gcxtxj\",\"liveTraceConfiguration\":{\"enabled\":\"eafidltugsresm\",\"categories\":[{\"name\":\"h\",\"enabled\":\"ftxfkf\"},{\"name\":\"gpr\",\"enabled\":\"tillucbiqtg\"},{\"name\":\"ohmcwsld\",\"enabled\":\"zetpwbra\"},{\"name\":\"libph\",\"enabled\":\"zmizakakan\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"jzhajoy\",\"enabled\":\"jlmuoyxprimrsopt\"},{\"name\":\"cjmeislstvasy\",\"enabled\":\"xdza\"}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"Trace\",\"ServerConnection\"],\"deny\":[\"RESTAPI\",\"RESTAPI\",\"RESTAPI\",\"RESTAPI\"]},\"privateEndpoints\":[{\"name\":\"athwt\",\"allow\":[\"ClientConnection\",\"ClientConnection\",\"RESTAPI\"],\"deny\":[\"ClientConnection\"]},{\"name\":\"dxmeb\",\"allow\":[\"ServerConnection\",\"RESTAPI\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"ServerConnection\"]}],\"ipRules\":[{\"value\":\"bfqxnmwmqtibxyi\",\"action\":\"Allow\"},{\"value\":\"vqcttadija\",\"action\":\"Allow\"}]},\"publicNetworkAccess\":\"rsiee\",\"disableLocalAuth\":true,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"apm\",\"resourceStopped\":\"qmeqwigpibudqwyx\",\"socketIO\":{\"serviceMode\":\"ybpmzznrtffyaq\"}},\"kind\":\"WebPubSub\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ismjqfrddgamqu\":{\"principalId\":\"aqh\",\"clientId\":\"eufuqyrxpdlcgql\"},\"vfcdisyirn\":{\"principalId\":\"os\",\"clientId\":\"ju\"},\"rhqvwrevkh\":{\"principalId\":\"hcz\",\"clientId\":\"rxzbujr\"}},\"principalId\":\"lnzonzlrpiqywn\",\"tenantId\":\"jtszcof\"},\"location\":\"e\",\"tags\":{\"murvzm\":\"hgbjkvrelje\",\"anashc\":\"ov\",\"kelvidizozsdb\":\"lpmjerb\"},\"id\":\"cxjmonfdgnwncyp\",\"name\":\"uwwltvuqjctz\",\"type\":\"nkeifz\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"externalIP\":\"nmgixh\",\"hostName\":\"avmqfoudor\",\"publicPort\":199814192,\"serverPort\":1885072328,\"version\":\"rotwypundmbxhugc\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{},\"groupIds\":[\"bmftpmdt\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"ltfvnz\",\"name\":\"yj\",\"type\":\"otp\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"pbdbzqgqqi\",\"privateLinkResourceId\":\"edsvqwthmk\",\"provisioningState\":\"Failed\",\"requestMessage\":\"ysi\",\"fqdns\":[\"qcwdhoh\",\"dtmcd\",\"sufco\",\"dxbzlmcmuap\"],\"status\":\"Pending\"},\"id\":\"bevwqqxeys\",\"name\":\"onqzinkfkbgbzbow\",\"type\":\"eqocljmygvk\"},{\"properties\":{\"groupId\":\"kjjeokbz\",\"privateLinkResourceId\":\"fezrx\",\"provisioningState\":\"Canceled\",\"requestMessage\":\"rtle\",\"fqdns\":[\"xbkwv\"],\"status\":\"Pending\"},\"id\":\"v\",\"name\":\"fbzdixzmqpnoda\",\"type\":\"opqhewjptmc\"},{\"properties\":{\"groupId\":\"bostzel\",\"privateLinkResourceId\":\"dlat\",\"provisioningState\":\"Deleting\",\"requestMessage\":\"lbiojlvfhrb\",\"fqdns\":[\"eqvcwwyyurmoch\",\"prprsnmokay\",\"ejnhlbkpb\",\"pcpil\"],\"status\":\"Pending\"},\"id\":\"zv\",\"name\":\"chndbnwie\",\"type\":\"olewjwi\"},{\"properties\":{\"groupId\":\"bwefqsfapaqtfer\",\"privateLinkResourceId\":\"q\",\"provisioningState\":\"Running\",\"requestMessage\":\"kmfx\",\"fqdns\":[\"wogqqnobpudcdab\",\"qwpwyawbzasqbuc\",\"jg\",\"yexaoguy\"],\"status\":\"Disconnected\"},\"id\":\"dsdaultxijjumf\",\"name\":\"waz\",\"type\":\"nqnm\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"qdqx\",\"liveTraceConfiguration\":{\"enabled\":\"wgnyfusfzsvtui\",\"categories\":[{\"name\":\"jqg\",\"enabled\":\"fh\"},{\"name\":\"rqryxynqn\",\"enabled\":\"dpsovwxznptgo\"},{\"name\":\"ybbabpfhvfsl\",\"enabled\":\"ntjlr\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"kyrioovzid\",\"enabled\":\"waabzmifrygzn\"},{\"name\":\"axri\",\"enabled\":\"zob\"},{\"name\":\"pxl\",\"enabled\":\"lnelxieixynl\"}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"ServerConnection\",\"RESTAPI\",\"Trace\",\"ServerConnection\"],\"deny\":[\"Trace\"]},\"privateEndpoints\":[{\"name\":\"wjutifdwfmv\",\"allow\":[\"ClientConnection\"],\"deny\":[\"Trace\"]},{\"name\":\"ttzhra\",\"allow\":[\"ServerConnection\",\"Trace\"],\"deny\":[\"ClientConnection\",\"Trace\",\"ClientConnection\",\"ServerConnection\"]}],\"ipRules\":[{\"value\":\"ckpzvcpopmxeln\",\"action\":\"Deny\"},{\"value\":\"yjede\",\"action\":\"Allow\"}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"},{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":6902773260918891368},\"publicNetworkAccess\":\"uawxtzx\",\"disableLocalAuth\":true,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"bzxrvxcushsphai\",\"resourceStopped\":\"xyasflvgsgzw\",\"socketIO\":{\"serviceMode\":\"koih\"}},\"sku\":{\"name\":\"smjblmljhlnym\",\"tier\":\"Premium\",\"size\":\"yryuzcb\",\"family\":\"qvx\",\"capacity\":879327923},\"kind\":\"SocketIO\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ltnzoibgsxg\":{\"principalId\":\"supe\",\"clientId\":\"lzqnhcvs\"},\"o\":{\"principalId\":\"fyq\",\"clientId\":\"mpqoxw\"},\"vwbcblembnkbwv\":{\"principalId\":\"bxiqxeiiqbimht\",\"clientId\":\"winhehfqpo\"}},\"principalId\":\"xk\",\"tenantId\":\"vqihebwtswbzuwf\"},\"location\":\"urageg\",\"tags\":{\"qigkx\":\"cjfelisdjubgg\",\"cyrcmjdmspo\":\"bsazgakg\",\"rylniofrzg\":\"apvu\",\"bcuiiz\":\"zjedmstkvnlv\"},\"id\":\"ktwfa\",\"name\":\"snvpdibmi\",\"type\":\"ostbzbkiwb\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.webPubSubs().listByResourceGroup("ktp", com.azure.core.util.Context.NONE); + = manager.webPubSubs().listByResourceGroup("asiibmiybnnust", com.azure.core.util.Context.NONE); - Assertions.assertEquals("e", response.iterator().next().location()); - Assertions.assertEquals("hgbjkvrelje", response.iterator().next().tags().get("murvzm")); - Assertions.assertEquals("merteeammxqiek", response.iterator().next().sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.BASIC, response.iterator().next().sku().tier()); - Assertions.assertEquals(1550017967, response.iterator().next().sku().capacity()); - Assertions.assertEquals(ServiceKind.WEB_PUB_SUB, response.iterator().next().kind()); - Assertions.assertEquals(ManagedIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(false, response.iterator().next().tls().clientCertEnabled()); - Assertions.assertEquals("eafidltugsresm", response.iterator().next().liveTraceConfiguration().enabled()); - Assertions.assertEquals("h", response.iterator().next().liveTraceConfiguration().categories().get(0).name()); - Assertions.assertEquals("ftxfkf", + Assertions.assertEquals("urageg", response.iterator().next().location()); + Assertions.assertEquals("cjfelisdjubgg", response.iterator().next().tags().get("qigkx")); + Assertions.assertEquals("smjblmljhlnym", response.iterator().next().sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.PREMIUM, response.iterator().next().sku().tier()); + Assertions.assertEquals(879327923, response.iterator().next().sku().capacity()); + Assertions.assertEquals(ServiceKind.SOCKET_IO, response.iterator().next().kind()); + Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertTrue(response.iterator().next().tls().clientCertEnabled()); + Assertions.assertEquals("wgnyfusfzsvtui", response.iterator().next().liveTraceConfiguration().enabled()); + Assertions.assertEquals("jqg", response.iterator().next().liveTraceConfiguration().categories().get(0).name()); + Assertions.assertEquals("fh", response.iterator().next().liveTraceConfiguration().categories().get(0).enabled()); - Assertions.assertEquals("jzhajoy", + Assertions.assertEquals("kyrioovzid", response.iterator().next().resourceLogConfiguration().categories().get(0).name()); - Assertions.assertEquals("jlmuoyxprimrsopt", + Assertions.assertEquals("waabzmifrygzn", response.iterator().next().resourceLogConfiguration().categories().get(0).enabled()); Assertions.assertEquals(AclAction.DENY, response.iterator().next().networkACLs().defaultAction()); - Assertions.assertEquals(WebPubSubRequestType.TRACE, + Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, response.iterator().next().networkACLs().publicNetwork().allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.RESTAPI, + Assertions.assertEquals(WebPubSubRequestType.TRACE, response.iterator().next().networkACLs().publicNetwork().deny().get(0)); Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, response.iterator().next().networkACLs().privateEndpoints().get(0).allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, + Assertions.assertEquals(WebPubSubRequestType.TRACE, response.iterator().next().networkACLs().privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("athwt", response.iterator().next().networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("bfqxnmwmqtibxyi", response.iterator().next().networkACLs().ipRules().get(0).value()); - Assertions.assertEquals(AclAction.ALLOW, response.iterator().next().networkACLs().ipRules().get(0).action()); - Assertions.assertEquals("rsiee", response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals(true, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(true, response.iterator().next().disableAadAuth()); - Assertions.assertEquals("apm", response.iterator().next().regionEndpointEnabled()); - Assertions.assertEquals("qmeqwigpibudqwyx", response.iterator().next().resourceStopped()); - Assertions.assertEquals("ybpmzznrtffyaq", response.iterator().next().socketIO().serviceMode()); + Assertions.assertEquals("wjutifdwfmv", + response.iterator().next().networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals("ckpzvcpopmxeln", response.iterator().next().networkACLs().ipRules().get(0).value()); + Assertions.assertEquals(AclAction.DENY, response.iterator().next().networkACLs().ipRules().get(0).action()); + Assertions.assertEquals(6902773260918891368L, + response.iterator().next().applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("uawxtzx", response.iterator().next().publicNetworkAccess()); + Assertions.assertTrue(response.iterator().next().disableLocalAuth()); + Assertions.assertTrue(response.iterator().next().disableAadAuth()); + Assertions.assertEquals("bzxrvxcushsphai", response.iterator().next().regionEndpointEnabled()); + Assertions.assertEquals("xyasflvgsgzw", response.iterator().next().resourceStopped()); + Assertions.assertEquals("koih", response.iterator().next().socketIO().serviceMode()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListMockTests.java index 82ae32d85b6a..bc803c8a7529 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.AclAction; @@ -27,51 +27,53 @@ public final class WebPubSubsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"sku\":{\"name\":\"bugrj\",\"tier\":\"Free\",\"size\":\"jc\",\"family\":\"sofieypefojyqd\",\"capacity\":219137261},\"properties\":{\"provisioningState\":\"Succeeded\",\"externalIP\":\"lcwkhihihlhz\",\"hostName\":\"qtz\",\"publicPort\":693588960,\"serverPort\":1050448632,\"version\":\"wcjhfgmv\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Running\",\"privateEndpoint\":{},\"groupIds\":[\"teyowclu\",\"ovekqvgqouwi\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"pjwyiv\",\"name\":\"ikf\",\"type\":\"cvhrfsp\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{},\"groupIds\":[\"ikteusqczkvyk\",\"xubyjaffmmfblcqc\",\"ubgq\",\"brta\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"tttwgdslqxih\",\"name\":\"rmooizqse\",\"type\":\"pxiutc\"},{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{},\"groupIds\":[\"petogebjox\",\"lhvnhlab\",\"q\",\"kkzjcjbtrga\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"vibr\",\"name\":\"jj\",\"type\":\"toqbeitpkxztmoob\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"privateEndpoint\":{},\"groupIds\":[\"fc\",\"qmpimaqxzhem\",\"yhohujswtwkozzwc\",\"lkb\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"fajnjwltlwtjjguk\",\"name\":\"alhsnvkc\",\"type\":\"mxzrpoa\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"wiaaomylweaz\",\"privateLinkResourceId\":\"lcsethwwnpj\",\"provisioningState\":\"Failed\",\"requestMessage\":\"swpchwahfbousn\",\"status\":\"Pending\"},\"id\":\"fewetwlyxgncx\",\"name\":\"kxhdjhlimmbcx\",\"type\":\"h\"},{\"properties\":{\"groupId\":\"po\",\"privateLinkResourceId\":\"xvxcjzhq\",\"provisioningState\":\"Moving\",\"requestMessage\":\"pxtgqscjav\",\"status\":\"Pending\"},\"id\":\"hdqazkmtgguwp\",\"name\":\"jrajcivm\",\"type\":\"ghfcfiwrxgkneuvy\"},{\"properties\":{\"groupId\":\"zqodfvpgshox\",\"privateLinkResourceId\":\"sgbpfgzdjtx\",\"provisioningState\":\"Creating\",\"requestMessage\":\"bqvgaqv\",\"status\":\"Approved\"},\"id\":\"cqusr\",\"name\":\"vetnwsdtutn\",\"type\":\"lduycv\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"mewip\",\"liveTraceConfiguration\":{\"enabled\":\"k\",\"categories\":[{\"name\":\"uqgsj\",\"enabled\":\"undxgketw\"},{\"name\":\"hzjhf\",\"enabled\":\"hvvmuvgpmun\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"mhfbuzjy\",\"enabled\":\"sasbhu\"},{\"name\":\"pohyuemslynsqyr\",\"enabled\":\"oobrlttyms\"}]},\"networkACLs\":{\"defaultAction\":\"Deny\",\"publicNetwork\":{\"allow\":[\"ServerConnection\",\"Trace\",\"ClientConnection\",\"Trace\"],\"deny\":[\"ServerConnection\",\"ServerConnection\"]},\"privateEndpoints\":[{\"name\":\"axhnfh\",\"allow\":[\"ClientConnection\"],\"deny\":[\"Trace\"]}],\"ipRules\":[{\"value\":\"vk\",\"action\":\"Deny\"},{\"value\":\"un\",\"action\":\"Allow\"}]},\"publicNetworkAccess\":\"rtikvcpwpg\",\"disableLocalAuth\":false,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"tso\",\"resourceStopped\":\"rkenx\",\"socketIO\":{\"serviceMode\":\"yefrpmpdnqqska\"}},\"kind\":\"WebPubSub\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"rfe\":{\"principalId\":\"pqfrtqlkz\",\"clientId\":\"gnitgvkxlzyq\"},\"bkbxgomfa\":{\"principalId\":\"ealzxwhcansymoyq\",\"clientId\":\"wigdi\"},\"zbezkgimsidxasic\":{\"principalId\":\"wasqvdaeyyg\",\"clientId\":\"akjsqz\"},\"qgatjeaahhvjhhn\":{\"principalId\":\"yvvjskgfmo\",\"clientId\":\"ah\"}},\"principalId\":\"zybbj\",\"tenantId\":\"dj\"},\"location\":\"yxkyxvx\",\"tags\":{\"dnlj\":\"lbj\",\"aulx\":\"age\"},\"id\":\"nsmjbnkppxynen\",\"name\":\"svxeizzgwklnsr\",\"type\":\"ffeycx\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"externalIP\":\"phzfylsgcrp\",\"hostName\":\"cunezzcezelfw\",\"publicPort\":446778446,\"serverPort\":377866290,\"version\":\"jwetnpsihcla\",\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{},\"groupIds\":[\"sqqw\",\"tcmwqkchc\",\"waxfewzjkj\"],\"privateLinkServiceConnectionState\":{}},\"id\":\"deqvhp\",\"name\":\"ylkkshkbffmbm\",\"type\":\"zjrgyww\"}],\"sharedPrivateLinkResources\":[{\"properties\":{\"groupId\":\"snptfujgicgaao\",\"privateLinkResourceId\":\"pttaqutd\",\"provisioningState\":\"Updating\",\"requestMessage\":\"xswvru\",\"fqdns\":[\"zjgehkfkim\",\"tixo\",\"ffqyinlj\"],\"status\":\"Disconnected\"},\"id\":\"whixmonstsh\",\"name\":\"yxgvelfcld\",\"type\":\"ccbi\"}],\"tls\":{\"clientCertEnabled\":true},\"hostNamePrefix\":\"wcobie\",\"liveTraceConfiguration\":{\"enabled\":\"mninwjizcilng\",\"categories\":[{\"name\":\"ejjtbxqmul\",\"enabled\":\"lxqzvn\"},{\"name\":\"sbycucrwnamikz\",\"enabled\":\"rqbsmswziq\"},{\"name\":\"uhok\",\"enabled\":\"uswhvhczznvfbycj\"}]},\"resourceLogConfiguration\":{\"categories\":[{\"name\":\"i\",\"enabled\":\"vumwmxqh\"},{\"name\":\"vnoamldseha\",\"enabled\":\"djh\"},{\"name\":\"lzok\",\"enabled\":\"ox\"}]},\"networkACLs\":{\"defaultAction\":\"Allow\",\"publicNetwork\":{\"allow\":[\"ServerConnection\"],\"deny\":[\"RESTAPI\",\"ClientConnection\"]},\"privateEndpoints\":[{\"name\":\"atftgzpnpbsw\",\"allow\":[\"RESTAPI\",\"ServerConnection\",\"Trace\"],\"deny\":[\"Trace\",\"ClientConnection\",\"RESTAPI\"]},{\"name\":\"zihmipgawtxxpky\",\"allow\":[\"ServerConnection\",\"RESTAPI\",\"ServerConnection\",\"RESTAPI\"],\"deny\":[\"Trace\",\"RESTAPI\"]},{\"name\":\"mpcycilrmcaykgg\",\"allow\":[\"Trace\"],\"deny\":[\"RESTAPI\"]},{\"name\":\"ksxwpnd\",\"allow\":[\"ServerConnection\",\"ServerConnection\",\"ClientConnection\"],\"deny\":[\"RESTAPI\",\"ServerConnection\"]}],\"ipRules\":[{\"value\":\"jaosrxuzv\",\"action\":\"Deny\"},{\"value\":\"tcqiosmg\",\"action\":\"Allow\"}]},\"applicationFirewall\":{\"clientConnectionCountRules\":[{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"},{\"type\":\"ClientConnectionCountRule\"}],\"clientTrafficControlRules\":[{\"type\":\"ClientTrafficControlRule\"}],\"maxClientConnectionLifetimeInSeconds\":7353682627301565777},\"publicNetworkAccess\":\"ltlaprltzkatbhj\",\"disableLocalAuth\":true,\"disableAadAuth\":true,\"regionEndpointEnabled\":\"oqeq\",\"resourceStopped\":\"arvlagunbt\",\"socketIO\":{\"serviceMode\":\"bwln\"}},\"sku\":{\"name\":\"hyreeu\",\"tier\":\"Standard\",\"size\":\"vbpdqmjxlyyzglgo\",\"family\":\"tlmj\",\"capacity\":1206140205},\"kind\":\"WebPubSub\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"hsyrqunj\":{\"principalId\":\"kjeytunl\",\"clientId\":\"jkwrusnkq\"},\"abpxuc\":{\"principalId\":\"denxau\",\"clientId\":\"pakdkifmjnnawt\"},\"ruwnpqxpx\":{\"principalId\":\"ggqowey\",\"clientId\":\"dhlisngwflqqmpi\"},\"kv\":{\"principalId\":\"fcngjsa\",\"clientId\":\"iixtmkzj\"}},\"principalId\":\"rhgfgrwsdpgrat\",\"tenantId\":\"zb\"},\"location\":\"byvi\",\"tags\":{\"rgxffmshkw\":\"tbrxkjz\",\"qaclnapxbiy\":\"bkgozxwopdbydpi\",\"nfsm\":\"nugj\",\"i\":\"cttuxuu\"},\"id\":\"flqo\",\"name\":\"quvre\",\"type\":\"mrnjh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.webPubSubs().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("yxkyxvx", response.iterator().next().location()); - Assertions.assertEquals("lbj", response.iterator().next().tags().get("dnlj")); - Assertions.assertEquals("bugrj", response.iterator().next().sku().name()); - Assertions.assertEquals(WebPubSubSkuTier.FREE, response.iterator().next().sku().tier()); - Assertions.assertEquals(219137261, response.iterator().next().sku().capacity()); + Assertions.assertEquals("byvi", response.iterator().next().location()); + Assertions.assertEquals("tbrxkjz", response.iterator().next().tags().get("rgxffmshkw")); + Assertions.assertEquals("hyreeu", response.iterator().next().sku().name()); + Assertions.assertEquals(WebPubSubSkuTier.STANDARD, response.iterator().next().sku().tier()); + Assertions.assertEquals(1206140205, response.iterator().next().sku().capacity()); Assertions.assertEquals(ServiceKind.WEB_PUB_SUB, response.iterator().next().kind()); Assertions.assertEquals(ManagedIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(true, response.iterator().next().tls().clientCertEnabled()); - Assertions.assertEquals("k", response.iterator().next().liveTraceConfiguration().enabled()); - Assertions.assertEquals("uqgsj", + Assertions.assertTrue(response.iterator().next().tls().clientCertEnabled()); + Assertions.assertEquals("mninwjizcilng", response.iterator().next().liveTraceConfiguration().enabled()); + Assertions.assertEquals("ejjtbxqmul", response.iterator().next().liveTraceConfiguration().categories().get(0).name()); - Assertions.assertEquals("undxgketw", + Assertions.assertEquals("lxqzvn", response.iterator().next().liveTraceConfiguration().categories().get(0).enabled()); - Assertions.assertEquals("mhfbuzjy", - response.iterator().next().resourceLogConfiguration().categories().get(0).name()); - Assertions.assertEquals("sasbhu", + Assertions.assertEquals("i", response.iterator().next().resourceLogConfiguration().categories().get(0).name()); + Assertions.assertEquals("vumwmxqh", response.iterator().next().resourceLogConfiguration().categories().get(0).enabled()); - Assertions.assertEquals(AclAction.DENY, response.iterator().next().networkACLs().defaultAction()); + Assertions.assertEquals(AclAction.ALLOW, response.iterator().next().networkACLs().defaultAction()); Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, response.iterator().next().networkACLs().publicNetwork().allow().get(0)); - Assertions.assertEquals(WebPubSubRequestType.SERVER_CONNECTION, + Assertions.assertEquals(WebPubSubRequestType.RESTAPI, response.iterator().next().networkACLs().publicNetwork().deny().get(0)); - Assertions.assertEquals(WebPubSubRequestType.CLIENT_CONNECTION, + Assertions.assertEquals(WebPubSubRequestType.RESTAPI, response.iterator().next().networkACLs().privateEndpoints().get(0).allow().get(0)); Assertions.assertEquals(WebPubSubRequestType.TRACE, response.iterator().next().networkACLs().privateEndpoints().get(0).deny().get(0)); - Assertions.assertEquals("axhnfh", response.iterator().next().networkACLs().privateEndpoints().get(0).name()); - Assertions.assertEquals("vk", response.iterator().next().networkACLs().ipRules().get(0).value()); + Assertions.assertEquals("atftgzpnpbsw", + response.iterator().next().networkACLs().privateEndpoints().get(0).name()); + Assertions.assertEquals("jaosrxuzv", response.iterator().next().networkACLs().ipRules().get(0).value()); Assertions.assertEquals(AclAction.DENY, response.iterator().next().networkACLs().ipRules().get(0).action()); - Assertions.assertEquals("rtikvcpwpg", response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals(false, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(true, response.iterator().next().disableAadAuth()); - Assertions.assertEquals("tso", response.iterator().next().regionEndpointEnabled()); - Assertions.assertEquals("rkenx", response.iterator().next().resourceStopped()); - Assertions.assertEquals("yefrpmpdnqqska", response.iterator().next().socketIO().serviceMode()); + Assertions.assertEquals(7353682627301565777L, + response.iterator().next().applicationFirewall().maxClientConnectionLifetimeInSeconds()); + Assertions.assertEquals("ltlaprltzkatbhj", response.iterator().next().publicNetworkAccess()); + Assertions.assertTrue(response.iterator().next().disableLocalAuth()); + Assertions.assertTrue(response.iterator().next().disableAadAuth()); + Assertions.assertEquals("oqeq", response.iterator().next().regionEndpointEnabled()); + Assertions.assertEquals("arvlagunbt", response.iterator().next().resourceStopped()); + Assertions.assertEquals("bwln", response.iterator().next().socketIO().serviceMode()); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListReplicaSkusWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListReplicaSkusWithResponseMockTests.java index e7c97b52df07..39f6627f3c93 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListReplicaSkusWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListReplicaSkusWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.SkuList; @@ -20,17 +20,17 @@ public final class WebPubSubsListReplicaSkusWithResponseMockTests { @Test public void testListReplicaSkusWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"resourceType\":\"xynqnz\",\"sku\":{\"name\":\"p\",\"tier\":\"Basic\",\"size\":\"xznptgoeiyb\",\"family\":\"bp\",\"capacity\":481403275},\"capacity\":{\"minimum\":899514445,\"maximum\":510494448,\"default\":774606511,\"allowedValues\":[1320093215,446437119,744398036],\"scaleType\":\"Automatic\"}},{\"resourceType\":\"kyrioovzid\",\"sku\":{\"name\":\"waabzmifrygzn\",\"tier\":\"Free\",\"size\":\"ri\",\"family\":\"zob\",\"capacity\":790131449},\"capacity\":{\"minimum\":840646010,\"maximum\":828367604,\"default\":1673403007,\"allowedValues\":[287579834,1754965101,1727894568],\"scaleType\":\"Manual\"}},{\"resourceType\":\"llxecwc\",\"sku\":{\"name\":\"jphslhcaw\",\"tier\":\"Standard\",\"size\":\"fdwfmvigorqj\",\"family\":\"tzh\",\"capacity\":864075629},\"capacity\":{\"minimum\":1692092604,\"maximum\":1169630994,\"default\":234207820,\"allowedValues\":[1776698371],\"scaleType\":\"None\"}}],\"nextLink\":\"ckpzvcpopmxeln\"}"; + = "{\"value\":[{\"resourceType\":\"gpnrhgov\",\"sku\":{\"name\":\"pikqmh\",\"tier\":\"Premium\",\"size\":\"jrmzvupor\",\"family\":\"dfuyd\",\"capacity\":1783861602},\"capacity\":{\"minimum\":2093879286,\"maximum\":282865756,\"default\":396459056,\"allowedValues\":[547334197,1100756882,714588328,441640337],\"scaleType\":\"None\"}},{\"resourceType\":\"khlg\",\"sku\":{\"name\":\"hbemzq\",\"tier\":\"Free\",\"size\":\"uwiwtglxxhljfpg\",\"family\":\"crmnzhrgmqgjs\",\"capacity\":1587486803},\"capacity\":{\"minimum\":1921253497,\"maximum\":1392358666,\"default\":884088920,\"allowedValues\":[1047472486],\"scaleType\":\"None\"}},{\"resourceType\":\"qgvriibakcla\",\"sku\":{\"name\":\"fr\",\"tier\":\"Premium\",\"size\":\"sxauzlwvsgmwohqf\",\"family\":\"zvuxm\",\"capacity\":1264104137},\"capacity\":{\"minimum\":2035263923,\"maximum\":1281920058,\"default\":526082900,\"allowedValues\":[1069656731,656291257],\"scaleType\":\"None\"}}],\"nextLink\":\"ribi\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SkuList response = manager.webPubSubs() - .listReplicaSkusWithResponse("zsvtuikzhajqgl", "fh", "l", com.azure.core.util.Context.NONE) + .listReplicaSkusWithResponse("iypfp", "bcpzgpxtivh", "knidib", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListSkusWithResponseMockTests.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListSkusWithResponseMockTests.java index 61a3d3ae7531..84190fe11085 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListSkusWithResponseMockTests.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/test/java/com/azure/resourcemanager/webpubsub/generated/WebPubSubsListSkusWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.webpubsub.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.webpubsub.WebPubSubManager; import com.azure.resourcemanager.webpubsub.models.SkuList; @@ -20,18 +20,17 @@ public final class WebPubSubsListSkusWithResponseMockTests { @Test public void testListSkusWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"resourceType\":\"cazuaw\",\"sku\":{\"name\":\"z\",\"tier\":\"Standard\",\"size\":\"mwabzxrvxc\",\"family\":\"hsphaivmxyas\",\"capacity\":1805110370},\"capacity\":{\"minimum\":1752644697,\"maximum\":826140742,\"default\":1920170301,\"allowedValues\":[298842617],\"scaleType\":\"Automatic\"}},{\"resourceType\":\"nsmjbl\",\"sku\":{\"name\":\"jhlnymzotqyryu\",\"tier\":\"Standard\",\"size\":\"qqvxmvwfgtayxons\",\"family\":\"e\",\"capacity\":2074822274},\"capacity\":{\"minimum\":330319008,\"maximum\":1093253007,\"default\":1664438715,\"allowedValues\":[1417564823,570379226,1936009218],\"scaleType\":\"Automatic\"}},{\"resourceType\":\"gsxgnxfyqon\",\"sku\":{\"name\":\"qoxwd\",\"tier\":\"Basic\",\"size\":\"xiqxeiiqbimh\",\"family\":\"wwinhehf\",\"capacity\":1711839978},\"capacity\":{\"minimum\":808176503,\"maximum\":712044714,\"default\":1779769711,\"allowedValues\":[29362657,1824383862],\"scaleType\":\"Manual\"}}],\"nextLink\":\"vqvxk\"}"; + = "{\"value\":[{\"resourceType\":\"piwhxqs\",\"sku\":{\"name\":\"tmaaj\",\"tier\":\"Free\",\"size\":\"xylrjvmtygjbmz\",\"family\":\"spsp\",\"capacity\":26175151},\"capacity\":{\"minimum\":311832546,\"maximum\":1546796808,\"default\":796493990,\"allowedValues\":[1680230999,1130862907,1342979435],\"scaleType\":\"None\"}},{\"resourceType\":\"ppyo\",\"sku\":{\"name\":\"ieyujtvc\",\"tier\":\"Standard\",\"size\":\"yxrxmunj\",\"family\":\"vg\",\"capacity\":1877333822},\"capacity\":{\"minimum\":1403533063,\"maximum\":460711183,\"default\":391313028,\"allowedValues\":[1806194501,685816396,1041177322],\"scaleType\":\"None\"}}],\"nextLink\":\"vkhpzvuqdflvo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); WebPubSubManager manager = WebPubSubManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - SkuList response = manager.webPubSubs() - .listSkusWithResponse("clt", "jedexxmlf", com.azure.core.util.Context.NONE) - .getValue(); + SkuList response + = manager.webPubSubs().listSkusWithResponse("owa", "iynknlq", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/tsp-location.yaml b/sdk/webpubsub/azure-resourcemanager-webpubsub/tsp-location.yaml new file mode 100644 index 000000000000..08430b2a3cec --- /dev/null +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/webpubsub/resource-manager/Microsoft.SignalRService/SignalRService +commit: e12a60d5808eaee0bdb982a2c87626d00892f362 +repo: Azure/azure-rest-api-specs +additionalDirectories: