diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/CHANGELOG.md b/sdk/dashboard/azure-resourcemanager-dashboard/CHANGELOG.md index 9a0e82a21a66..11aef00402d9 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/CHANGELOG.md +++ b/sdk/dashboard/azure-resourcemanager-dashboard/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-11-08) + +- Azure Resource Manager Dashboard client library for Java. This package contains Microsoft Azure SDK for Dashboard Management SDK. The Microsoft.Dashboard Rest API spec. Package tag package-2023-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/README.md b/sdk/dashboard/azure-resourcemanager-dashboard/README.md index 0cf90a6b7e2f..66a512c11114 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/README.md +++ b/sdk/dashboard/azure-resourcemanager-dashboard/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Dashboard client library for Java. -This package contains Microsoft Azure SDK for Dashboard Management SDK. The Microsoft.Dashboard Rest API spec. Package tag package-2022-08-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 Dashboard Management SDK. The Microsoft.Dashboard Rest API spec. Package tag package-2023-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-dashboard - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,20 +83,25 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fdashboard%2Fazure-resourcemanager-dashboard%2FREADME.png) diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/SAMPLE.md b/sdk/dashboard/azure-resourcemanager-dashboard/SAMPLE.md index 7a1ac3421850..c97f11ca3e84 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/SAMPLE.md +++ b/sdk/dashboard/azure-resourcemanager-dashboard/SAMPLE.md @@ -3,13 +3,24 @@ ## Grafana +- [CheckEnterpriseDetails](#grafana_checkenterprisedetails) - [Create](#grafana_create) - [Delete](#grafana_delete) +- [FetchAvailablePlugins](#grafana_fetchavailableplugins) - [GetByResourceGroup](#grafana_getbyresourcegroup) - [List](#grafana_list) - [ListByResourceGroup](#grafana_listbyresourcegroup) - [Update](#grafana_update) +## ManagedPrivateEndpoints + +- [Create](#managedprivateendpoints_create) +- [Delete](#managedprivateendpoints_delete) +- [Get](#managedprivateendpoints_get) +- [List](#managedprivateendpoints_list) +- [Refresh](#managedprivateendpoints_refresh) +- [Update](#managedprivateendpoints_update) + ## Operations - [List](#operations_list) @@ -25,18 +36,45 @@ - [Get](#privatelinkresources_get) - [List](#privatelinkresources_list) +### Grafana_CheckEnterpriseDetails + +```java +/** Samples for Grafana CheckEnterpriseDetails. */ +public final class GrafanaCheckEnterpriseDetailsSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/EnterpriseDetails_Post.json + */ + /** + * Sample code: EnterpriseDetails_Post. + * + * @param manager Entry point to DashboardManager. + */ + public static void enterpriseDetailsPost(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .grafanas() + .checkEnterpriseDetailsWithResponse("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + ### Grafana_Create ```java import com.azure.resourcemanager.dashboard.models.ApiKey; import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration; import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; +import com.azure.resourcemanager.dashboard.models.EnterpriseConfigurations; +import com.azure.resourcemanager.dashboard.models.GrafanaConfigurations; import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; +import com.azure.resourcemanager.dashboard.models.GrafanaPlugin; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaProperties; import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentity; import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.dashboard.models.MarketplaceAutoRenew; import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; import com.azure.resourcemanager.dashboard.models.ResourceSku; +import com.azure.resourcemanager.dashboard.models.Smtp; +import com.azure.resourcemanager.dashboard.models.StartTlsPolicy; import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; import java.util.Arrays; import java.util.HashMap; @@ -45,7 +83,7 @@ import java.util.Map; /** Samples for Grafana Create. */ public final class GrafanaCreateSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Create.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Create.json */ /** * Sample code: Grafana_Create. @@ -73,11 +111,30 @@ public final class GrafanaCreateSamples { .asList( new AzureMonitorWorkspaceIntegration() .withAzureMonitorWorkspaceResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"))))) + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace")))) + .withEnterpriseConfigurations( + new EnterpriseConfigurations() + .withMarketplacePlanId("myPlanId") + .withMarketplaceAutoRenew(MarketplaceAutoRenew.ENABLED)) + .withGrafanaConfigurations( + new GrafanaConfigurations() + .withSmtp( + new Smtp() + .withEnabled(true) + .withHost("smtp.sendemail.com:587") + .withUser("username") + .withPassword("fakeTokenPlaceholder") + .withFromAddress("test@sendemail.com") + .withFromName("emailsender") + .withStartTlsPolicy(StartTlsPolicy.OPPORTUNISTIC_START_TLS) + .withSkipVerify(true))) + .withGrafanaPlugins(mapOf("sample-plugin-id", new GrafanaPlugin())) + .withGrafanaMajorVersion("9")) .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -94,12 +151,10 @@ public final class GrafanaCreateSamples { ### Grafana_Delete ```java -import com.azure.core.util.Context; - /** Samples for Grafana Delete. */ public final class GrafanaDeleteSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Delete.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Delete.json */ /** * Sample code: Grafana_Delete. @@ -107,20 +162,39 @@ public final class GrafanaDeleteSamples { * @param manager Entry point to DashboardManager. */ public static void grafanaDelete(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.grafanas().delete("myResourceGroup", "myWorkspace", Context.NONE); + manager.grafanas().delete("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` -### Grafana_GetByResourceGroup +### Grafana_FetchAvailablePlugins ```java -import com.azure.core.util.Context; +/** Samples for Grafana FetchAvailablePlugins. */ +public final class GrafanaFetchAvailablePluginsSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_FetchAvailablePlugins.json + */ + /** + * Sample code: Grafana_FetchAvailablePlugins. + * + * @param manager Entry point to DashboardManager. + */ + public static void grafanaFetchAvailablePlugins(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .grafanas() + .fetchAvailablePluginsWithResponse("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` +### Grafana_GetByResourceGroup + +```java /** Samples for Grafana GetByResourceGroup. */ public final class GrafanaGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Get.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Get.json */ /** * Sample code: Grafana_Get. @@ -128,7 +202,9 @@ public final class GrafanaGetByResourceGroupSamples { * @param manager Entry point to DashboardManager. */ public static void grafanaGet(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.grafanas().getByResourceGroupWithResponse("myResourceGroup", "myWorkspace", Context.NONE); + manager + .grafanas() + .getByResourceGroupWithResponse("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` @@ -136,12 +212,10 @@ public final class GrafanaGetByResourceGroupSamples { ### Grafana_List ```java -import com.azure.core.util.Context; - /** Samples for Grafana List. */ public final class GrafanaListSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_List.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_List.json */ /** * Sample code: Grafana_List. @@ -149,7 +223,7 @@ public final class GrafanaListSamples { * @param manager Entry point to DashboardManager. */ public static void grafanaList(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.grafanas().list(Context.NONE); + manager.grafanas().list(com.azure.core.util.Context.NONE); } } ``` @@ -157,12 +231,10 @@ public final class GrafanaListSamples { ### Grafana_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for Grafana ListByResourceGroup. */ public final class GrafanaListByResourceGroupSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_ListByResourceGroup.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_ListByResourceGroup.json */ /** * Sample code: Grafana_ListByResourceGroup. @@ -170,7 +242,7 @@ public final class GrafanaListByResourceGroupSamples { * @param manager Entry point to DashboardManager. */ public static void grafanaListByResourceGroup(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.grafanas().listByResourceGroup("myResourceGroup", Context.NONE); + manager.grafanas().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); } } ``` @@ -178,13 +250,19 @@ public final class GrafanaListByResourceGroupSamples { ### Grafana_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.dashboard.models.ApiKey; import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration; import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; +import com.azure.resourcemanager.dashboard.models.EnterpriseConfigurations; +import com.azure.resourcemanager.dashboard.models.GrafanaConfigurations; import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; +import com.azure.resourcemanager.dashboard.models.GrafanaPlugin; import com.azure.resourcemanager.dashboard.models.ManagedGrafana; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaPropertiesUpdateParameters; +import com.azure.resourcemanager.dashboard.models.MarketplaceAutoRenew; +import com.azure.resourcemanager.dashboard.models.ResourceSku; +import com.azure.resourcemanager.dashboard.models.Smtp; +import com.azure.resourcemanager.dashboard.models.StartTlsPolicy; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -192,7 +270,7 @@ import java.util.Map; /** Samples for Grafana Update. */ public final class GrafanaUpdateSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Update.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Update.json */ /** * Sample code: Grafana_Update. @@ -203,11 +281,12 @@ public final class GrafanaUpdateSamples { ManagedGrafana resource = manager .grafanas() - .getByResourceGroupWithResponse("myResourceGroup", "myWorkspace", Context.NONE) + .getByResourceGroupWithResponse("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE) .getValue(); resource .update() .withTags(mapOf("Environment", "Dev 2")) + .withSku(new ResourceSku().withName("Standard")) .withProperties( new ManagedGrafanaPropertiesUpdateParameters() .withApiKey(ApiKey.ENABLED) @@ -219,10 +298,29 @@ public final class GrafanaUpdateSamples { .asList( new AzureMonitorWorkspaceIntegration() .withAzureMonitorWorkspaceResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"))))) + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace")))) + .withEnterpriseConfigurations( + new EnterpriseConfigurations() + .withMarketplacePlanId("myPlanId") + .withMarketplaceAutoRenew(MarketplaceAutoRenew.ENABLED)) + .withGrafanaConfigurations( + new GrafanaConfigurations() + .withSmtp( + new Smtp() + .withEnabled(true) + .withHost("smtp.sendemail.com:587") + .withUser("username") + .withPassword("fakeTokenPlaceholder") + .withFromAddress("test@sendemail.com") + .withFromName("emailsender") + .withStartTlsPolicy(StartTlsPolicy.OPPORTUNISTIC_START_TLS) + .withSkipVerify(true))) + .withGrafanaPlugins(mapOf("sample-plugin-id", new GrafanaPlugin())) + .withGrafanaMajorVersion("9")) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -236,15 +334,165 @@ public final class GrafanaUpdateSamples { } ``` -### Operations_List +### ManagedPrivateEndpoints_Create + +```java +import java.util.Arrays; + +/** Samples for ManagedPrivateEndpoints Create. */ +public final class ManagedPrivateEndpointsCreateSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Create.json + */ + /** + * Sample code: ManagedPrivateEndpoint_Create. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointCreate(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .managedPrivateEndpoints() + .define("myMPEName") + .withRegion("West US") + .withExistingGrafana("myResourceGroup", "myWorkspace") + .withPrivateLinkResourceId( + "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-000000000000/resourceGroups/xx-rg/providers/Microsoft.Kusto/Clusters/sampleKustoResource") + .withPrivateLinkResourceRegion("West US") + .withGroupIds(Arrays.asList("grafana")) + .withRequestMessage("Example Request Message") + .withPrivateLinkServiceUrl("my-self-hosted-influxdb.westus.mydomain.com") + .create(); + } +} +``` + +### ManagedPrivateEndpoints_Delete ```java -import com.azure.core.util.Context; +/** Samples for ManagedPrivateEndpoints Delete. */ +public final class ManagedPrivateEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Delete.json + */ + /** + * Sample code: ManagedPrivateEndpoint_Delete. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointDelete(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .managedPrivateEndpoints() + .delete("myResourceGroup", "myWorkspace", "myMPEName", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedPrivateEndpoints_Get +```java +/** Samples for ManagedPrivateEndpoints Get. */ +public final class ManagedPrivateEndpointsGetSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Get.json + */ + /** + * Sample code: ManagedPrivateEndpoint_Get. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointGet(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .managedPrivateEndpoints() + .getWithResponse("myResourceGroup", "myWorkspace", "myMPEName", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedPrivateEndpoints_List + +```java +/** Samples for ManagedPrivateEndpoints List. */ +public final class ManagedPrivateEndpointsListSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_List.json + */ + /** + * Sample code: ManagedPrivateEndpoint_List. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointList(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager.managedPrivateEndpoints().list("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedPrivateEndpoints_Refresh + +```java +/** Samples for ManagedPrivateEndpoints Refresh. */ +public final class ManagedPrivateEndpointsRefreshSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Refresh.json + */ + /** + * Sample code: ManagedPrivateEndpoint_Refresh. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointRefresh(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager.managedPrivateEndpoints().refresh("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedPrivateEndpoints_Update + +```java +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointModel; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedPrivateEndpoints Update. */ +public final class ManagedPrivateEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Patch.json + */ + /** + * Sample code: ManagedPrivateEndpoints_Patch. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointsPatch(com.azure.resourcemanager.dashboard.DashboardManager manager) { + ManagedPrivateEndpointModel resource = + manager + .managedPrivateEndpoints() + .getWithResponse("myResourceGroup", "myWorkspace", "myMPEName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Environment", "Dev 2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Operations_List.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Operations_List.json */ /** * Sample code: Operations_List. @@ -252,7 +500,7 @@ public final class OperationsListSamples { * @param manager Entry point to DashboardManager. */ public static void operationsList(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -263,7 +511,7 @@ public final class OperationsListSamples { /** Samples for PrivateEndpointConnections Approve. */ public final class PrivateEndpointConnectionsApproveSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Approve.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Approve.json */ /** * Sample code: PrivateEndpointConnections_Approve. @@ -283,12 +531,10 @@ public final class PrivateEndpointConnectionsApproveSamples { ### PrivateEndpointConnections_Delete ```java -import com.azure.core.util.Context; - /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Delete.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Delete.json */ /** * Sample code: PrivateEndpointConnections_Delete. @@ -296,7 +542,9 @@ public final class PrivateEndpointConnectionsDeleteSamples { * @param manager Entry point to DashboardManager. */ public static void privateEndpointConnectionsDelete(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.privateEndpointConnections().delete("myResourceGroup", "myWorkspace", "myConnection", Context.NONE); + manager + .privateEndpointConnections() + .delete("myResourceGroup", "myWorkspace", "myConnection", com.azure.core.util.Context.NONE); } } ``` @@ -304,12 +552,10 @@ public final class PrivateEndpointConnectionsDeleteSamples { ### PrivateEndpointConnections_Get ```java -import com.azure.core.util.Context; - /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Get.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Get.json */ /** * Sample code: PrivateEndpointConnections_Get. @@ -319,7 +565,7 @@ public final class PrivateEndpointConnectionsGetSamples { public static void privateEndpointConnectionsGet(com.azure.resourcemanager.dashboard.DashboardManager manager) { manager .privateEndpointConnections() - .getWithResponse("myResourceGroup", "myWorkspace", "myConnection", Context.NONE); + .getWithResponse("myResourceGroup", "myWorkspace", "myConnection", com.azure.core.util.Context.NONE); } } ``` @@ -327,12 +573,10 @@ public final class PrivateEndpointConnectionsGetSamples { ### PrivateEndpointConnections_List ```java -import com.azure.core.util.Context; - /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_List.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_List.json */ /** * Sample code: PrivateEndpointConnections_List. @@ -340,7 +584,7 @@ public final class PrivateEndpointConnectionsListSamples { * @param manager Entry point to DashboardManager. */ public static void privateEndpointConnectionsList(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.privateEndpointConnections().list("myResourceGroup", "myWorkspace", Context.NONE); + manager.privateEndpointConnections().list("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` @@ -348,12 +592,10 @@ public final class PrivateEndpointConnectionsListSamples { ### PrivateLinkResources_Get ```java -import com.azure.core.util.Context; - /** Samples for PrivateLinkResources Get. */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_Get.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_Get.json */ /** * Sample code: PrivateLinkResources_Get. @@ -361,7 +603,9 @@ public final class PrivateLinkResourcesGetSamples { * @param manager Entry point to DashboardManager. */ public static void privateLinkResourcesGet(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.privateLinkResources().getWithResponse("myResourceGroup", "myWorkspace", "grafana", Context.NONE); + manager + .privateLinkResources() + .getWithResponse("myResourceGroup", "myWorkspace", "grafana", com.azure.core.util.Context.NONE); } } ``` @@ -369,12 +613,10 @@ public final class PrivateLinkResourcesGetSamples { ### PrivateLinkResources_List ```java -import com.azure.core.util.Context; - /** Samples for PrivateLinkResources List. */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_List.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_List.json */ /** * Sample code: PrivateLinkResources_List. @@ -382,7 +624,7 @@ public final class PrivateLinkResourcesListSamples { * @param manager Entry point to DashboardManager. */ public static void privateLinkResourcesList(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.privateLinkResources().list("myResourceGroup", "myWorkspace", Context.NONE); + manager.privateLinkResources().list("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/pom.xml b/sdk/dashboard/azure-resourcemanager-dashboard/pom.xml index dc9a1b9f8bb5..e4c3b7fa30a6 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/pom.xml +++ b/sdk/dashboard/azure-resourcemanager-dashboard/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for Dashboard Management - This package contains Microsoft Azure SDK for Dashboard Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft.Dashboard Rest API spec. Package tag package-2022-08-01. + This package contains Microsoft Azure SDK for Dashboard Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft.Dashboard Rest API spec. Package tag package-2023-09-01. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/DashboardManager.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/DashboardManager.java index 8e1812d60d59..59e73fa20221 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/DashboardManager.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/DashboardManager.java @@ -26,10 +26,12 @@ import com.azure.resourcemanager.dashboard.fluent.DashboardManagementClient; import com.azure.resourcemanager.dashboard.implementation.DashboardManagementClientBuilder; import com.azure.resourcemanager.dashboard.implementation.GrafanasImpl; +import com.azure.resourcemanager.dashboard.implementation.ManagedPrivateEndpointsImpl; import com.azure.resourcemanager.dashboard.implementation.OperationsImpl; import com.azure.resourcemanager.dashboard.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.dashboard.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.dashboard.models.Grafanas; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpoints; import com.azure.resourcemanager.dashboard.models.Operations; import com.azure.resourcemanager.dashboard.models.PrivateEndpointConnections; import com.azure.resourcemanager.dashboard.models.PrivateLinkResources; @@ -50,6 +52,8 @@ public final class DashboardManager { private PrivateLinkResources privateLinkResources; + private ManagedPrivateEndpoints managedPrivateEndpoints; + private final DashboardManagementClient clientObject; private DashboardManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -215,7 +219,7 @@ public DashboardManager authenticate(TokenCredential credential, AzureProfile pr .append("-") .append("com.azure.resourcemanager.dashboard") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -322,8 +326,23 @@ public PrivateLinkResources privateLinkResources() { } /** - * @return Wrapped service client DashboardManagementClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. + * Gets the resource collection API of ManagedPrivateEndpoints. It manages ManagedPrivateEndpointModel. + * + * @return Resource collection API of ManagedPrivateEndpoints. + */ + public ManagedPrivateEndpoints managedPrivateEndpoints() { + if (this.managedPrivateEndpoints == null) { + this.managedPrivateEndpoints = + new ManagedPrivateEndpointsImpl(clientObject.getManagedPrivateEndpoints(), this); + } + return managedPrivateEndpoints; + } + + /** + * Gets wrapped service client DashboardManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client DashboardManagementClient. */ public DashboardManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/DashboardManagementClient.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/DashboardManagementClient.java index fb119a235145..7b5eb5e20adb 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/DashboardManagementClient.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/DashboardManagementClient.java @@ -71,4 +71,11 @@ public interface DashboardManagementClient { * @return the PrivateLinkResourcesClient object. */ PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the ManagedPrivateEndpointsClient object to access its operations. + * + * @return the ManagedPrivateEndpointsClient object. + */ + ManagedPrivateEndpointsClient getManagedPrivateEndpoints(); } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/GrafanasClient.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/GrafanasClient.java index 47f5326be81b..04a17c9770f7 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/GrafanasClient.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/GrafanasClient.java @@ -11,7 +11,10 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dashboard.fluent.models.EnterpriseDetailsInner; +import com.azure.resourcemanager.dashboard.fluent.models.GrafanaAvailablePluginListResponseInner; import com.azure.resourcemanager.dashboard.fluent.models.ManagedGrafanaInner; +import com.azure.resourcemanager.dashboard.models.GrafanasUpdateResponse; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaUpdateParameters; /** An instance of this class provides access to all the operations defined in GrafanasClient. */ @@ -68,28 +71,28 @@ public interface GrafanasClient { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specific workspace for Grafana resource. + * @return the properties of a specific workspace for Grafana resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ManagedGrafanaInner getByResourceGroup(String resourceGroupName, String workspaceName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context); /** * Get the properties of a specific workspace for Grafana resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specific workspace for Grafana resource along with {@link Response}. + * @return the properties of a specific workspace for Grafana resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context); + ManagedGrafanaInner getByResourceGroup(String resourceGroupName, String workspaceName); /** * Create or update a workspace for Grafana resource. This API is idempotent, so user can either create a new @@ -163,14 +166,18 @@ ManagedGrafanaInner create( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param requestBodyParameters The parameters for a PATCH request to a grafana 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 grafana resource type. */ @ServiceMethod(returns = ReturnType.SINGLE) - ManagedGrafanaInner update( - String resourceGroupName, String workspaceName, ManagedGrafanaUpdateParameters requestBodyParameters); + GrafanasUpdateResponse updateWithResponse( + String resourceGroupName, + String workspaceName, + ManagedGrafanaUpdateParameters requestBodyParameters, + Context context); /** * Update a workspace for Grafana resource. @@ -178,18 +185,14 @@ ManagedGrafanaInner update( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param requestBodyParameters The parameters for a PATCH request to a grafana 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 grafana resource type along with {@link Response}. + * @return the grafana resource type. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String workspaceName, - ManagedGrafanaUpdateParameters requestBodyParameters, - Context context); + ManagedGrafanaInner update( + String resourceGroupName, String workspaceName, ManagedGrafanaUpdateParameters requestBodyParameters); /** * Delete a workspace for Grafana resource. @@ -242,4 +245,60 @@ Response updateWithResponse( */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String workspaceName, Context context); + + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkEnterpriseDetailsWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EnterpriseDetailsInner checkEnterpriseDetails(String resourceGroupName, String workspaceName); + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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) + Response fetchAvailablePluginsWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GrafanaAvailablePluginListResponseInner fetchAvailablePlugins(String resourceGroupName, String workspaceName); } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/ManagedPrivateEndpointsClient.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/ManagedPrivateEndpointsClient.java new file mode 100644 index 000000000000..4495665c354d --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/ManagedPrivateEndpointsClient.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.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.dashboard.fluent.models.ManagedPrivateEndpointModelInner; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ManagedPrivateEndpointsClient. */ +public interface ManagedPrivateEndpointsClient { + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of managed private endpoints of a grafana resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of managed private endpoints of a grafana resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, Context context); + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRefresh(String resourceGroupName, String workspaceName); + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRefresh(String resourceGroupName, String workspaceName, Context context); + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String resourceGroupName, String workspaceName); + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String resourceGroupName, String workspaceName, Context context); + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific managed private endpoint of a grafana resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName, Context context); + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific managed private endpoint of a grafana resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointModelInner get( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName); + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedPrivateEndpointModelInner> beginCreate( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters); + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedPrivateEndpointModelInner> beginCreate( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters, + Context context); + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointModelInner create( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters); + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointModelInner create( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters, + Context context); + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedPrivateEndpointModelInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters); + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedPrivateEndpointModelInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters, + Context context); + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointModelInner update( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters); + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointModelInner update( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters, + Context context); + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 workspaceName, String managedPrivateEndpointName); + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 workspaceName, String managedPrivateEndpointName, Context context); + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String managedPrivateEndpointName); + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String managedPrivateEndpointName, Context context); +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/PrivateEndpointConnectionsClient.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/PrivateEndpointConnectionsClient.java index d8a565d0fa9f..ab8caa15652c 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/PrivateEndpointConnectionsClient.java @@ -21,14 +21,15 @@ public interface PrivateEndpointConnectionsClient { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connections. + * @return private endpoint connections along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); /** * Get private endpoint connections. @@ -36,15 +37,14 @@ PrivateEndpointConnectionInner get( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connections along with {@link Response}. + * @return private endpoint connections. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnectionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** * Manual approve private endpoint connection. @@ -52,7 +52,6 @@ Response getWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. - * @param body The Private Endpoint Connection 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. @@ -60,10 +59,7 @@ Response getWithResponse( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginApprove( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner body); + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** * Manual approve private endpoint connection. @@ -86,25 +82,6 @@ SyncPoller, PrivateEndpointConnection PrivateEndpointConnectionInner body, Context context); - /** - * Manual approve private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The workspace name of Azure Managed Grafana. - * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. - * @param body The Private Endpoint Connection 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 Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner approve( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner body); - /** * Manual approve private endpoint connection. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/PrivateLinkResourcesClient.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/PrivateLinkResourcesClient.java index ba7ae19ee220..2230128ea99d 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/PrivateLinkResourcesClient.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/PrivateLinkResourcesClient.java @@ -46,13 +46,15 @@ public interface PrivateLinkResourcesClient { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateLinkResourceName The privateLinkResourceName parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific private link resource information for this grafana resource. + * @return specific private link resource information for this grafana resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner get(String resourceGroupName, String workspaceName, String privateLinkResourceName); + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context); /** * Get specific private link resource information for this grafana resource. @@ -60,13 +62,11 @@ public interface PrivateLinkResourcesClient { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateLinkResourceName The privateLinkResourceName parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific private link resource information for this grafana resource along with {@link Response}. + * @return specific private link resource information for this grafana resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context); + PrivateLinkResourceInner get(String resourceGroupName, String workspaceName, String privateLinkResourceName); } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/EnterpriseDetailsInner.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/EnterpriseDetailsInner.java new file mode 100644 index 000000000000..ba817f455624 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/EnterpriseDetailsInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dashboard.models.MarketplaceTrialQuota; +import com.azure.resourcemanager.dashboard.models.SaasSubscriptionDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Enterprise details of a Grafana instance. */ +@Fluent +public final class EnterpriseDetailsInner { + /* + * SaaS subscription details of a Grafana instance + */ + @JsonProperty(value = "saasSubscriptionDetails") + private SaasSubscriptionDetails saasSubscriptionDetails; + + /* + * The allocation details of the per subscription free trial slot of the subscription. + */ + @JsonProperty(value = "marketplaceTrialQuota") + private MarketplaceTrialQuota marketplaceTrialQuota; + + /** Creates an instance of EnterpriseDetailsInner class. */ + public EnterpriseDetailsInner() { + } + + /** + * Get the saasSubscriptionDetails property: SaaS subscription details of a Grafana instance. + * + * @return the saasSubscriptionDetails value. + */ + public SaasSubscriptionDetails saasSubscriptionDetails() { + return this.saasSubscriptionDetails; + } + + /** + * Set the saasSubscriptionDetails property: SaaS subscription details of a Grafana instance. + * + * @param saasSubscriptionDetails the saasSubscriptionDetails value to set. + * @return the EnterpriseDetailsInner object itself. + */ + public EnterpriseDetailsInner withSaasSubscriptionDetails(SaasSubscriptionDetails saasSubscriptionDetails) { + this.saasSubscriptionDetails = saasSubscriptionDetails; + return this; + } + + /** + * Get the marketplaceTrialQuota property: The allocation details of the per subscription free trial slot of the + * subscription. + * + * @return the marketplaceTrialQuota value. + */ + public MarketplaceTrialQuota marketplaceTrialQuota() { + return this.marketplaceTrialQuota; + } + + /** + * Set the marketplaceTrialQuota property: The allocation details of the per subscription free trial slot of the + * subscription. + * + * @param marketplaceTrialQuota the marketplaceTrialQuota value to set. + * @return the EnterpriseDetailsInner object itself. + */ + public EnterpriseDetailsInner withMarketplaceTrialQuota(MarketplaceTrialQuota marketplaceTrialQuota) { + this.marketplaceTrialQuota = marketplaceTrialQuota; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (saasSubscriptionDetails() != null) { + saasSubscriptionDetails().validate(); + } + if (marketplaceTrialQuota() != null) { + marketplaceTrialQuota().validate(); + } + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/GrafanaAvailablePluginListResponseInner.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/GrafanaAvailablePluginListResponseInner.java new file mode 100644 index 000000000000..d91becb1700c --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/GrafanaAvailablePluginListResponseInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dashboard.models.GrafanaAvailablePlugin; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The GrafanaAvailablePluginListResponse model. */ +@Fluent +public final class GrafanaAvailablePluginListResponseInner { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GrafanaAvailablePluginListResponseInner class. */ + public GrafanaAvailablePluginListResponseInner() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the GrafanaAvailablePluginListResponseInner object itself. + */ + public GrafanaAvailablePluginListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the GrafanaAvailablePluginListResponseInner object itself. + */ + public GrafanaAvailablePluginListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedGrafanaInner.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedGrafanaInner.java index ae9f836d063c..00e5733fde0c 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedGrafanaInner.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedGrafanaInner.java @@ -40,6 +40,10 @@ public final class ManagedGrafanaInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of ManagedGrafanaInner class. */ + public ManagedGrafanaInner() { + } + /** * Get the sku property: The Sku of the grafana resource. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedPrivateEndpointModelInner.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedPrivateEndpointModelInner.java new file mode 100644 index 000000000000..f494e42770d1 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedPrivateEndpointModelInner.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointConnectionState; +import com.azure.resourcemanager.dashboard.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The managed private endpoint resource type. */ +@Fluent +public final class ManagedPrivateEndpointModelInner extends Resource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private ManagedPrivateEndpointModelProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ManagedPrivateEndpointModelInner class. */ + public ManagedPrivateEndpointModelInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private ManagedPrivateEndpointModelProperties 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; + } + + /** {@inheritDoc} */ + @Override + public ManagedPrivateEndpointModelInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedPrivateEndpointModelInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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 privateLinkResourceId property: The ARM resource ID of the resource for which the managed private + * endpoint is pointing to. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId(); + } + + /** + * Set the privateLinkResourceId property: The ARM resource ID of the resource for which the managed private + * endpoint is pointing to. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the ManagedPrivateEndpointModelInner object itself. + */ + public ManagedPrivateEndpointModelInner withPrivateLinkResourceId(String privateLinkResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedPrivateEndpointModelProperties(); + } + this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + /** + * Get the privateLinkResourceRegion property: The region of the resource to which the managed private endpoint is + * pointing to. + * + * @return the privateLinkResourceRegion value. + */ + public String privateLinkResourceRegion() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceRegion(); + } + + /** + * Set the privateLinkResourceRegion property: The region of the resource to which the managed private endpoint is + * pointing to. + * + * @param privateLinkResourceRegion the privateLinkResourceRegion value to set. + * @return the ManagedPrivateEndpointModelInner object itself. + */ + public ManagedPrivateEndpointModelInner withPrivateLinkResourceRegion(String privateLinkResourceRegion) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedPrivateEndpointModelProperties(); + } + this.innerProperties().withPrivateLinkResourceRegion(privateLinkResourceRegion); + return this; + } + + /** + * Get the groupIds property: The group Ids of the managed private endpoint. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Set the groupIds property: The group Ids of the managed private endpoint. + * + * @param groupIds the groupIds value to set. + * @return the ManagedPrivateEndpointModelInner object itself. + */ + public ManagedPrivateEndpointModelInner withGroupIds(List groupIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedPrivateEndpointModelProperties(); + } + this.innerProperties().withGroupIds(groupIds); + return this; + } + + /** + * Get the requestMessage property: User input request message of the managed private endpoint. + * + * @return the requestMessage value. + */ + public String requestMessage() { + return this.innerProperties() == null ? null : this.innerProperties().requestMessage(); + } + + /** + * Set the requestMessage property: User input request message of the managed private endpoint. + * + * @param requestMessage the requestMessage value to set. + * @return the ManagedPrivateEndpointModelInner object itself. + */ + public ManagedPrivateEndpointModelInner withRequestMessage(String requestMessage) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedPrivateEndpointModelProperties(); + } + this.innerProperties().withRequestMessage(requestMessage); + return this; + } + + /** + * Get the connectionState property: The state of managed private endpoint connection. + * + * @return the connectionState value. + */ + public ManagedPrivateEndpointConnectionState connectionState() { + return this.innerProperties() == null ? null : this.innerProperties().connectionState(); + } + + /** + * Get the privateLinkServiceUrl property: The URL of the data store behind the private link service. It would be + * the URL in the Grafana data source configuration page without the protocol and port. + * + * @return the privateLinkServiceUrl value. + */ + public String privateLinkServiceUrl() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceUrl(); + } + + /** + * Set the privateLinkServiceUrl property: The URL of the data store behind the private link service. It would be + * the URL in the Grafana data source configuration page without the protocol and port. + * + * @param privateLinkServiceUrl the privateLinkServiceUrl value to set. + * @return the ManagedPrivateEndpointModelInner object itself. + */ + public ManagedPrivateEndpointModelInner withPrivateLinkServiceUrl(String privateLinkServiceUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedPrivateEndpointModelProperties(); + } + this.innerProperties().withPrivateLinkServiceUrl(privateLinkServiceUrl); + return this; + } + + /** + * Get the privateLinkServicePrivateIp property: The private IP of private endpoint after approval. This property is + * empty before connection is approved. + * + * @return the privateLinkServicePrivateIp value. + */ + public String privateLinkServicePrivateIp() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServicePrivateIp(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedPrivateEndpointModelProperties.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedPrivateEndpointModelProperties.java new file mode 100644 index 000000000000..3c96ede02a4e --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/ManagedPrivateEndpointModelProperties.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointConnectionState; +import com.azure.resourcemanager.dashboard.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties specific to the managed private endpoint. */ +@Fluent +public final class ManagedPrivateEndpointModelProperties { + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The ARM resource ID of the resource for which the managed private endpoint is pointing to. + */ + @JsonProperty(value = "privateLinkResourceId") + private String privateLinkResourceId; + + /* + * The region of the resource to which the managed private endpoint is pointing to. + */ + @JsonProperty(value = "privateLinkResourceRegion") + private String privateLinkResourceRegion; + + /* + * The group Ids of the managed private endpoint. + */ + @JsonProperty(value = "groupIds") + private List groupIds; + + /* + * User input request message of the managed private endpoint. + */ + @JsonProperty(value = "requestMessage") + private String requestMessage; + + /* + * The state of managed private endpoint connection. + */ + @JsonProperty(value = "connectionState", access = JsonProperty.Access.WRITE_ONLY) + private ManagedPrivateEndpointConnectionState connectionState; + + /* + * The URL of the data store behind the private link service. It would be the URL in the Grafana data source + * configuration page without the protocol and port. + */ + @JsonProperty(value = "privateLinkServiceUrl") + private String privateLinkServiceUrl; + + /* + * The private IP of private endpoint after approval. This property is empty before connection is approved. + */ + @JsonProperty(value = "privateLinkServicePrivateIP", access = JsonProperty.Access.WRITE_ONLY) + private String privateLinkServicePrivateIp; + + /** Creates an instance of ManagedPrivateEndpointModelProperties class. */ + public ManagedPrivateEndpointModelProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateLinkResourceId property: The ARM resource ID of the resource for which the managed private + * endpoint is pointing to. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the privateLinkResourceId property: The ARM resource ID of the resource for which the managed private + * endpoint is pointing to. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the ManagedPrivateEndpointModelProperties object itself. + */ + public ManagedPrivateEndpointModelProperties withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the privateLinkResourceRegion property: The region of the resource to which the managed private endpoint is + * pointing to. + * + * @return the privateLinkResourceRegion value. + */ + public String privateLinkResourceRegion() { + return this.privateLinkResourceRegion; + } + + /** + * Set the privateLinkResourceRegion property: The region of the resource to which the managed private endpoint is + * pointing to. + * + * @param privateLinkResourceRegion the privateLinkResourceRegion value to set. + * @return the ManagedPrivateEndpointModelProperties object itself. + */ + public ManagedPrivateEndpointModelProperties withPrivateLinkResourceRegion(String privateLinkResourceRegion) { + this.privateLinkResourceRegion = privateLinkResourceRegion; + return this; + } + + /** + * Get the groupIds property: The group Ids of the managed private endpoint. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set the groupIds property: The group Ids of the managed private endpoint. + * + * @param groupIds the groupIds value to set. + * @return the ManagedPrivateEndpointModelProperties object itself. + */ + public ManagedPrivateEndpointModelProperties withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + + /** + * Get the requestMessage property: User input request message of the managed private endpoint. + * + * @return the requestMessage value. + */ + public String requestMessage() { + return this.requestMessage; + } + + /** + * Set the requestMessage property: User input request message of the managed private endpoint. + * + * @param requestMessage the requestMessage value to set. + * @return the ManagedPrivateEndpointModelProperties object itself. + */ + public ManagedPrivateEndpointModelProperties withRequestMessage(String requestMessage) { + this.requestMessage = requestMessage; + return this; + } + + /** + * Get the connectionState property: The state of managed private endpoint connection. + * + * @return the connectionState value. + */ + public ManagedPrivateEndpointConnectionState connectionState() { + return this.connectionState; + } + + /** + * Get the privateLinkServiceUrl property: The URL of the data store behind the private link service. It would be + * the URL in the Grafana data source configuration page without the protocol and port. + * + * @return the privateLinkServiceUrl value. + */ + public String privateLinkServiceUrl() { + return this.privateLinkServiceUrl; + } + + /** + * Set the privateLinkServiceUrl property: The URL of the data store behind the private link service. It would be + * the URL in the Grafana data source configuration page without the protocol and port. + * + * @param privateLinkServiceUrl the privateLinkServiceUrl value to set. + * @return the ManagedPrivateEndpointModelProperties object itself. + */ + public ManagedPrivateEndpointModelProperties withPrivateLinkServiceUrl(String privateLinkServiceUrl) { + this.privateLinkServiceUrl = privateLinkServiceUrl; + return this; + } + + /** + * Get the privateLinkServicePrivateIp property: The private IP of private endpoint after approval. This property is + * empty before connection is approved. + * + * @return the privateLinkServicePrivateIp value. + */ + public String privateLinkServicePrivateIp() { + return this.privateLinkServicePrivateIp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionState() != null) { + connectionState().validate(); + } + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/OperationInner.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/OperationInner.java index ea2ae030758f..5be8fdf13e1a 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/OperationInner.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/OperationInner.java @@ -50,6 +50,10 @@ public final class OperationInner { @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateEndpointConnectionInner.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateEndpointConnectionInner.java index c072912a6b8a..4df938141126 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateEndpointConnectionInner.java @@ -28,6 +28,10 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + /** * Get the innerProperties property: Resource properties. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateEndpointConnectionProperties.java index 4f3d161d44cb..bd748bcc7c86 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateEndpointConnectionProperties.java @@ -39,6 +39,10 @@ public final class PrivateEndpointConnectionProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnectionProvisioningState provisioningState; + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + /** * Get the privateEndpoint property: The resource of private end point. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateLinkResourceInner.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateLinkResourceInner.java index b55664263ed7..f777c3d24785 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateLinkResourceInner.java @@ -26,6 +26,10 @@ public final class PrivateLinkResourceInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of PrivateLinkResourceInner class. */ + public PrivateLinkResourceInner() { + } + /** * Get the innerProperties property: Resource properties. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateLinkResourceProperties.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateLinkResourceProperties.java index 3ce063502445..9c1e4e8831e0 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/fluent/models/PrivateLinkResourceProperties.java @@ -36,6 +36,10 @@ public final class PrivateLinkResourceProperties { @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + /** * Get the provisioningState property: Provisioning state of the resource. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/DashboardManagementClientBuilder.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/DashboardManagementClientBuilder.java index d61e0cd06cc3..e54b4405912c 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/DashboardManagementClientBuilder.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/DashboardManagementClientBuilder.java @@ -137,7 +137,7 @@ public DashboardManagementClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/DashboardManagementClientImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/DashboardManagementClientImpl.java index 37b89da5401a..a92c1f6de92c 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/DashboardManagementClientImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/DashboardManagementClientImpl.java @@ -24,6 +24,7 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.dashboard.fluent.DashboardManagementClient; import com.azure.resourcemanager.dashboard.fluent.GrafanasClient; +import com.azure.resourcemanager.dashboard.fluent.ManagedPrivateEndpointsClient; import com.azure.resourcemanager.dashboard.fluent.OperationsClient; import com.azure.resourcemanager.dashboard.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.dashboard.fluent.PrivateLinkResourcesClient; @@ -159,6 +160,18 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** The ManagedPrivateEndpointsClient object to access its operations. */ + private final ManagedPrivateEndpointsClient managedPrivateEndpoints; + + /** + * Gets the ManagedPrivateEndpointsClient object to access its operations. + * + * @return the ManagedPrivateEndpointsClient object. + */ + public ManagedPrivateEndpointsClient getManagedPrivateEndpoints() { + return this.managedPrivateEndpoints; + } + /** * Initializes an instance of DashboardManagementClient client. * @@ -181,11 +194,12 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-08-01"; + this.apiVersion = "2023-09-01"; this.operations = new OperationsClientImpl(this); this.grafanas = new GrafanasClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.managedPrivateEndpoints = new ManagedPrivateEndpointsClientImpl(this); } /** diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/EnterpriseDetailsImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/EnterpriseDetailsImpl.java new file mode 100644 index 000000000000..600ddd135d53 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/EnterpriseDetailsImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.implementation; + +import com.azure.resourcemanager.dashboard.fluent.models.EnterpriseDetailsInner; +import com.azure.resourcemanager.dashboard.models.EnterpriseDetails; +import com.azure.resourcemanager.dashboard.models.MarketplaceTrialQuota; +import com.azure.resourcemanager.dashboard.models.SaasSubscriptionDetails; + +public final class EnterpriseDetailsImpl implements EnterpriseDetails { + private EnterpriseDetailsInner innerObject; + + private final com.azure.resourcemanager.dashboard.DashboardManager serviceManager; + + EnterpriseDetailsImpl( + EnterpriseDetailsInner innerObject, com.azure.resourcemanager.dashboard.DashboardManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SaasSubscriptionDetails saasSubscriptionDetails() { + return this.innerModel().saasSubscriptionDetails(); + } + + public MarketplaceTrialQuota marketplaceTrialQuota() { + return this.innerModel().marketplaceTrialQuota(); + } + + public EnterpriseDetailsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dashboard.DashboardManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanaAvailablePluginListResponseImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanaAvailablePluginListResponseImpl.java new file mode 100644 index 000000000000..904a9ecea8b2 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanaAvailablePluginListResponseImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.implementation; + +import com.azure.resourcemanager.dashboard.fluent.models.GrafanaAvailablePluginListResponseInner; +import com.azure.resourcemanager.dashboard.models.GrafanaAvailablePlugin; +import com.azure.resourcemanager.dashboard.models.GrafanaAvailablePluginListResponse; +import java.util.Collections; +import java.util.List; + +public final class GrafanaAvailablePluginListResponseImpl implements GrafanaAvailablePluginListResponse { + private GrafanaAvailablePluginListResponseInner innerObject; + + private final com.azure.resourcemanager.dashboard.DashboardManager serviceManager; + + GrafanaAvailablePluginListResponseImpl( + GrafanaAvailablePluginListResponseInner innerObject, + com.azure.resourcemanager.dashboard.DashboardManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public GrafanaAvailablePluginListResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dashboard.DashboardManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanasClientImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanasClientImpl.java index dd9c70085475..98e9468f62df 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanasClientImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanasClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -33,7 +34,10 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.dashboard.fluent.GrafanasClient; +import com.azure.resourcemanager.dashboard.fluent.models.EnterpriseDetailsInner; +import com.azure.resourcemanager.dashboard.fluent.models.GrafanaAvailablePluginListResponseInner; import com.azure.resourcemanager.dashboard.fluent.models.ManagedGrafanaInner; +import com.azure.resourcemanager.dashboard.models.GrafanasUpdateResponse; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaListResponse; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaUpdateParameters; import java.nio.ByteBuffer; @@ -64,7 +68,7 @@ public final class GrafanasClientImpl implements GrafanasClient { */ @Host("{$host}") @ServiceInterface(name = "DashboardManagementC") - private interface GrafanasService { + public interface GrafanasService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Dashboard/grafana") @ExpectedResponses({200}) @@ -90,8 +94,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -105,8 +108,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @@ -121,11 +123,10 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono update( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -137,8 +138,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -150,6 +150,34 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/checkEnterpriseDetails") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkEnterpriseDetails( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/fetchAvailablePlugins") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> fetchAvailablePlugins( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -591,14 +619,16 @@ private Mono getByResourceGroupAsync(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specific workspace for Grafana resource. + * @return the properties of a specific workspace for Grafana resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedGrafanaInner getByResourceGroup(String resourceGroupName, String workspaceName) { - return getByResourceGroupAsync(resourceGroupName, workspaceName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); } /** @@ -606,16 +636,14 @@ public ManagedGrafanaInner getByResourceGroup(String resourceGroupName, String w * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specific workspace for Grafana resource along with {@link Response}. + * @return the properties of a specific workspace for Grafana resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + public ManagedGrafanaInner getByResourceGroup(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } /** @@ -797,7 +825,7 @@ private PollerFlux, ManagedGrafanaInner> beginCr @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ManagedGrafanaInner> beginCreate( String resourceGroupName, String workspaceName, ManagedGrafanaInner requestBodyParameters) { - return beginCreateAsync(resourceGroupName, workspaceName, requestBodyParameters).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, workspaceName, requestBodyParameters).getSyncPoller(); } /** @@ -816,7 +844,7 @@ public SyncPoller, ManagedGrafanaInner> beginCre @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ManagedGrafanaInner> beginCreate( String resourceGroupName, String workspaceName, ManagedGrafanaInner requestBodyParameters, Context context) { - return beginCreateAsync(resourceGroupName, workspaceName, requestBodyParameters, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, workspaceName, requestBodyParameters, context).getSyncPoller(); } /** @@ -906,10 +934,10 @@ public ManagedGrafanaInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the grafana resource type along with {@link Response} on successful completion of {@link Mono}. + * @return the grafana resource type on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono updateWithResponseAsync( String resourceGroupName, String workspaceName, ManagedGrafanaUpdateParameters requestBodyParameters) { if (this.client.getEndpoint() == null) { return Mono @@ -963,10 +991,10 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the grafana resource type along with {@link Response} on successful completion of {@link Mono}. + * @return the grafana resource type on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono updateWithResponseAsync( String resourceGroupName, String workspaceName, ManagedGrafanaUpdateParameters requestBodyParameters, @@ -1034,15 +1062,19 @@ private Mono updateAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param requestBodyParameters The parameters for a PATCH request to a grafana 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 grafana resource type. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedGrafanaInner update( - String resourceGroupName, String workspaceName, ManagedGrafanaUpdateParameters requestBodyParameters) { - return updateAsync(resourceGroupName, workspaceName, requestBodyParameters).block(); + public GrafanasUpdateResponse updateWithResponse( + String resourceGroupName, + String workspaceName, + ManagedGrafanaUpdateParameters requestBodyParameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, requestBodyParameters, context).block(); } /** @@ -1051,19 +1083,15 @@ public ManagedGrafanaInner update( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param requestBodyParameters The parameters for a PATCH request to a grafana 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 grafana resource type along with {@link Response}. + * @return the grafana resource type. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String workspaceName, - ManagedGrafanaUpdateParameters requestBodyParameters, - Context context) { - return updateWithResponseAsync(resourceGroupName, workspaceName, requestBodyParameters, context).block(); + public ManagedGrafanaInner update( + String resourceGroupName, String workspaceName, ManagedGrafanaUpdateParameters requestBodyParameters) { + return updateWithResponse(resourceGroupName, workspaceName, requestBodyParameters, Context.NONE).getValue(); } /** @@ -1211,7 +1239,7 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { - return beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); } /** @@ -1228,7 +1256,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String workspaceName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); } /** @@ -1293,6 +1321,294 @@ public void delete(String resourceGroupName, String workspaceName, Context conte deleteAsync(resourceGroupName, workspaceName, context).block(); } + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEnterpriseDetailsWithResponseAsync( + String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkEnterpriseDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkEnterpriseDetailsWithResponseAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkEnterpriseDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkEnterpriseDetailsAsync(String resourceGroupName, String workspaceName) { + return checkEnterpriseDetailsWithResponseAsync(resourceGroupName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkEnterpriseDetailsWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return checkEnterpriseDetailsWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EnterpriseDetailsInner checkEnterpriseDetails(String resourceGroupName, String workspaceName) { + return checkEnterpriseDetailsWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + } + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> fetchAvailablePluginsWithResponseAsync( + String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .fetchAvailablePlugins( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> fetchAvailablePluginsWithResponseAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .fetchAvailablePlugins( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono fetchAvailablePluginsAsync( + String resourceGroupName, String workspaceName) { + return fetchAvailablePluginsWithResponseAsync(resourceGroupName, workspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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) + public Response fetchAvailablePluginsWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return fetchAvailablePluginsWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GrafanaAvailablePluginListResponseInner fetchAvailablePlugins( + String resourceGroupName, String workspaceName) { + return fetchAvailablePluginsWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + } + /** * Get the next page of items. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanasImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanasImpl.java index c6a4cba504e9..c2a1bdb24c1e 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanasImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/GrafanasImpl.java @@ -10,7 +10,11 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.dashboard.fluent.GrafanasClient; +import com.azure.resourcemanager.dashboard.fluent.models.EnterpriseDetailsInner; +import com.azure.resourcemanager.dashboard.fluent.models.GrafanaAvailablePluginListResponseInner; import com.azure.resourcemanager.dashboard.fluent.models.ManagedGrafanaInner; +import com.azure.resourcemanager.dashboard.models.EnterpriseDetails; +import com.azure.resourcemanager.dashboard.models.GrafanaAvailablePluginListResponse; import com.azure.resourcemanager.dashboard.models.Grafanas; import com.azure.resourcemanager.dashboard.models.ManagedGrafana; @@ -47,6 +51,21 @@ public PagedIterable listByResourceGroup(String resourceGroupNam return Utils.mapPage(inner, inner1 -> new ManagedGrafanaImpl(inner1, this.manager())); } + public Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedGrafanaImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public ManagedGrafana getByResourceGroup(String resourceGroupName, String workspaceName) { ManagedGrafanaInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, workspaceName); if (inner != null) { @@ -56,27 +75,61 @@ public ManagedGrafana getByResourceGroup(String resourceGroupName, String worksp } } - public Response getByResourceGroupWithResponse( + public void deleteByResourceGroup(String resourceGroupName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, workspaceName); + } + + public void delete(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, context); + } + + public Response checkEnterpriseDetailsWithResponse( String resourceGroupName, String workspaceName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); + Response inner = + this.serviceClient().checkEnterpriseDetailsWithResponse(resourceGroupName, workspaceName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ManagedGrafanaImpl(inner.getValue(), this.manager())); + new EnterpriseDetailsImpl(inner.getValue(), this.manager())); } else { return null; } } - public void deleteByResourceGroup(String resourceGroupName, String workspaceName) { - this.serviceClient().delete(resourceGroupName, workspaceName); + public EnterpriseDetails checkEnterpriseDetails(String resourceGroupName, String workspaceName) { + EnterpriseDetailsInner inner = this.serviceClient().checkEnterpriseDetails(resourceGroupName, workspaceName); + if (inner != null) { + return new EnterpriseDetailsImpl(inner, this.manager()); + } else { + return null; + } } - public void delete(String resourceGroupName, String workspaceName, Context context) { - this.serviceClient().delete(resourceGroupName, workspaceName, context); + public Response fetchAvailablePluginsWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().fetchAvailablePluginsWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GrafanaAvailablePluginListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GrafanaAvailablePluginListResponse fetchAvailablePlugins(String resourceGroupName, String workspaceName) { + GrafanaAvailablePluginListResponseInner inner = + this.serviceClient().fetchAvailablePlugins(resourceGroupName, workspaceName); + if (inner != null) { + return new GrafanaAvailablePluginListResponseImpl(inner, this.manager()); + } else { + return null; + } } public ManagedGrafana getById(String id) { diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedGrafanaImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedGrafanaImpl.java index daae52aa3935..4e77b3624871 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedGrafanaImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedGrafanaImpl.java @@ -4,10 +4,13 @@ package com.azure.resourcemanager.dashboard.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.dashboard.fluent.models.ManagedGrafanaInner; +import com.azure.resourcemanager.dashboard.models.EnterpriseDetails; +import com.azure.resourcemanager.dashboard.models.GrafanaAvailablePluginListResponse; import com.azure.resourcemanager.dashboard.models.ManagedGrafana; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaProperties; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaPropertiesUpdateParameters; @@ -171,6 +174,22 @@ public ManagedGrafana refresh(Context context) { return this; } + public Response checkEnterpriseDetailsWithResponse(Context context) { + return serviceManager.grafanas().checkEnterpriseDetailsWithResponse(resourceGroupName, workspaceName, context); + } + + public EnterpriseDetails checkEnterpriseDetails() { + return serviceManager.grafanas().checkEnterpriseDetails(resourceGroupName, workspaceName); + } + + public Response fetchAvailablePluginsWithResponse(Context context) { + return serviceManager.grafanas().fetchAvailablePluginsWithResponse(resourceGroupName, workspaceName, context); + } + + public GrafanaAvailablePluginListResponse fetchAvailablePlugins() { + return serviceManager.grafanas().fetchAvailablePlugins(resourceGroupName, workspaceName); + } + public ManagedGrafanaImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -192,8 +211,13 @@ public ManagedGrafanaImpl withTags(Map tags) { } public ManagedGrafanaImpl withSku(ResourceSku sku) { - this.innerModel().withSku(sku); - return this; + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateRequestBodyParameters.withSku(sku); + return this; + } } public ManagedGrafanaImpl withProperties(ManagedGrafanaProperties properties) { diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointModelImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointModelImpl.java new file mode 100644 index 000000000000..75f78fb89d3f --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointModelImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dashboard.fluent.models.ManagedPrivateEndpointModelInner; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointConnectionState; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointModel; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointUpdateParameters; +import com.azure.resourcemanager.dashboard.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ManagedPrivateEndpointModelImpl + implements ManagedPrivateEndpointModel, ManagedPrivateEndpointModel.Definition, ManagedPrivateEndpointModel.Update { + private ManagedPrivateEndpointModelInner innerObject; + + private final com.azure.resourcemanager.dashboard.DashboardManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String privateLinkResourceId() { + return this.innerModel().privateLinkResourceId(); + } + + public String privateLinkResourceRegion() { + return this.innerModel().privateLinkResourceRegion(); + } + + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String requestMessage() { + return this.innerModel().requestMessage(); + } + + public ManagedPrivateEndpointConnectionState connectionState() { + return this.innerModel().connectionState(); + } + + public String privateLinkServiceUrl() { + return this.innerModel().privateLinkServiceUrl(); + } + + public String privateLinkServicePrivateIp() { + return this.innerModel().privateLinkServicePrivateIp(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ManagedPrivateEndpointModelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.dashboard.DashboardManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String managedPrivateEndpointName; + + private ManagedPrivateEndpointUpdateParameters updateRequestBodyParameters; + + public ManagedPrivateEndpointModelImpl withExistingGrafana(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public ManagedPrivateEndpointModel create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .create(resourceGroupName, workspaceName, managedPrivateEndpointName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedPrivateEndpointModel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .create(resourceGroupName, workspaceName, managedPrivateEndpointName, this.innerModel(), context); + return this; + } + + ManagedPrivateEndpointModelImpl(String name, com.azure.resourcemanager.dashboard.DashboardManager serviceManager) { + this.innerObject = new ManagedPrivateEndpointModelInner(); + this.serviceManager = serviceManager; + this.managedPrivateEndpointName = name; + } + + public ManagedPrivateEndpointModelImpl update() { + this.updateRequestBodyParameters = new ManagedPrivateEndpointUpdateParameters(); + return this; + } + + public ManagedPrivateEndpointModel apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .update( + resourceGroupName, + workspaceName, + managedPrivateEndpointName, + updateRequestBodyParameters, + Context.NONE); + return this; + } + + public ManagedPrivateEndpointModel apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .update( + resourceGroupName, workspaceName, managedPrivateEndpointName, updateRequestBodyParameters, context); + return this; + } + + ManagedPrivateEndpointModelImpl( + ManagedPrivateEndpointModelInner innerObject, + com.azure.resourcemanager.dashboard.DashboardManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "grafana"); + this.managedPrivateEndpointName = Utils.getValueFromIdByName(innerObject.id(), "managedPrivateEndpoints"); + } + + public ManagedPrivateEndpointModel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .getWithResponse(resourceGroupName, workspaceName, managedPrivateEndpointName, Context.NONE) + .getValue(); + return this; + } + + public ManagedPrivateEndpointModel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .getWithResponse(resourceGroupName, workspaceName, managedPrivateEndpointName, context) + .getValue(); + return this; + } + + public ManagedPrivateEndpointModelImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedPrivateEndpointModelImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedPrivateEndpointModelImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateRequestBodyParameters.withTags(tags); + return this; + } + } + + public ManagedPrivateEndpointModelImpl withPrivateLinkResourceId(String privateLinkResourceId) { + this.innerModel().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + public ManagedPrivateEndpointModelImpl withPrivateLinkResourceRegion(String privateLinkResourceRegion) { + this.innerModel().withPrivateLinkResourceRegion(privateLinkResourceRegion); + return this; + } + + public ManagedPrivateEndpointModelImpl withGroupIds(List groupIds) { + this.innerModel().withGroupIds(groupIds); + return this; + } + + public ManagedPrivateEndpointModelImpl withRequestMessage(String requestMessage) { + this.innerModel().withRequestMessage(requestMessage); + return this; + } + + public ManagedPrivateEndpointModelImpl withPrivateLinkServiceUrl(String privateLinkServiceUrl) { + this.innerModel().withPrivateLinkServiceUrl(privateLinkServiceUrl); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointsClientImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointsClientImpl.java new file mode 100644 index 000000000000..de676990b6e4 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointsClientImpl.java @@ -0,0 +1,1772 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.dashboard.fluent.ManagedPrivateEndpointsClient; +import com.azure.resourcemanager.dashboard.fluent.models.ManagedPrivateEndpointModelInner; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointModelListResponse; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointUpdateParameters; +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 ManagedPrivateEndpointsClient. */ +public final class ManagedPrivateEndpointsClientImpl implements ManagedPrivateEndpointsClient { + /** The proxy service used to perform REST calls. */ + private final ManagedPrivateEndpointsService service; + + /** The service client containing this operation class. */ + private final DashboardManagementClientImpl client; + + /** + * Initializes an instance of ManagedPrivateEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedPrivateEndpointsClientImpl(DashboardManagementClientImpl client) { + this.service = + RestProxy + .create(ManagedPrivateEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DashboardManagementClientManagedPrivateEndpoints to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "DashboardManagementC") + public interface ManagedPrivateEndpointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/refreshManagedPrivateEndpoints") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refresh( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedPrivateEndpointModelInner requestBodyParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedPrivateEndpointUpdateParameters requestBodyParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of managed private endpoints of a grafana resource along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + 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 managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of managed private endpoints of a grafana resource along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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, + workspaceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of managed private endpoints of a grafana resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of managed private endpoints of a grafana resource as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of managed private endpoints of a grafana resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of managed private endpoints of a grafana resource as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> refreshWithResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .refresh( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> refreshWithResponseAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .refresh( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = refreshWithResponseAsync(resourceGroupName, workspaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefreshAsync( + String resourceGroupName, String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = refreshWithResponseAsync(resourceGroupName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefresh(String resourceGroupName, String workspaceName) { + return this.beginRefreshAsync(resourceGroupName, workspaceName).getSyncPoller(); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRefresh( + String resourceGroupName, String workspaceName, Context context) { + return this.beginRefreshAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 refreshAsync(String resourceGroupName, String workspaceName) { + return beginRefreshAsync(resourceGroupName, workspaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 refreshAsync(String resourceGroupName, String workspaceName, Context context) { + return beginRefreshAsync(resourceGroupName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refresh(String resourceGroupName, String workspaceName) { + refreshAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 refresh(String resourceGroupName, String workspaceName, Context context) { + refreshAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific managed private endpoint of a grafana resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + managedPrivateEndpointName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific managed private endpoint of a grafana resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName 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, + workspaceName, + managedPrivateEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific managed private endpoint of a grafana resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName) { + return getWithResponseAsync(resourceGroupName, workspaceName, managedPrivateEndpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific managed private endpoint of a grafana resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, context).block(); + } + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 specific managed private endpoint of a grafana resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointModelInner get( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName) { + return getWithResponse(resourceGroupName, workspaceName, managedPrivateEndpointName, Context.NONE).getValue(); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + if (requestBodyParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter requestBodyParameters is required and cannot be null.")); + } else { + requestBodyParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + managedPrivateEndpointName, + this.client.getApiVersion(), + requestBodyParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters, + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + if (requestBodyParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter requestBodyParameters is required and cannot be null.")); + } else { + requestBodyParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + managedPrivateEndpointName, + this.client.getApiVersion(), + requestBodyParameters, + accept, + context); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedPrivateEndpointModelInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedPrivateEndpointModelInner.class, + ManagedPrivateEndpointModelInner.class, + this.client.getContext()); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedPrivateEndpointModelInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedPrivateEndpointModelInner.class, + ManagedPrivateEndpointModelInner.class, + context); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedPrivateEndpointModelInner> beginCreate( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters) { + return this + .beginCreateAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters) + .getSyncPoller(); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedPrivateEndpointModelInner> beginCreate( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters, + Context context) { + return this + .beginCreateAsync( + resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters, context) + .getSyncPoller(); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters) { + return beginCreateAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointModelInner create( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters) { + return createAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters).block(); + } + + /** + * Create or update a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters The managed private endpoint to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointModelInner create( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointModelInner requestBodyParameters, + Context context) { + return createAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters, context) + .block(); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + if (requestBodyParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter requestBodyParameters is required and cannot be null.")); + } else { + requestBodyParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + managedPrivateEndpointName, + this.client.getApiVersion(), + requestBodyParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters, + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + if (requestBodyParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter requestBodyParameters is required and cannot be null.")); + } else { + requestBodyParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + managedPrivateEndpointName, + this.client.getApiVersion(), + requestBodyParameters, + accept, + context); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedPrivateEndpointModelInner> beginUpdateAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedPrivateEndpointModelInner.class, + ManagedPrivateEndpointModelInner.class, + this.client.getContext()); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedPrivateEndpointModelInner> beginUpdateAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedPrivateEndpointModelInner.class, + ManagedPrivateEndpointModelInner.class, + context); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedPrivateEndpointModelInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters) { + return this + .beginUpdateAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters) + .getSyncPoller(); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedPrivateEndpointModelInner> beginUpdate( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters, context) + .getSyncPoller(); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters) { + return beginUpdateAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointModelInner update( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters) { + return updateAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters).block(); + } + + /** + * Update a managed private endpoint for an existing grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param requestBodyParameters Properties that can be updated to an existing managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the managed private endpoint resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointModelInner update( + String resourceGroupName, + String workspaceName, + String managedPrivateEndpointName, + ManagedPrivateEndpointUpdateParameters requestBodyParameters, + Context context) { + return updateAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, requestBodyParameters, context) + .block(); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String managedPrivateEndpointName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + managedPrivateEndpointName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String managedPrivateEndpointName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName 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, + workspaceName, + managedPrivateEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String managedPrivateEndpointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, managedPrivateEndpointName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String managedPrivateEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String managedPrivateEndpointName) { + return this.beginDeleteAsync(resourceGroupName, workspaceName, managedPrivateEndpointName).getSyncPoller(); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 workspaceName, String managedPrivateEndpointName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, context) + .getSyncPoller(); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspaceName, String managedPrivateEndpointName) { + return beginDeleteAsync(resourceGroupName, workspaceName, managedPrivateEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 workspaceName, String managedPrivateEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 workspaceName, String managedPrivateEndpointName) { + deleteAsync(resourceGroupName, workspaceName, managedPrivateEndpointName).block(); + } + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 workspaceName, String managedPrivateEndpointName, Context context) { + deleteAsync(resourceGroupName, workspaceName, managedPrivateEndpointName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of managed private endpoints of a grafana 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(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of managed private endpoints of a grafana resource along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointsImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointsImpl.java new file mode 100644 index 000000000000..3524c3a49253 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/ManagedPrivateEndpointsImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.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.dashboard.fluent.ManagedPrivateEndpointsClient; +import com.azure.resourcemanager.dashboard.fluent.models.ManagedPrivateEndpointModelInner; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointModel; +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpoints; + +public final class ManagedPrivateEndpointsImpl implements ManagedPrivateEndpoints { + private static final ClientLogger LOGGER = new ClientLogger(ManagedPrivateEndpointsImpl.class); + + private final ManagedPrivateEndpointsClient innerClient; + + private final com.azure.resourcemanager.dashboard.DashboardManager serviceManager; + + public ManagedPrivateEndpointsImpl( + ManagedPrivateEndpointsClient innerClient, + com.azure.resourcemanager.dashboard.DashboardManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new ManagedPrivateEndpointModelImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new ManagedPrivateEndpointModelImpl(inner1, this.manager())); + } + + public void refresh(String resourceGroupName, String workspaceName) { + this.serviceClient().refresh(resourceGroupName, workspaceName); + } + + public void refresh(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().refresh(resourceGroupName, workspaceName, context); + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, managedPrivateEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedPrivateEndpointModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedPrivateEndpointModel get( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName) { + ManagedPrivateEndpointModelInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, managedPrivateEndpointName); + if (inner != null) { + return new ManagedPrivateEndpointModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String managedPrivateEndpointName) { + this.serviceClient().delete(resourceGroupName, workspaceName, managedPrivateEndpointName); + } + + public void delete( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, managedPrivateEndpointName, context); + } + + public ManagedPrivateEndpointModel getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "grafana"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'grafana'.", id))); + } + String managedPrivateEndpointName = Utils.getValueFromIdByName(id, "managedPrivateEndpoints"); + if (managedPrivateEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", + id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, managedPrivateEndpointName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "grafana"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'grafana'.", id))); + } + String managedPrivateEndpointName = Utils.getValueFromIdByName(id, "managedPrivateEndpoints"); + if (managedPrivateEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", + id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, managedPrivateEndpointName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "grafana"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'grafana'.", id))); + } + String managedPrivateEndpointName = Utils.getValueFromIdByName(id, "managedPrivateEndpoints"); + if (managedPrivateEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", + id))); + } + this.delete(resourceGroupName, workspaceName, managedPrivateEndpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "grafana"); + if (workspaceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'grafana'.", id))); + } + String managedPrivateEndpointName = Utils.getValueFromIdByName(id, "managedPrivateEndpoints"); + if (managedPrivateEndpointName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", + id))); + } + this.delete(resourceGroupName, workspaceName, managedPrivateEndpointName, context); + } + + private ManagedPrivateEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.dashboard.DashboardManager manager() { + return this.serviceManager; + } + + public ManagedPrivateEndpointModelImpl define(String name) { + return new ManagedPrivateEndpointModelImpl(name, this.manager()); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/OperationsClientImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/OperationsClientImpl.java index 84715c67e26f..095dc8cc68a6 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/OperationsClientImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/OperationsClientImpl.java @@ -55,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "DashboardManagementC") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.Dashboard/operations") @ExpectedResponses({200}) diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateEndpointConnectionsClientImpl.java index c33bdfd48d52..c8192f15aa84 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateEndpointConnectionsClientImpl.java @@ -65,11 +65,10 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi */ @Host("{$host}") @ServiceInterface(name = "DashboardManagementC") - private interface PrivateEndpointConnectionsService { + public interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -84,8 +83,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> approve( @@ -101,8 +99,7 @@ Mono>> approve( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -117,8 +114,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}/privateEndpointConnections") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateEndpointConnections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -275,15 +271,16 @@ private Mono getAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connections. + * @return private endpoint connections along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).block(); + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); } /** @@ -292,16 +289,16 @@ public PrivateEndpointConnectionInner get( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connections along with {@link Response}. + * @return private endpoint connections. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); + public PrivateEndpointConnectionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); } /** @@ -463,6 +460,33 @@ private PollerFlux, PrivateEndpointCo this.client.getContext()); } + /** + * Manual approve private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginApproveAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + final PrivateEndpointConnectionInner body = null; + Mono>> mono = + approveWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + /** * Manual approve private endpoint connection. * @@ -502,7 +526,6 @@ private PollerFlux, PrivateEndpointCo * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. - * @param body The Private Endpoint Connection 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. @@ -510,11 +533,11 @@ private PollerFlux, PrivateEndpointCo */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginApprove( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner body) { - return beginApproveAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, body).getSyncPoller(); + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + final PrivateEndpointConnectionInner body = null; + return this + .beginApproveAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, body) + .getSyncPoller(); } /** @@ -537,7 +560,8 @@ public SyncPoller, PrivateEndpointCon String privateEndpointConnectionName, PrivateEndpointConnectionInner body, Context context) { - return beginApproveAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, body, context) + return this + .beginApproveAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, body, context) .getSyncPoller(); } @@ -609,27 +633,6 @@ private Mono approveAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Manual approve private endpoint connection. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The workspace name of Azure Managed Grafana. - * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. - * @param body The Private Endpoint Connection 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 Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner approve( - String resourceGroupName, - String workspaceName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner body) { - return approveAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, body).block(); - } - /** * Manual approve private endpoint connection. * @@ -840,7 +843,7 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).getSyncPoller(); } /** @@ -858,7 +861,8 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + return this + .beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) .getSyncPoller(); } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateEndpointConnectionsImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateEndpointConnectionsImpl.java index 50228131b8ae..d2c9cffd3cdc 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateEndpointConnectionsImpl.java @@ -28,17 +28,6 @@ public PrivateEndpointConnectionsImpl( this.serviceManager = serviceManager; } - public PrivateEndpointConnection get( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, privateEndpointConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { Response inner = @@ -56,6 +45,17 @@ public Response getWithResponse( } } + public PrivateEndpointConnection get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + public void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName); } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateLinkResourcesClientImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateLinkResourcesClientImpl.java index 1c6415a013b9..82c8a51b75db 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateLinkResourcesClientImpl.java @@ -56,11 +56,10 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource */ @Host("{$host}") @ServiceInterface(name = "DashboardManagementC") - private interface PrivateLinkResourcesService { + public interface PrivateLinkResourcesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}/privateLinkResources") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -74,8 +73,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana" - + "/{workspaceName}/privateLinkResources/{privateLinkResourceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/privateLinkResources/{privateLinkResourceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -415,15 +413,16 @@ private Mono getAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateLinkResourceName The privateLinkResourceName 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 specific private link resource information for this grafana resource. + * @return specific private link resource information for this grafana resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner get( - String resourceGroupName, String workspaceName, String privateLinkResourceName) { - return getAsync(resourceGroupName, workspaceName, privateLinkResourceName).block(); + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateLinkResourceName, context).block(); } /** @@ -432,16 +431,15 @@ public PrivateLinkResourceInner get( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateLinkResourceName The privateLinkResourceName 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 specific private link resource information for this grafana resource along with {@link Response}. + * @return specific private link resource information for this grafana resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, privateLinkResourceName, context).block(); + public PrivateLinkResourceInner get( + String resourceGroupName, String workspaceName, String privateLinkResourceName) { + return getWithResponse(resourceGroupName, workspaceName, privateLinkResourceName, Context.NONE).getValue(); } /** diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateLinkResourcesImpl.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateLinkResourcesImpl.java index b2d8aeaf854c..23f5967b0c7d 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/PrivateLinkResourcesImpl.java @@ -38,16 +38,6 @@ public PagedIterable list(String resourceGroupName, String return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } - public PrivateLinkResource get(String resourceGroupName, String workspaceName, String privateLinkResourceName) { - PrivateLinkResourceInner inner = - this.serviceClient().get(resourceGroupName, workspaceName, privateLinkResourceName); - if (inner != null) { - return new PrivateLinkResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse( String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context) { Response inner = @@ -63,6 +53,16 @@ public Response getWithResponse( } } + public PrivateLinkResource get(String resourceGroupName, String workspaceName, String privateLinkResourceName) { + PrivateLinkResourceInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + private PrivateLinkResourcesClient serviceClient() { return this.innerClient; } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/Utils.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/Utils.java index a1247617ced4..d534468bd849 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/Utils.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/implementation/Utils.java @@ -20,6 +20,9 @@ import reactor.core.publisher.Flux; final class Utils { + private Utils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -133,30 +136,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +198,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ActionType.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ActionType.java index 27d34144b041..a717504a7c68 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ActionType.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ActionType.java @@ -13,6 +13,15 @@ public final class ActionType extends ExpandableStringEnum { /** Static value Internal for ActionType. */ public static final ActionType INTERNAL = fromString("Internal"); + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + /** * Creates or finds a ActionType from its string representation. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ApiKey.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ApiKey.java index 73a3d6824bb4..e038c6ed3eba 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ApiKey.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ApiKey.java @@ -16,6 +16,15 @@ public final class ApiKey extends ExpandableStringEnum { /** Static value Enabled for ApiKey. */ public static final ApiKey ENABLED = fromString("Enabled"); + /** + * Creates a new instance of ApiKey value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApiKey() { + } + /** * Creates or finds a ApiKey from its string representation. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AutoGeneratedDomainNameLabelScope.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AutoGeneratedDomainNameLabelScope.java index 0e4d1c1077c9..3c8d9970a434 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AutoGeneratedDomainNameLabelScope.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AutoGeneratedDomainNameLabelScope.java @@ -13,6 +13,15 @@ public final class AutoGeneratedDomainNameLabelScope extends ExpandableStringEnu /** Static value TenantReuse for AutoGeneratedDomainNameLabelScope. */ public static final AutoGeneratedDomainNameLabelScope TENANT_REUSE = fromString("TenantReuse"); + /** + * Creates a new instance of AutoGeneratedDomainNameLabelScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoGeneratedDomainNameLabelScope() { + } + /** * Creates or finds a AutoGeneratedDomainNameLabelScope from its string representation. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AvailablePromotion.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AvailablePromotion.java new file mode 100644 index 000000000000..ac8d51eabb27 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AvailablePromotion.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AvailablePromotion. */ +public final class AvailablePromotion extends ExpandableStringEnum { + /** Static value None for AvailablePromotion. */ + public static final AvailablePromotion NONE = fromString("None"); + + /** Static value FreeTrial for AvailablePromotion. */ + public static final AvailablePromotion FREE_TRIAL = fromString("FreeTrial"); + + /** + * Creates a new instance of AvailablePromotion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AvailablePromotion() { + } + + /** + * Creates or finds a AvailablePromotion from its string representation. + * + * @param name a name to look for. + * @return the corresponding AvailablePromotion. + */ + @JsonCreator + public static AvailablePromotion fromString(String name) { + return fromString(name, AvailablePromotion.class); + } + + /** + * Gets known AvailablePromotion values. + * + * @return known AvailablePromotion values. + */ + public static Collection values() { + return values(AvailablePromotion.class); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AzureMonitorWorkspaceIntegration.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AzureMonitorWorkspaceIntegration.java index 3e2c3f87c585..bc9c886d551c 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AzureMonitorWorkspaceIntegration.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/AzureMonitorWorkspaceIntegration.java @@ -16,6 +16,10 @@ public final class AzureMonitorWorkspaceIntegration { @JsonProperty(value = "azureMonitorWorkspaceResourceId") private String azureMonitorWorkspaceResourceId; + /** Creates an instance of AzureMonitorWorkspaceIntegration class. */ + public AzureMonitorWorkspaceIntegration() { + } + /** * Get the azureMonitorWorkspaceResourceId property: The resource Id of the connected Azure Monitor Workspace. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/DeterministicOutboundIp.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/DeterministicOutboundIp.java index a59266be3f57..c67041d9cd32 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/DeterministicOutboundIp.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/DeterministicOutboundIp.java @@ -16,6 +16,15 @@ public final class DeterministicOutboundIp extends ExpandableStringEnum value(); + + /** + * Gets the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.dashboard.fluent.models.GrafanaAvailablePluginListResponseInner object. + * + * @return the inner object. + */ + GrafanaAvailablePluginListResponseInner innerModel(); +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaConfigurations.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaConfigurations.java new file mode 100644 index 000000000000..69a9a7249bf4 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaConfigurations.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Server configurations of a Grafana instance. */ +@Fluent +public final class GrafanaConfigurations { + /* + * Email server settings. + * https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp + */ + @JsonProperty(value = "smtp") + private Smtp smtp; + + /** Creates an instance of GrafanaConfigurations class. */ + public GrafanaConfigurations() { + } + + /** + * Get the smtp property: Email server settings. + * https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp. + * + * @return the smtp value. + */ + public Smtp smtp() { + return this.smtp; + } + + /** + * Set the smtp property: Email server settings. + * https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp. + * + * @param smtp the smtp value to set. + * @return the GrafanaConfigurations object itself. + */ + public GrafanaConfigurations withSmtp(Smtp smtp) { + this.smtp = smtp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (smtp() != null) { + smtp().validate(); + } + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaIntegrations.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaIntegrations.java index 846cb1b8f30f..c6741ce268a9 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaIntegrations.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaIntegrations.java @@ -20,6 +20,10 @@ public final class GrafanaIntegrations { @JsonProperty(value = "azureMonitorWorkspaceIntegrations") private List azureMonitorWorkspaceIntegrations; + /** Creates an instance of GrafanaIntegrations class. */ + public GrafanaIntegrations() { + } + /** * Get the azureMonitorWorkspaceIntegrations property: The azureMonitorWorkspaceIntegrations property. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaPlugin.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaPlugin.java new file mode 100644 index 000000000000..dfcb80f34b3a --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanaPlugin.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Plugin of Grafana. */ +@Immutable +public final class GrafanaPlugin { + /* + * Grafana plugin id + */ + @JsonProperty(value = "pluginId", access = JsonProperty.Access.WRITE_ONLY) + private String pluginId; + + /** Creates an instance of GrafanaPlugin class. */ + public GrafanaPlugin() { + } + + /** + * Get the pluginId property: Grafana plugin id. + * + * @return the pluginId value. + */ + public String pluginId() { + return this.pluginId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/Grafanas.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/Grafanas.java index f445725274e9..1ad4210442e6 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/Grafanas.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/Grafanas.java @@ -58,26 +58,26 @@ public interface Grafanas { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specific workspace for Grafana resource. + * @return the properties of a specific workspace for Grafana resource along with {@link Response}. */ - ManagedGrafana getByResourceGroup(String resourceGroupName, String workspaceName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context); /** * Get the properties of a specific workspace for Grafana resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of a specific workspace for Grafana resource along with {@link Response}. + * @return the properties of a specific workspace for Grafana resource. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String workspaceName, Context context); + ManagedGrafana getByResourceGroup(String resourceGroupName, String workspaceName); /** * Delete a workspace for Grafana resource. @@ -102,6 +102,58 @@ Response getByResourceGroupWithResponse( */ void delete(String resourceGroupName, String workspaceName, Context context); + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance along with {@link Response}. + */ + Response checkEnterpriseDetailsWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Retrieve enterprise add-on details information. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance. + */ + EnterpriseDetails checkEnterpriseDetails(String resourceGroupName, String workspaceName); + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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}. + */ + Response fetchAvailablePluginsWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * The fetchAvailablePlugins operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + GrafanaAvailablePluginListResponse fetchAvailablePlugins(String resourceGroupName, String workspaceName); + /** * Get the properties of a specific workspace for Grafana resource. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanasUpdateHeaders.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanasUpdateHeaders.java new file mode 100644 index 000000000000..2f6afb645f97 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanasUpdateHeaders.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The GrafanasUpdateHeaders model. */ +@Fluent +public final class GrafanasUpdateHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation"); + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of GrafanasUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public GrafanasUpdateHeaders(HttpHeaders rawHeaders) { + this.azureAsyncOperation = rawHeaders.getValue(AZURE_ASYNC_OPERATION); + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the GrafanasUpdateHeaders object itself. + */ + public GrafanasUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanasUpdateResponse.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanasUpdateResponse.java new file mode 100644 index 000000000000..5383d3063c52 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/GrafanasUpdateResponse.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.dashboard.fluent.models.ManagedGrafanaInner; + +/** Contains all response data for the update operation. */ +public final class GrafanasUpdateResponse extends ResponseBase { + /** + * Creates an instance of GrafanasUpdateResponse. + * + * @param request the request which resulted in this GrafanasUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public GrafanasUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ManagedGrafanaInner value, + GrafanasUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public ManagedGrafanaInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafana.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafana.java index 0b9b593e8418..789933521222 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafana.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafana.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.dashboard.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; @@ -110,11 +111,13 @@ interface Definition DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } + /** The ManagedGrafana definition stages. */ interface DefinitionStages { /** The first stage of the ManagedGrafana definition. */ interface Blank extends WithLocation { } + /** The stage of the ManagedGrafana definition allowing to specify location. */ interface WithLocation { /** @@ -133,6 +136,7 @@ interface WithLocation { */ WithResourceGroup withRegion(String location); } + /** The stage of the ManagedGrafana definition allowing to specify parent resource. */ interface WithResourceGroup { /** @@ -143,6 +147,7 @@ interface WithResourceGroup { */ WithCreate withExistingResourceGroup(String resourceGroupName); } + /** * The stage of the ManagedGrafana 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. @@ -167,6 +172,7 @@ interface WithCreate */ ManagedGrafana create(Context context); } + /** The stage of the ManagedGrafana definition allowing to specify tags. */ interface WithTags { /** @@ -177,6 +183,7 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the ManagedGrafana definition allowing to specify sku. */ interface WithSku { /** @@ -187,6 +194,7 @@ interface WithSku { */ WithCreate withSku(ResourceSku sku); } + /** The stage of the ManagedGrafana definition allowing to specify properties. */ interface WithProperties { /** @@ -197,6 +205,7 @@ interface WithProperties { */ WithCreate withProperties(ManagedGrafanaProperties properties); } + /** The stage of the ManagedGrafana definition allowing to specify identity. */ interface WithIdentity { /** @@ -208,6 +217,7 @@ interface WithIdentity { WithCreate withIdentity(ManagedServiceIdentity identity); } } + /** * Begins update for the ManagedGrafana resource. * @@ -216,7 +226,8 @@ interface WithIdentity { ManagedGrafana.Update update(); /** The template for ManagedGrafana update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + interface Update + extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithIdentity, UpdateStages.WithProperties { /** * Executes the update request. * @@ -232,6 +243,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, Updat */ ManagedGrafana apply(Context context); } + /** The ManagedGrafana update stages. */ interface UpdateStages { /** The stage of the ManagedGrafana update allowing to specify tags. */ @@ -244,6 +256,18 @@ interface WithTags { */ Update withTags(Map tags); } + + /** The stage of the ManagedGrafana update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku property.. + * + * @param sku The sku property. + * @return the next definition stage. + */ + Update withSku(ResourceSku sku); + } + /** The stage of the ManagedGrafana update allowing to specify identity. */ interface WithIdentity { /** @@ -254,6 +278,7 @@ interface WithIdentity { */ Update withIdentity(ManagedServiceIdentity identity); } + /** The stage of the ManagedGrafana update allowing to specify properties. */ interface WithProperties { /** @@ -265,6 +290,7 @@ interface WithProperties { Update withProperties(ManagedGrafanaPropertiesUpdateParameters properties); } } + /** * Refreshes the resource to sync with Azure. * @@ -279,4 +305,44 @@ interface WithProperties { * @return the refreshed resource. */ ManagedGrafana refresh(Context context); + + /** + * Retrieve enterprise add-on details information. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance along with {@link Response}. + */ + Response checkEnterpriseDetailsWithResponse(Context context); + + /** + * Retrieve enterprise add-on details information. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return enterprise details of a Grafana instance. + */ + EnterpriseDetails checkEnterpriseDetails(); + + /** + * The fetchAvailablePlugins 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 response body along with {@link Response}. + */ + Response fetchAvailablePluginsWithResponse(Context context); + + /** + * The fetchAvailablePlugins operation. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + GrafanaAvailablePluginListResponse fetchAvailablePlugins(); } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaListResponse.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaListResponse.java index 34d35ec39103..2a100a7e9459 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaListResponse.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaListResponse.java @@ -24,6 +24,10 @@ public final class ManagedGrafanaListResponse { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of ManagedGrafanaListResponse class. */ + public ManagedGrafanaListResponse() { + } + /** * Get the value property: The value property. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaProperties.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaProperties.java index 9f779ddd58e4..4058c3331b30 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaProperties.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaProperties.java @@ -6,8 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.dashboard.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +import java.util.Map; /** Properties specific to the grafana resource. */ @Fluent @@ -79,6 +81,35 @@ public final class ManagedGrafanaProperties { @JsonProperty(value = "grafanaIntegrations") private GrafanaIntegrations grafanaIntegrations; + /* + * Enterprise settings of a Grafana instance + */ + @JsonProperty(value = "enterpriseConfigurations") + private EnterpriseConfigurations enterpriseConfigurations; + + /* + * Server configurations of a Grafana instance + */ + @JsonProperty(value = "grafanaConfigurations") + private GrafanaConfigurations grafanaConfigurations; + + /* + * Installed plugin list of the Grafana instance. Key is plugin id, value is plugin definition. + */ + @JsonProperty(value = "grafanaPlugins") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map grafanaPlugins; + + /* + * The major Grafana software version to target. + */ + @JsonProperty(value = "grafanaMajorVersion") + private String grafanaMajorVersion; + + /** Creates an instance of ManagedGrafanaProperties class. */ + public ManagedGrafanaProperties() { + } + /** * Get the provisioningState property: Provisioning state of the resource. * @@ -247,6 +278,88 @@ public ManagedGrafanaProperties withGrafanaIntegrations(GrafanaIntegrations graf return this; } + /** + * Get the enterpriseConfigurations property: Enterprise settings of a Grafana instance. + * + * @return the enterpriseConfigurations value. + */ + public EnterpriseConfigurations enterpriseConfigurations() { + return this.enterpriseConfigurations; + } + + /** + * Set the enterpriseConfigurations property: Enterprise settings of a Grafana instance. + * + * @param enterpriseConfigurations the enterpriseConfigurations value to set. + * @return the ManagedGrafanaProperties object itself. + */ + public ManagedGrafanaProperties withEnterpriseConfigurations(EnterpriseConfigurations enterpriseConfigurations) { + this.enterpriseConfigurations = enterpriseConfigurations; + return this; + } + + /** + * Get the grafanaConfigurations property: Server configurations of a Grafana instance. + * + * @return the grafanaConfigurations value. + */ + public GrafanaConfigurations grafanaConfigurations() { + return this.grafanaConfigurations; + } + + /** + * Set the grafanaConfigurations property: Server configurations of a Grafana instance. + * + * @param grafanaConfigurations the grafanaConfigurations value to set. + * @return the ManagedGrafanaProperties object itself. + */ + public ManagedGrafanaProperties withGrafanaConfigurations(GrafanaConfigurations grafanaConfigurations) { + this.grafanaConfigurations = grafanaConfigurations; + return this; + } + + /** + * Get the grafanaPlugins property: Installed plugin list of the Grafana instance. Key is plugin id, value is plugin + * definition. + * + * @return the grafanaPlugins value. + */ + public Map grafanaPlugins() { + return this.grafanaPlugins; + } + + /** + * Set the grafanaPlugins property: Installed plugin list of the Grafana instance. Key is plugin id, value is plugin + * definition. + * + * @param grafanaPlugins the grafanaPlugins value to set. + * @return the ManagedGrafanaProperties object itself. + */ + public ManagedGrafanaProperties withGrafanaPlugins(Map grafanaPlugins) { + this.grafanaPlugins = grafanaPlugins; + return this; + } + + /** + * Get the grafanaMajorVersion property: The major Grafana software version to target. + * + * @return the grafanaMajorVersion value. + */ + public String grafanaMajorVersion() { + return this.grafanaMajorVersion; + } + + /** + * Set the grafanaMajorVersion property: The major Grafana software version to target. + * + * @param grafanaMajorVersion the grafanaMajorVersion value to set. + * @return the ManagedGrafanaProperties object itself. + */ + public ManagedGrafanaProperties withGrafanaMajorVersion(String grafanaMajorVersion) { + this.grafanaMajorVersion = grafanaMajorVersion; + return this; + } + /** * Validates the instance. * @@ -259,5 +372,21 @@ public void validate() { if (grafanaIntegrations() != null) { grafanaIntegrations().validate(); } + if (enterpriseConfigurations() != null) { + enterpriseConfigurations().validate(); + } + if (grafanaConfigurations() != null) { + grafanaConfigurations().validate(); + } + if (grafanaPlugins() != null) { + grafanaPlugins() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaPropertiesUpdateParameters.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaPropertiesUpdateParameters.java index 2445f02a0a89..f4930ab74588 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaPropertiesUpdateParameters.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaPropertiesUpdateParameters.java @@ -5,7 +5,9 @@ package com.azure.resourcemanager.dashboard.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** The properties parameters for a PATCH request to a grafana resource. */ @Fluent @@ -41,6 +43,36 @@ public final class ManagedGrafanaPropertiesUpdateParameters { @JsonProperty(value = "grafanaIntegrations") private GrafanaIntegrations grafanaIntegrations; + /* + * Enterprise settings of a Grafana instance + */ + @JsonProperty(value = "enterpriseConfigurations") + private EnterpriseConfigurations enterpriseConfigurations; + + /* + * Server configurations of a Grafana instance + */ + @JsonProperty(value = "grafanaConfigurations") + private GrafanaConfigurations grafanaConfigurations; + + /* + * Update of Grafana plugin. Key is plugin id, value is plugin definition. If plugin definition is null, plugin + * with given plugin id will be removed. Otherwise, given plugin will be installed. + */ + @JsonProperty(value = "grafanaPlugins") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map grafanaPlugins; + + /* + * The major Grafana software version to target. + */ + @JsonProperty(value = "grafanaMajorVersion") + private String grafanaMajorVersion; + + /** Creates an instance of ManagedGrafanaPropertiesUpdateParameters class. */ + public ManagedGrafanaPropertiesUpdateParameters() { + } + /** * Get the zoneRedundancy property: The zone redundancy setting of the Grafana instance. * @@ -144,6 +176,92 @@ public ManagedGrafanaPropertiesUpdateParameters withGrafanaIntegrations(GrafanaI return this; } + /** + * Get the enterpriseConfigurations property: Enterprise settings of a Grafana instance. + * + * @return the enterpriseConfigurations value. + */ + public EnterpriseConfigurations enterpriseConfigurations() { + return this.enterpriseConfigurations; + } + + /** + * Set the enterpriseConfigurations property: Enterprise settings of a Grafana instance. + * + * @param enterpriseConfigurations the enterpriseConfigurations value to set. + * @return the ManagedGrafanaPropertiesUpdateParameters object itself. + */ + public ManagedGrafanaPropertiesUpdateParameters withEnterpriseConfigurations( + EnterpriseConfigurations enterpriseConfigurations) { + this.enterpriseConfigurations = enterpriseConfigurations; + return this; + } + + /** + * Get the grafanaConfigurations property: Server configurations of a Grafana instance. + * + * @return the grafanaConfigurations value. + */ + public GrafanaConfigurations grafanaConfigurations() { + return this.grafanaConfigurations; + } + + /** + * Set the grafanaConfigurations property: Server configurations of a Grafana instance. + * + * @param grafanaConfigurations the grafanaConfigurations value to set. + * @return the ManagedGrafanaPropertiesUpdateParameters object itself. + */ + public ManagedGrafanaPropertiesUpdateParameters withGrafanaConfigurations( + GrafanaConfigurations grafanaConfigurations) { + this.grafanaConfigurations = grafanaConfigurations; + return this; + } + + /** + * Get the grafanaPlugins property: Update of Grafana plugin. Key is plugin id, value is plugin definition. If + * plugin definition is null, plugin with given plugin id will be removed. Otherwise, given plugin will be + * installed. + * + * @return the grafanaPlugins value. + */ + public Map grafanaPlugins() { + return this.grafanaPlugins; + } + + /** + * Set the grafanaPlugins property: Update of Grafana plugin. Key is plugin id, value is plugin definition. If + * plugin definition is null, plugin with given plugin id will be removed. Otherwise, given plugin will be + * installed. + * + * @param grafanaPlugins the grafanaPlugins value to set. + * @return the ManagedGrafanaPropertiesUpdateParameters object itself. + */ + public ManagedGrafanaPropertiesUpdateParameters withGrafanaPlugins(Map grafanaPlugins) { + this.grafanaPlugins = grafanaPlugins; + return this; + } + + /** + * Get the grafanaMajorVersion property: The major Grafana software version to target. + * + * @return the grafanaMajorVersion value. + */ + public String grafanaMajorVersion() { + return this.grafanaMajorVersion; + } + + /** + * Set the grafanaMajorVersion property: The major Grafana software version to target. + * + * @param grafanaMajorVersion the grafanaMajorVersion value to set. + * @return the ManagedGrafanaPropertiesUpdateParameters object itself. + */ + public ManagedGrafanaPropertiesUpdateParameters withGrafanaMajorVersion(String grafanaMajorVersion) { + this.grafanaMajorVersion = grafanaMajorVersion; + return this; + } + /** * Validates the instance. * @@ -153,5 +271,21 @@ public void validate() { if (grafanaIntegrations() != null) { grafanaIntegrations().validate(); } + if (enterpriseConfigurations() != null) { + enterpriseConfigurations().validate(); + } + if (grafanaConfigurations() != null) { + grafanaConfigurations().validate(); + } + if (grafanaPlugins() != null) { + grafanaPlugins() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaUpdateParameters.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaUpdateParameters.java index 8e0fb99bac78..653a62083d43 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaUpdateParameters.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedGrafanaUpdateParameters.java @@ -12,6 +12,12 @@ /** The parameters for a PATCH request to a grafana resource. */ @Fluent public final class ManagedGrafanaUpdateParameters { + /* + * The sku property. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + /* * The managed identity of the grafana resource. */ @@ -31,6 +37,30 @@ public final class ManagedGrafanaUpdateParameters { @JsonProperty(value = "properties") private ManagedGrafanaPropertiesUpdateParameters properties; + /** Creates an instance of ManagedGrafanaUpdateParameters class. */ + public ManagedGrafanaUpdateParameters() { + } + + /** + * Get the sku property: The sku property. + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku property. + * + * @param sku the sku value to set. + * @return the ManagedGrafanaUpdateParameters object itself. + */ + public ManagedGrafanaUpdateParameters withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + /** * Get the identity property: The managed identity of the grafana resource. * @@ -97,6 +127,9 @@ public ManagedGrafanaUpdateParameters withProperties(ManagedGrafanaPropertiesUpd * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (sku() != null) { + sku().validate(); + } if (identity() != null) { identity().validate(); } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointConnectionState.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointConnectionState.java new file mode 100644 index 000000000000..bfde5879c1b9 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointConnectionState.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The state of managed private endpoint connection. */ +@Immutable +public final class ManagedPrivateEndpointConnectionState { + /* + * The approval/rejection status of managed private endpoint connection. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ManagedPrivateEndpointConnectionStatus status; + + /* + * Gets or sets the reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of ManagedPrivateEndpointConnectionState class. */ + public ManagedPrivateEndpointConnectionState() { + } + + /** + * Get the status property: The approval/rejection status of managed private endpoint connection. + * + * @return the status value. + */ + public ManagedPrivateEndpointConnectionStatus status() { + return this.status; + } + + /** + * Get the description property: Gets or sets the reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointConnectionStatus.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointConnectionStatus.java new file mode 100644 index 000000000000..575a45dcf08f --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointConnectionStatus.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The approval/rejection status of managed private endpoint connection. */ +public final class ManagedPrivateEndpointConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for ManagedPrivateEndpointConnectionStatus. */ + public static final ManagedPrivateEndpointConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for ManagedPrivateEndpointConnectionStatus. */ + public static final ManagedPrivateEndpointConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for ManagedPrivateEndpointConnectionStatus. */ + public static final ManagedPrivateEndpointConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for ManagedPrivateEndpointConnectionStatus. */ + public static final ManagedPrivateEndpointConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates a new instance of ManagedPrivateEndpointConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedPrivateEndpointConnectionStatus() { + } + + /** + * Creates or finds a ManagedPrivateEndpointConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedPrivateEndpointConnectionStatus. + */ + @JsonCreator + public static ManagedPrivateEndpointConnectionStatus fromString(String name) { + return fromString(name, ManagedPrivateEndpointConnectionStatus.class); + } + + /** + * Gets known ManagedPrivateEndpointConnectionStatus values. + * + * @return known ManagedPrivateEndpointConnectionStatus values. + */ + public static Collection values() { + return values(ManagedPrivateEndpointConnectionStatus.class); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointModel.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointModel.java new file mode 100644 index 000000000000..de6ee0f01a77 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointModel.java @@ -0,0 +1,344 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.dashboard.fluent.models.ManagedPrivateEndpointModelInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ManagedPrivateEndpointModel. */ +public interface ManagedPrivateEndpointModel { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the 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 privateLinkResourceId property: The ARM resource ID of the resource for which the managed private + * endpoint is pointing to. + * + * @return the privateLinkResourceId value. + */ + String privateLinkResourceId(); + + /** + * Gets the privateLinkResourceRegion property: The region of the resource to which the managed private endpoint is + * pointing to. + * + * @return the privateLinkResourceRegion value. + */ + String privateLinkResourceRegion(); + + /** + * Gets the groupIds property: The group Ids of the managed private endpoint. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the requestMessage property: User input request message of the managed private endpoint. + * + * @return the requestMessage value. + */ + String requestMessage(); + + /** + * Gets the connectionState property: The state of managed private endpoint connection. + * + * @return the connectionState value. + */ + ManagedPrivateEndpointConnectionState connectionState(); + + /** + * Gets the privateLinkServiceUrl property: The URL of the data store behind the private link service. It would be + * the URL in the Grafana data source configuration page without the protocol and port. + * + * @return the privateLinkServiceUrl value. + */ + String privateLinkServiceUrl(); + + /** + * Gets the privateLinkServicePrivateIp property: The private IP of private endpoint after approval. This property + * is empty before connection is approved. + * + * @return the privateLinkServicePrivateIp value. + */ + String privateLinkServicePrivateIp(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.dashboard.fluent.models.ManagedPrivateEndpointModelInner object. + * + * @return the inner object. + */ + ManagedPrivateEndpointModelInner innerModel(); + + /** The entirety of the ManagedPrivateEndpointModel definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The ManagedPrivateEndpointModel definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedPrivateEndpointModel definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the ManagedPrivateEndpointModel definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the ManagedPrivateEndpointModel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @return the next definition stage. + */ + WithCreate withExistingGrafana(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the ManagedPrivateEndpointModel definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithPrivateLinkResourceId, + DefinitionStages.WithPrivateLinkResourceRegion, + DefinitionStages.WithGroupIds, + DefinitionStages.WithRequestMessage, + DefinitionStages.WithPrivateLinkServiceUrl { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedPrivateEndpointModel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedPrivateEndpointModel create(Context context); + } + + /** The stage of the ManagedPrivateEndpointModel definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the ManagedPrivateEndpointModel definition allowing to specify privateLinkResourceId. */ + interface WithPrivateLinkResourceId { + /** + * Specifies the privateLinkResourceId property: The ARM resource ID of the resource for which the managed + * private endpoint is pointing to.. + * + * @param privateLinkResourceId The ARM resource ID of the resource for which the managed private endpoint + * is pointing to. + * @return the next definition stage. + */ + WithCreate withPrivateLinkResourceId(String privateLinkResourceId); + } + + /** The stage of the ManagedPrivateEndpointModel definition allowing to specify privateLinkResourceRegion. */ + interface WithPrivateLinkResourceRegion { + /** + * Specifies the privateLinkResourceRegion property: The region of the resource to which the managed private + * endpoint is pointing to.. + * + * @param privateLinkResourceRegion The region of the resource to which the managed private endpoint is + * pointing to. + * @return the next definition stage. + */ + WithCreate withPrivateLinkResourceRegion(String privateLinkResourceRegion); + } + + /** The stage of the ManagedPrivateEndpointModel definition allowing to specify groupIds. */ + interface WithGroupIds { + /** + * Specifies the groupIds property: The group Ids of the managed private endpoint.. + * + * @param groupIds The group Ids of the managed private endpoint. + * @return the next definition stage. + */ + WithCreate withGroupIds(List groupIds); + } + + /** The stage of the ManagedPrivateEndpointModel definition allowing to specify requestMessage. */ + interface WithRequestMessage { + /** + * Specifies the requestMessage property: User input request message of the managed private endpoint.. + * + * @param requestMessage User input request message of the managed private endpoint. + * @return the next definition stage. + */ + WithCreate withRequestMessage(String requestMessage); + } + + /** The stage of the ManagedPrivateEndpointModel definition allowing to specify privateLinkServiceUrl. */ + interface WithPrivateLinkServiceUrl { + /** + * Specifies the privateLinkServiceUrl property: The URL of the data store behind the private link service. + * It would be the URL in the Grafana data source configuration page without the protocol and port.. + * + * @param privateLinkServiceUrl The URL of the data store behind the private link service. It would be the + * URL in the Grafana data source configuration page without the protocol and port. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceUrl(String privateLinkServiceUrl); + } + } + + /** + * Begins update for the ManagedPrivateEndpointModel resource. + * + * @return the stage of resource update. + */ + ManagedPrivateEndpointModel.Update update(); + + /** The template for ManagedPrivateEndpointModel update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedPrivateEndpointModel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedPrivateEndpointModel apply(Context context); + } + + /** The ManagedPrivateEndpointModel update stages. */ + interface UpdateStages { + /** The stage of the ManagedPrivateEndpointModel update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The new tags of the managed private endpoint.. + * + * @param tags The new tags of the managed private endpoint. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedPrivateEndpointModel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedPrivateEndpointModel refresh(Context context); +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointModelListResponse.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointModelListResponse.java new file mode 100644 index 000000000000..5b1d62b1a854 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointModelListResponse.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.dashboard.fluent.models.ManagedPrivateEndpointModelInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of managed private endpoints of a grafana resource. */ +@Fluent +public final class ManagedPrivateEndpointModelListResponse { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ManagedPrivateEndpointModelListResponse class. */ + public ManagedPrivateEndpointModelListResponse() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ManagedPrivateEndpointModelListResponse object itself. + */ + public ManagedPrivateEndpointModelListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the ManagedPrivateEndpointModelListResponse object itself. + */ + public ManagedPrivateEndpointModelListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointUpdateParameters.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointUpdateParameters.java new file mode 100644 index 000000000000..f9bfca02c2ea --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpointUpdateParameters.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for a PATCH request to a managed private endpoint. */ +@Fluent +public final class ManagedPrivateEndpointUpdateParameters { + /* + * The new tags of the managed private endpoint. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ManagedPrivateEndpointUpdateParameters class. */ + public ManagedPrivateEndpointUpdateParameters() { + } + + /** + * Get the tags property: The new tags of the managed private endpoint. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The new tags of the managed private endpoint. + * + * @param tags the tags value to set. + * @return the ManagedPrivateEndpointUpdateParameters object itself. + */ + public ManagedPrivateEndpointUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpoints.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpoints.java new file mode 100644 index 000000000000..bb936c04ab50 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedPrivateEndpoints.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.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 ManagedPrivateEndpoints. */ +public interface ManagedPrivateEndpoints { + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of managed private endpoints of a grafana resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List all managed private endpoints of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 of managed private endpoints of a grafana resource as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String resourceGroupName, String workspaceName); + + /** + * Refresh and sync managed private endpoints of a grafana resource to latest state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 refresh(String resourceGroupName, String workspaceName, Context context); + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific managed private endpoint of a grafana resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String managedPrivateEndpointName, Context context); + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 specific managed private endpoint of a grafana resource. + */ + ManagedPrivateEndpointModel get(String resourceGroupName, String workspaceName, String managedPrivateEndpointName); + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String managedPrivateEndpointName); + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The workspace name of Azure Managed Grafana. + * @param managedPrivateEndpointName The managed private endpoint name of Azure Managed Grafana. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 workspaceName, String managedPrivateEndpointName, Context context); + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @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 specific managed private endpoint of a grafana resource along with {@link Response}. + */ + ManagedPrivateEndpointModel getById(String id); + + /** + * Get a specific managed private endpoint of a grafana resource. + * + * @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 specific managed private endpoint of a grafana resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a managed private endpoint for a grafana resource. + * + * @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 managed private endpoint for a grafana resource. + * + * @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 ManagedPrivateEndpointModel resource. + * + * @param name resource name. + * @return the first stage of the new ManagedPrivateEndpointModel definition. + */ + ManagedPrivateEndpointModel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedServiceIdentity.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedServiceIdentity.java index 6e78446c7362..3135865c6899 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedServiceIdentity.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedServiceIdentity.java @@ -13,7 +13,7 @@ /** Managed service identity (system assigned and/or user assigned identities). */ @Fluent -public class ManagedServiceIdentity { +public final class ManagedServiceIdentity { /* * The service principal ID of the system assigned identity. This property will only be provided for a system * assigned identity. @@ -44,6 +44,10 @@ public class ManagedServiceIdentity { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; + /** Creates an instance of ManagedServiceIdentity class. */ + public ManagedServiceIdentity() { + } + /** * Get the principalId property: The service principal ID of the system assigned identity. This property will only * be provided for a system assigned identity. diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedServiceIdentityType.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedServiceIdentityType.java index 4c749c850d78..2b8a538068ec 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedServiceIdentityType.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ManagedServiceIdentityType.java @@ -23,6 +23,15 @@ public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value Disabled for MarketplaceAutoRenew. */ + public static final MarketplaceAutoRenew DISABLED = fromString("Disabled"); + + /** Static value Enabled for MarketplaceAutoRenew. */ + public static final MarketplaceAutoRenew ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of MarketplaceAutoRenew value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MarketplaceAutoRenew() { + } + + /** + * Creates or finds a MarketplaceAutoRenew from its string representation. + * + * @param name a name to look for. + * @return the corresponding MarketplaceAutoRenew. + */ + @JsonCreator + public static MarketplaceAutoRenew fromString(String name) { + return fromString(name, MarketplaceAutoRenew.class); + } + + /** + * Gets known MarketplaceAutoRenew values. + * + * @return known MarketplaceAutoRenew values. + */ + public static Collection values() { + return values(MarketplaceAutoRenew.class); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/MarketplaceTrialQuota.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/MarketplaceTrialQuota.java new file mode 100644 index 000000000000..ad55cd6c599d --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/MarketplaceTrialQuota.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The allocation details of the per subscription free trial slot of the subscription. */ +@Fluent +public final class MarketplaceTrialQuota { + /* + * Available enterprise promotion for the subscription + */ + @JsonProperty(value = "availablePromotion") + private AvailablePromotion availablePromotion; + + /* + * Resource Id of the Grafana resource which is doing the trial. + */ + @JsonProperty(value = "grafanaResourceId") + private String grafanaResourceId; + + /* + * The date and time in UTC of when the trial starts. + */ + @JsonProperty(value = "trialStartAt") + private OffsetDateTime trialStartAt; + + /* + * The date and time in UTC of when the trial ends. + */ + @JsonProperty(value = "trialEndAt") + private OffsetDateTime trialEndAt; + + /** Creates an instance of MarketplaceTrialQuota class. */ + public MarketplaceTrialQuota() { + } + + /** + * Get the availablePromotion property: Available enterprise promotion for the subscription. + * + * @return the availablePromotion value. + */ + public AvailablePromotion availablePromotion() { + return this.availablePromotion; + } + + /** + * Set the availablePromotion property: Available enterprise promotion for the subscription. + * + * @param availablePromotion the availablePromotion value to set. + * @return the MarketplaceTrialQuota object itself. + */ + public MarketplaceTrialQuota withAvailablePromotion(AvailablePromotion availablePromotion) { + this.availablePromotion = availablePromotion; + return this; + } + + /** + * Get the grafanaResourceId property: Resource Id of the Grafana resource which is doing the trial. + * + * @return the grafanaResourceId value. + */ + public String grafanaResourceId() { + return this.grafanaResourceId; + } + + /** + * Set the grafanaResourceId property: Resource Id of the Grafana resource which is doing the trial. + * + * @param grafanaResourceId the grafanaResourceId value to set. + * @return the MarketplaceTrialQuota object itself. + */ + public MarketplaceTrialQuota withGrafanaResourceId(String grafanaResourceId) { + this.grafanaResourceId = grafanaResourceId; + return this; + } + + /** + * Get the trialStartAt property: The date and time in UTC of when the trial starts. + * + * @return the trialStartAt value. + */ + public OffsetDateTime trialStartAt() { + return this.trialStartAt; + } + + /** + * Set the trialStartAt property: The date and time in UTC of when the trial starts. + * + * @param trialStartAt the trialStartAt value to set. + * @return the MarketplaceTrialQuota object itself. + */ + public MarketplaceTrialQuota withTrialStartAt(OffsetDateTime trialStartAt) { + this.trialStartAt = trialStartAt; + return this; + } + + /** + * Get the trialEndAt property: The date and time in UTC of when the trial ends. + * + * @return the trialEndAt value. + */ + public OffsetDateTime trialEndAt() { + return this.trialEndAt; + } + + /** + * Set the trialEndAt property: The date and time in UTC of when the trial ends. + * + * @param trialEndAt the trialEndAt value to set. + * @return the MarketplaceTrialQuota object itself. + */ + public MarketplaceTrialQuota withTrialEndAt(OffsetDateTime trialEndAt) { + this.trialEndAt = trialEndAt; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/OperationDisplay.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/OperationDisplay.java index b291155522c9..3dc7efaf2a66 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/OperationDisplay.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/OperationDisplay.java @@ -37,6 +37,10 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/OperationListResult.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/OperationListResult.java index 4bfdfe3ed1b7..05f57e4b6c10 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/OperationListResult.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/OperationListResult.java @@ -27,6 +27,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: List of operations supported by the resource provider. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/Origin.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/Origin.java index 6732e93940b4..e3ce8d6e4d4d 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/Origin.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/Origin.java @@ -22,6 +22,15 @@ public final class Origin extends ExpandableStringEnum { /** Static value user,system for Origin. */ public static final Origin USER_SYSTEM = fromString("user,system"); + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + /** * Creates or finds a Origin from its string representation. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpoint.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpoint.java index 30c5f60d474b..e02a68744760 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpoint.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpoint.java @@ -16,6 +16,10 @@ public final class PrivateEndpoint { @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + /** * Get the id property: The ARM identifier for Private Endpoint. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnection.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnection.java index c827421beab3..02eac3751ce1 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnection.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnection.java @@ -86,11 +86,13 @@ public interface PrivateEndpointConnection { interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } + /** The PrivateEndpointConnection definition stages. */ interface DefinitionStages { /** The first stage of the PrivateEndpointConnection definition. */ interface Blank extends WithParentResource { } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ interface WithParentResource { /** @@ -102,6 +104,7 @@ interface WithParentResource { */ WithCreate withExistingGrafana(String resourceGroupName, String workspaceName); } + /** * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for * the resource to be created, but also allows for any other optional properties to be specified. @@ -125,6 +128,7 @@ interface WithCreate */ PrivateEndpointConnection create(Context context); } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ interface WithPrivateEndpoint { /** @@ -135,6 +139,7 @@ interface WithPrivateEndpoint { */ WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); } + /** * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. */ @@ -150,6 +155,7 @@ interface WithPrivateLinkServiceConnectionState { WithCreate withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } + /** The stage of the PrivateEndpointConnection definition allowing to specify groupIds. */ interface WithGroupIds { /** @@ -161,6 +167,7 @@ interface WithGroupIds { WithCreate withGroupIds(List groupIds); } } + /** * Begins update for the PrivateEndpointConnection resource. * @@ -188,6 +195,7 @@ interface Update */ PrivateEndpointConnection apply(Context context); } + /** The PrivateEndpointConnection update stages. */ interface UpdateStages { /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ @@ -200,6 +208,7 @@ interface WithPrivateEndpoint { */ Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ interface WithPrivateLinkServiceConnectionState { /** @@ -213,6 +222,7 @@ interface WithPrivateLinkServiceConnectionState { Update withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState); } + /** The stage of the PrivateEndpointConnection update allowing to specify groupIds. */ interface WithGroupIds { /** @@ -224,6 +234,7 @@ interface WithGroupIds { Update withGroupIds(List groupIds); } } + /** * Refreshes the resource to sync with Azure. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnectionListResult.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnectionListResult.java index 758280811702..ad376cf05ab1 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnectionListResult.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnectionListResult.java @@ -24,6 +24,10 @@ public final class PrivateEndpointConnectionListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + /** * Get the value property: Array of private endpoint connections. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnectionProvisioningState.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnectionProvisioningState.java index b5b44add85ce..4e03eb3990e1 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnectionProvisioningState.java @@ -23,6 +23,15 @@ public final class PrivateEndpointConnectionProvisioningState /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + /** * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnections.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnections.java index 1c8bc8a04582..7e21346b0356 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnections.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointConnections.java @@ -16,12 +16,14 @@ public interface PrivateEndpointConnections { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connections. + * @return private endpoint connections along with {@link Response}. */ - PrivateEndpointConnection get(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); /** * Get private endpoint connections. @@ -29,14 +31,12 @@ public interface PrivateEndpointConnections { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateEndpointConnectionName The private endpoint connection name of Azure Managed Grafana. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connections along with {@link Response}. + * @return private endpoint connections. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnection get(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); /** * Delete private endpoint connection. diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointServiceConnectionStatus.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointServiceConnectionStatus.java index dac729ce54ba..bcfdce5ae04c 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateEndpointServiceConnectionStatus.java @@ -20,6 +20,15 @@ public final class PrivateEndpointServiceConnectionStatus /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + /** * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkResourceListResult.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkResourceListResult.java index 1035d50abcc7..ae19801e986b 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkResourceListResult.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkResourceListResult.java @@ -24,6 +24,10 @@ public final class PrivateLinkResourceListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of PrivateLinkResourceListResult class. */ + public PrivateLinkResourceListResult() { + } + /** * Get the value property: Array of private link resources. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkResources.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkResources.java index 7f62c4af40ba..ebcca10c716f 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkResources.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkResources.java @@ -41,12 +41,14 @@ public interface PrivateLinkResources { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateLinkResourceName The privateLinkResourceName parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific private link resource information for this grafana resource. + * @return specific private link resource information for this grafana resource along with {@link Response}. */ - PrivateLinkResource get(String resourceGroupName, String workspaceName, String privateLinkResourceName); + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context); /** * Get specific private link resource information for this grafana resource. @@ -54,12 +56,10 @@ public interface PrivateLinkResources { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The workspace name of Azure Managed Grafana. * @param privateLinkResourceName The privateLinkResourceName parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specific private link resource information for this grafana resource along with {@link Response}. + * @return specific private link resource information for this grafana resource. */ - Response getWithResponse( - String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context); + PrivateLinkResource get(String resourceGroupName, String workspaceName, String privateLinkResourceName); } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkServiceConnectionState.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkServiceConnectionState.java index 72ae16b1f692..36c9190a8649 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkServiceConnectionState.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/PrivateLinkServiceConnectionState.java @@ -28,6 +28,10 @@ public final class PrivateLinkServiceConnectionState { @JsonProperty(value = "actionsRequired") private String actionsRequired; + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + /** * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the * service. diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ProvisioningState.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ProvisioningState.java index 6d0b1bf897ad..90f08e6e0fa3 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ProvisioningState.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ProvisioningState.java @@ -37,6 +37,15 @@ public final class ProvisioningState extends ExpandableStringEnum { + /** Static value OpportunisticStartTLS for StartTlsPolicy. */ + public static final StartTlsPolicy OPPORTUNISTIC_START_TLS = fromString("OpportunisticStartTLS"); + + /** Static value MandatoryStartTLS for StartTlsPolicy. */ + public static final StartTlsPolicy MANDATORY_START_TLS = fromString("MandatoryStartTLS"); + + /** Static value NoStartTLS for StartTlsPolicy. */ + public static final StartTlsPolicy NO_START_TLS = fromString("NoStartTLS"); + + /** + * Creates a new instance of StartTlsPolicy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StartTlsPolicy() { + } + + /** + * Creates or finds a StartTlsPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding StartTlsPolicy. + */ + @JsonCreator + public static StartTlsPolicy fromString(String name) { + return fromString(name, StartTlsPolicy.class); + } + + /** + * Gets known StartTlsPolicy values. + * + * @return known StartTlsPolicy values. + */ + public static Collection values() { + return values(StartTlsPolicy.class); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/SubscriptionTerm.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/SubscriptionTerm.java new file mode 100644 index 000000000000..ab8585447984 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/SubscriptionTerm.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The current billing term of the SaaS Subscription. */ +@Fluent +public final class SubscriptionTerm { + /* + * The unit of the billing term. + */ + @JsonProperty(value = "termUnit") + private String termUnit; + + /* + * The date and time in UTC of when the billing term starts. + */ + @JsonProperty(value = "startDate") + private OffsetDateTime startDate; + + /* + * The date and time in UTC of when the billing term ends. + */ + @JsonProperty(value = "endDate") + private OffsetDateTime endDate; + + /** Creates an instance of SubscriptionTerm class. */ + public SubscriptionTerm() { + } + + /** + * Get the termUnit property: The unit of the billing term. + * + * @return the termUnit value. + */ + public String termUnit() { + return this.termUnit; + } + + /** + * Set the termUnit property: The unit of the billing term. + * + * @param termUnit the termUnit value to set. + * @return the SubscriptionTerm object itself. + */ + public SubscriptionTerm withTermUnit(String termUnit) { + this.termUnit = termUnit; + return this; + } + + /** + * Get the startDate property: The date and time in UTC of when the billing term starts. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.startDate; + } + + /** + * Set the startDate property: The date and time in UTC of when the billing term starts. + * + * @param startDate the startDate value to set. + * @return the SubscriptionTerm object itself. + */ + public SubscriptionTerm withStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get the endDate property: The date and time in UTC of when the billing term ends. + * + * @return the endDate value. + */ + public OffsetDateTime endDate() { + return this.endDate; + } + + /** + * Set the endDate property: The date and time in UTC of when the billing term ends. + * + * @param endDate the endDate value to set. + * @return the SubscriptionTerm object itself. + */ + public SubscriptionTerm withEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/UserAssignedIdentity.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/UserAssignedIdentity.java index f0fadeb4522d..8e172a4c8c32 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/UserAssignedIdentity.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/UserAssignedIdentity.java @@ -10,7 +10,7 @@ /** User assigned identity properties. */ @Immutable -public class UserAssignedIdentity { +public final class UserAssignedIdentity { /* * The principal ID of the assigned identity. */ @@ -23,6 +23,10 @@ public class UserAssignedIdentity { @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private UUID clientId; + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + /** * Get the principalId property: The principal ID of the assigned identity. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ZoneRedundancy.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ZoneRedundancy.java index e0df74dc8ae2..d06bceacb8b2 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ZoneRedundancy.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/java/com/azure/resourcemanager/dashboard/models/ZoneRedundancy.java @@ -16,6 +16,15 @@ public final class ZoneRedundancy extends ExpandableStringEnum { /** Static value Enabled for ZoneRedundancy. */ public static final ZoneRedundancy ENABLED = fromString("Enabled"); + /** + * Creates a new instance of ZoneRedundancy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ZoneRedundancy() { + } + /** * Creates or finds a ZoneRedundancy from its string representation. * diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dashboard/proxy-config.json b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dashboard/proxy-config.json new file mode 100644 index 000000000000..ad355e5937ec --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dashboard/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.dashboard.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.dashboard.implementation.GrafanasClientImpl$GrafanasService" ], [ "com.azure.resourcemanager.dashboard.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService" ], [ "com.azure.resourcemanager.dashboard.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService" ], [ "com.azure.resourcemanager.dashboard.implementation.ManagedPrivateEndpointsClientImpl$ManagedPrivateEndpointsService" ] ] \ No newline at end of file diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dashboard/reflect-config.json b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dashboard/reflect-config.json new file mode 100644 index 000000000000..6aaf84802ec7 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-dashboard/reflect-config.json @@ -0,0 +1,261 @@ +[ { + "name" : "com.azure.resourcemanager.dashboard.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedGrafanaListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.ManagedGrafanaInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ResourceSku", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedGrafanaProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.PrivateEndpointConnectionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.PrivateEndpointConnectionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.PrivateEndpoint", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.PrivateLinkServiceConnectionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.GrafanaIntegrations", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.EnterpriseConfigurations", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.GrafanaConfigurations", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.Smtp", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.GrafanaPlugin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedServiceIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.UserAssignedIdentity", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedGrafanaUpdateParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedGrafanaPropertiesUpdateParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.PrivateEndpointConnectionListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.PrivateLinkResourceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.PrivateLinkResourceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.PrivateLinkResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.EnterpriseDetailsInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.SaasSubscriptionDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.SubscriptionTerm", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.MarketplaceTrialQuota", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.GrafanaAvailablePluginListResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.GrafanaAvailablePlugin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointModelListResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.ManagedPrivateEndpointModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.fluent.models.ManagedPrivateEndpointModelProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointConnectionState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointUpdateParameters", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.GrafanasUpdateHeaders", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.PublicNetworkAccess", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ZoneRedundancy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ApiKey", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.PrivateEndpointServiceConnectionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.PrivateEndpointConnectionProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.AutoGeneratedDomainNameLabelScope", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.MarketplaceAutoRenew", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.StartTlsPolicy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.AvailablePromotion", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointConnectionStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaCheckEnterpriseDetailsSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaCheckEnterpriseDetailsSamples.java new file mode 100644 index 000000000000..5e4d7baae8b5 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaCheckEnterpriseDetailsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.generated; + +/** Samples for Grafana CheckEnterpriseDetails. */ +public final class GrafanaCheckEnterpriseDetailsSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/EnterpriseDetails_Post.json + */ + /** + * Sample code: EnterpriseDetails_Post. + * + * @param manager Entry point to DashboardManager. + */ + public static void enterpriseDetailsPost(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .grafanas() + .checkEnterpriseDetailsWithResponse("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaCreateSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaCreateSamples.java index fcbc9ab82df8..7c9e3c075a04 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaCreateSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaCreateSamples.java @@ -7,12 +7,18 @@ import com.azure.resourcemanager.dashboard.models.ApiKey; import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration; import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; +import com.azure.resourcemanager.dashboard.models.EnterpriseConfigurations; +import com.azure.resourcemanager.dashboard.models.GrafanaConfigurations; import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; +import com.azure.resourcemanager.dashboard.models.GrafanaPlugin; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaProperties; import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentity; import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.dashboard.models.MarketplaceAutoRenew; import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; import com.azure.resourcemanager.dashboard.models.ResourceSku; +import com.azure.resourcemanager.dashboard.models.Smtp; +import com.azure.resourcemanager.dashboard.models.StartTlsPolicy; import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; import java.util.Arrays; import java.util.HashMap; @@ -21,7 +27,7 @@ /** Samples for Grafana Create. */ public final class GrafanaCreateSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Create.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Create.json */ /** * Sample code: Grafana_Create. @@ -49,11 +55,30 @@ public static void grafanaCreate(com.azure.resourcemanager.dashboard.DashboardMa .asList( new AzureMonitorWorkspaceIntegration() .withAzureMonitorWorkspaceResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"))))) + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace")))) + .withEnterpriseConfigurations( + new EnterpriseConfigurations() + .withMarketplacePlanId("myPlanId") + .withMarketplaceAutoRenew(MarketplaceAutoRenew.ENABLED)) + .withGrafanaConfigurations( + new GrafanaConfigurations() + .withSmtp( + new Smtp() + .withEnabled(true) + .withHost("smtp.sendemail.com:587") + .withUser("username") + .withPassword("fakeTokenPlaceholder") + .withFromAddress("test@sendemail.com") + .withFromName("emailsender") + .withStartTlsPolicy(StartTlsPolicy.OPPORTUNISTIC_START_TLS) + .withSkipVerify(true))) + .withGrafanaPlugins(mapOf("sample-plugin-id", new GrafanaPlugin())) + .withGrafanaMajorVersion("9")) .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaDeleteSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaDeleteSamples.java index d1ae4a4296cc..3897b0c99f46 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaDeleteSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for Grafana Delete. */ public final class GrafanaDeleteSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Delete.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Delete.json */ /** * Sample code: Grafana_Delete. @@ -17,6 +15,6 @@ public final class GrafanaDeleteSamples { * @param manager Entry point to DashboardManager. */ public static void grafanaDelete(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.grafanas().delete("myResourceGroup", "myWorkspace", Context.NONE); + manager.grafanas().delete("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaFetchAvailablePluginsSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaFetchAvailablePluginsSamples.java new file mode 100644 index 000000000000..97b851f118a6 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaFetchAvailablePluginsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.generated; + +/** Samples for Grafana FetchAvailablePlugins. */ +public final class GrafanaFetchAvailablePluginsSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_FetchAvailablePlugins.json + */ + /** + * Sample code: Grafana_FetchAvailablePlugins. + * + * @param manager Entry point to DashboardManager. + */ + public static void grafanaFetchAvailablePlugins(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .grafanas() + .fetchAvailablePluginsWithResponse("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaGetByResourceGroupSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaGetByResourceGroupSamples.java index bd3041a94c8b..2138be1ae624 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaGetByResourceGroupSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for Grafana GetByResourceGroup. */ public final class GrafanaGetByResourceGroupSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Get.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Get.json */ /** * Sample code: Grafana_Get. @@ -17,6 +15,8 @@ public final class GrafanaGetByResourceGroupSamples { * @param manager Entry point to DashboardManager. */ public static void grafanaGet(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.grafanas().getByResourceGroupWithResponse("myResourceGroup", "myWorkspace", Context.NONE); + manager + .grafanas() + .getByResourceGroupWithResponse("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaListByResourceGroupSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaListByResourceGroupSamples.java index 19aa5c98b656..30940852e73e 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaListByResourceGroupSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for Grafana ListByResourceGroup. */ public final class GrafanaListByResourceGroupSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_ListByResourceGroup.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_ListByResourceGroup.json */ /** * Sample code: Grafana_ListByResourceGroup. @@ -17,6 +15,6 @@ public final class GrafanaListByResourceGroupSamples { * @param manager Entry point to DashboardManager. */ public static void grafanaListByResourceGroup(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.grafanas().listByResourceGroup("myResourceGroup", Context.NONE); + manager.grafanas().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaListSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaListSamples.java index 8c577d892cef..97203882bf8c 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaListSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for Grafana List. */ public final class GrafanaListSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_List.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_List.json */ /** * Sample code: Grafana_List. @@ -17,6 +15,6 @@ public final class GrafanaListSamples { * @param manager Entry point to DashboardManager. */ public static void grafanaList(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.grafanas().list(Context.NONE); + manager.grafanas().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaUpdateSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaUpdateSamples.java index 91b62269524f..adca7921c732 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaUpdateSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/GrafanaUpdateSamples.java @@ -4,13 +4,19 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.dashboard.models.ApiKey; import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration; import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; +import com.azure.resourcemanager.dashboard.models.EnterpriseConfigurations; +import com.azure.resourcemanager.dashboard.models.GrafanaConfigurations; import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; +import com.azure.resourcemanager.dashboard.models.GrafanaPlugin; import com.azure.resourcemanager.dashboard.models.ManagedGrafana; import com.azure.resourcemanager.dashboard.models.ManagedGrafanaPropertiesUpdateParameters; +import com.azure.resourcemanager.dashboard.models.MarketplaceAutoRenew; +import com.azure.resourcemanager.dashboard.models.ResourceSku; +import com.azure.resourcemanager.dashboard.models.Smtp; +import com.azure.resourcemanager.dashboard.models.StartTlsPolicy; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -18,7 +24,7 @@ /** Samples for Grafana Update. */ public final class GrafanaUpdateSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Grafana_Update.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Grafana_Update.json */ /** * Sample code: Grafana_Update. @@ -29,11 +35,12 @@ public static void grafanaUpdate(com.azure.resourcemanager.dashboard.DashboardMa ManagedGrafana resource = manager .grafanas() - .getByResourceGroupWithResponse("myResourceGroup", "myWorkspace", Context.NONE) + .getByResourceGroupWithResponse("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE) .getValue(); resource .update() .withTags(mapOf("Environment", "Dev 2")) + .withSku(new ResourceSku().withName("Standard")) .withProperties( new ManagedGrafanaPropertiesUpdateParameters() .withApiKey(ApiKey.ENABLED) @@ -45,10 +52,29 @@ public static void grafanaUpdate(com.azure.resourcemanager.dashboard.DashboardMa .asList( new AzureMonitorWorkspaceIntegration() .withAzureMonitorWorkspaceResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"))))) + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace")))) + .withEnterpriseConfigurations( + new EnterpriseConfigurations() + .withMarketplacePlanId("myPlanId") + .withMarketplaceAutoRenew(MarketplaceAutoRenew.ENABLED)) + .withGrafanaConfigurations( + new GrafanaConfigurations() + .withSmtp( + new Smtp() + .withEnabled(true) + .withHost("smtp.sendemail.com:587") + .withUser("username") + .withPassword("fakeTokenPlaceholder") + .withFromAddress("test@sendemail.com") + .withFromName("emailsender") + .withStartTlsPolicy(StartTlsPolicy.OPPORTUNISTIC_START_TLS) + .withSkipVerify(true))) + .withGrafanaPlugins(mapOf("sample-plugin-id", new GrafanaPlugin())) + .withGrafanaMajorVersion("9")) .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsCreateSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsCreateSamples.java new file mode 100644 index 000000000000..04dbede8a2b4 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.generated; + +import java.util.Arrays; + +/** Samples for ManagedPrivateEndpoints Create. */ +public final class ManagedPrivateEndpointsCreateSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Create.json + */ + /** + * Sample code: ManagedPrivateEndpoint_Create. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointCreate(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .managedPrivateEndpoints() + .define("myMPEName") + .withRegion("West US") + .withExistingGrafana("myResourceGroup", "myWorkspace") + .withPrivateLinkResourceId( + "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-000000000000/resourceGroups/xx-rg/providers/Microsoft.Kusto/Clusters/sampleKustoResource") + .withPrivateLinkResourceRegion("West US") + .withGroupIds(Arrays.asList("grafana")) + .withRequestMessage("Example Request Message") + .withPrivateLinkServiceUrl("my-self-hosted-influxdb.westus.mydomain.com") + .create(); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsDeleteSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsDeleteSamples.java new file mode 100644 index 000000000000..f4761789b8ec --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.generated; + +/** Samples for ManagedPrivateEndpoints Delete. */ +public final class ManagedPrivateEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Delete.json + */ + /** + * Sample code: ManagedPrivateEndpoint_Delete. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointDelete(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .managedPrivateEndpoints() + .delete("myResourceGroup", "myWorkspace", "myMPEName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsGetSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsGetSamples.java new file mode 100644 index 000000000000..63a3570f5967 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.generated; + +/** Samples for ManagedPrivateEndpoints Get. */ +public final class ManagedPrivateEndpointsGetSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Get.json + */ + /** + * Sample code: ManagedPrivateEndpoint_Get. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointGet(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager + .managedPrivateEndpoints() + .getWithResponse("myResourceGroup", "myWorkspace", "myMPEName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsListSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsListSamples.java new file mode 100644 index 000000000000..335a078adb9b --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.generated; + +/** Samples for ManagedPrivateEndpoints List. */ +public final class ManagedPrivateEndpointsListSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_List.json + */ + /** + * Sample code: ManagedPrivateEndpoint_List. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointList(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager.managedPrivateEndpoints().list("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsRefreshSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsRefreshSamples.java new file mode 100644 index 000000000000..1c5ad3dd2ead --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsRefreshSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.generated; + +/** Samples for ManagedPrivateEndpoints Refresh. */ +public final class ManagedPrivateEndpointsRefreshSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Refresh.json + */ + /** + * Sample code: ManagedPrivateEndpoint_Refresh. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointRefresh(com.azure.resourcemanager.dashboard.DashboardManager manager) { + manager.managedPrivateEndpoints().refresh("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsUpdateSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsUpdateSamples.java new file mode 100644 index 000000000000..37ff14f0c173 --- /dev/null +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/ManagedPrivateEndpointsUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.dashboard.generated; + +import com.azure.resourcemanager.dashboard.models.ManagedPrivateEndpointModel; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedPrivateEndpoints Update. */ +public final class ManagedPrivateEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/ManagedPrivateEndpoints_Patch.json + */ + /** + * Sample code: ManagedPrivateEndpoints_Patch. + * + * @param manager Entry point to DashboardManager. + */ + public static void managedPrivateEndpointsPatch(com.azure.resourcemanager.dashboard.DashboardManager manager) { + ManagedPrivateEndpointModel resource = + manager + .managedPrivateEndpoints() + .getWithResponse("myResourceGroup", "myWorkspace", "myMPEName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Environment", "Dev 2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/OperationsListSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/OperationsListSamples.java index de14a0dc589d..4b923cbbe0cd 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/OperationsListSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/OperationsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/Operations_List.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/Operations_List.json */ /** * Sample code: Operations_List. @@ -17,6 +15,6 @@ public final class OperationsListSamples { * @param manager Entry point to DashboardManager. */ public static void operationsList(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsApproveSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsApproveSamples.java index 7b7a8007f401..1fb88f704830 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsApproveSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsApproveSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Approve. */ public final class PrivateEndpointConnectionsApproveSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Approve.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Approve.json */ /** * Sample code: PrivateEndpointConnections_Approve. diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsDeleteSamples.java index 82e642edc58b..f6d0ca286e9d 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Delete.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Delete.json */ /** * Sample code: PrivateEndpointConnections_Delete. @@ -17,6 +15,8 @@ public final class PrivateEndpointConnectionsDeleteSamples { * @param manager Entry point to DashboardManager. */ public static void privateEndpointConnectionsDelete(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.privateEndpointConnections().delete("myResourceGroup", "myWorkspace", "myConnection", Context.NONE); + manager + .privateEndpointConnections() + .delete("myResourceGroup", "myWorkspace", "myConnection", com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsGetSamples.java index 1fe68d9b6a7b..f2aa0181d55f 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_Get.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_Get.json */ /** * Sample code: PrivateEndpointConnections_Get. @@ -19,6 +17,6 @@ public final class PrivateEndpointConnectionsGetSamples { public static void privateEndpointConnectionsGet(com.azure.resourcemanager.dashboard.DashboardManager manager) { manager .privateEndpointConnections() - .getWithResponse("myResourceGroup", "myWorkspace", "myConnection", Context.NONE); + .getWithResponse("myResourceGroup", "myWorkspace", "myConnection", com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsListSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsListSamples.java index db5f55789073..c200210e0b42 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsListSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateEndpointConnections_List.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateEndpointConnections_List.json */ /** * Sample code: PrivateEndpointConnections_List. @@ -17,6 +15,6 @@ public final class PrivateEndpointConnectionsListSamples { * @param manager Entry point to DashboardManager. */ public static void privateEndpointConnectionsList(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.privateEndpointConnections().list("myResourceGroup", "myWorkspace", Context.NONE); + manager.privateEndpointConnections().list("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesGetSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesGetSamples.java index ca1e815d2a10..4f7686b9c7e2 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesGetSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for PrivateLinkResources Get. */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_Get.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_Get.json */ /** * Sample code: PrivateLinkResources_Get. @@ -17,6 +15,8 @@ public final class PrivateLinkResourcesGetSamples { * @param manager Entry point to DashboardManager. */ public static void privateLinkResourcesGet(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.privateLinkResources().getWithResponse("myResourceGroup", "myWorkspace", "grafana", Context.NONE); + manager + .privateLinkResources() + .getWithResponse("myResourceGroup", "myWorkspace", "grafana", com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesListSamples.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesListSamples.java index 4ae583991a60..cbb85b057f9c 100644 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesListSamples.java +++ b/sdk/dashboard/azure-resourcemanager-dashboard/src/samples/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.dashboard.generated; -import com.azure.core.util.Context; - /** Samples for PrivateLinkResources List. */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2022-08-01/examples/PrivateLinkResources_List.json + * x-ms-original-file: specification/dashboard/resource-manager/Microsoft.Dashboard/stable/2023-09-01/examples/PrivateLinkResources_List.json */ /** * Sample code: PrivateLinkResources_List. @@ -17,6 +15,6 @@ public final class PrivateLinkResourcesListSamples { * @param manager Entry point to DashboardManager. */ public static void privateLinkResourcesList(com.azure.resourcemanager.dashboard.DashboardManager manager) { - manager.privateLinkResources().list("myResourceGroup", "myWorkspace", Context.NONE); + manager.privateLinkResources().list("myResourceGroup", "myWorkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/AzureMonitorWorkspaceIntegrationTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/AzureMonitorWorkspaceIntegrationTests.java deleted file mode 100644 index 1df8fa3933cd..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/AzureMonitorWorkspaceIntegrationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AzureMonitorWorkspaceIntegrationTests { - @Test - public void testDeserialize() { - AzureMonitorWorkspaceIntegration model = - BinaryData - .fromString("{\"azureMonitorWorkspaceResourceId\":\"yc\"}") - .toObject(AzureMonitorWorkspaceIntegration.class); - Assertions.assertEquals("yc", model.azureMonitorWorkspaceResourceId()); - } - - @Test - public void testSerialize() { - AzureMonitorWorkspaceIntegration model = - new AzureMonitorWorkspaceIntegration().withAzureMonitorWorkspaceResourceId("yc"); - model = BinaryData.fromObject(model).toObject(AzureMonitorWorkspaceIntegration.class); - Assertions.assertEquals("yc", model.azureMonitorWorkspaceResourceId()); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanaIntegrationsTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanaIntegrationsTests.java deleted file mode 100644 index 2dc0b3e1526e..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanaIntegrationsTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration; -import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class GrafanaIntegrationsTests { - @Test - public void testDeserialize() { - GrafanaIntegrations model = - BinaryData - .fromString( - "{\"azureMonitorWorkspaceIntegrations\":[{\"azureMonitorWorkspaceResourceId\":\"pymzidnsezcxtbzs\"}]}") - .toObject(GrafanaIntegrations.class); - Assertions - .assertEquals( - "pymzidnsezcxtbzs", model.azureMonitorWorkspaceIntegrations().get(0).azureMonitorWorkspaceResourceId()); - } - - @Test - public void testSerialize() { - GrafanaIntegrations model = - new GrafanaIntegrations() - .withAzureMonitorWorkspaceIntegrations( - Arrays - .asList( - new AzureMonitorWorkspaceIntegration() - .withAzureMonitorWorkspaceResourceId("pymzidnsezcxtbzs"))); - model = BinaryData.fromObject(model).toObject(GrafanaIntegrations.class); - Assertions - .assertEquals( - "pymzidnsezcxtbzs", model.azureMonitorWorkspaceIntegrations().get(0).azureMonitorWorkspaceResourceId()); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasCreateTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasCreateTests.java deleted file mode 100644 index 16bab7215d03..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasCreateTests.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.dashboard.DashboardManager; -import com.azure.resourcemanager.dashboard.models.ApiKey; -import com.azure.resourcemanager.dashboard.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; -import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; -import com.azure.resourcemanager.dashboard.models.ManagedGrafana; -import com.azure.resourcemanager.dashboard.models.ManagedGrafanaProperties; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentity; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; -import com.azure.resourcemanager.dashboard.models.ResourceSku; -import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GrafanasCreateTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"sku\":{\"name\":\"jiwkuofoskghsau\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"grafanaVersion\":\"vxieduugidyj\",\"endpoint\":\"f\",\"publicNetworkAccess\":\"Enabled\",\"zoneRedundancy\":\"Enabled\",\"apiKey\":\"Disabled\",\"deterministicOutboundIP\":\"Enabled\",\"outboundIPs\":[\"npc\"],\"privateEndpointConnections\":[],\"autoGeneratedDomainNameLabelScope\":\"TenantReuse\",\"grafanaIntegrations\":{\"azureMonitorWorkspaceIntegrations\":[]}},\"identity\":{\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"gz\",\"tags\":{\"ithlvmezyvshxm\":\"hfmvfaxkffe\"},\"id\":\"sbbzo\",\"name\":\"gigr\",\"type\":\"wburvjxxjnspydpt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DashboardManager manager = - DashboardManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ManagedGrafana response = - manager - .grafanas() - .define("xbezyiuokktwh") - .withRegion("f") - .withExistingResourceGroup("xodpuozmyzydagfu") - .withTags(mapOf("wiqzbqjvsovmyo", "kpnpulexxbczwtr")) - .withSku(new ResourceSku().withName("xw")) - .withProperties( - new ManagedGrafanaProperties() - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withZoneRedundancy(ZoneRedundancy.ENABLED) - .withApiKey(ApiKey.ENABLED) - .withDeterministicOutboundIp(DeterministicOutboundIp.ENABLED) - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE) - .withGrafanaIntegrations( - new GrafanaIntegrations().withAzureMonitorWorkspaceIntegrations(Arrays.asList()))) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .create(); - - Assertions.assertEquals("gz", response.location()); - Assertions.assertEquals("hfmvfaxkffe", response.tags().get("ithlvmezyvshxm")); - Assertions.assertEquals("jiwkuofoskghsau", response.sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.properties().publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.ENABLED, response.properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.DISABLED, response.properties().apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, response.properties().deterministicOutboundIp()); - Assertions - .assertEquals( - AutoGeneratedDomainNameLabelScope.TENANT_REUSE, - response.properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasDeleteTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasDeleteTests.java deleted file mode 100644 index a1e5e45d3bcf..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasDeleteTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dashboard.DashboardManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GrafanasDeleteTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DashboardManager manager = - DashboardManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.grafanas().delete("jmcmatuokthfu", "uaodsfcpk", Context.NONE); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasListByResourceGroupTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasListByResourceGroupTests.java deleted file mode 100644 index f041781d4b6e..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasListByResourceGroupTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dashboard.DashboardManager; -import com.azure.resourcemanager.dashboard.models.ApiKey; -import com.azure.resourcemanager.dashboard.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; -import com.azure.resourcemanager.dashboard.models.ManagedGrafana; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; -import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GrafanasListByResourceGroupTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"sku\":{\"name\":\"zwdejbavor\"},\"properties\":{\"provisioningState\":\"Deleting\",\"grafanaVersion\":\"hctbqvudwxdn\",\"endpoint\":\"vo\",\"publicNetworkAccess\":\"Disabled\",\"zoneRedundancy\":\"Enabled\",\"apiKey\":\"Enabled\",\"deterministicOutboundIP\":\"Disabled\",\"outboundIPs\":[\"glhslazj\",\"yggdtjixh\",\"kuofqweykhme\",\"evfyexfwhybcib\"],\"privateEndpointConnections\":[],\"autoGeneratedDomainNameLabelScope\":\"TenantReuse\",\"grafanaIntegrations\":{\"azureMonitorWorkspaceIntegrations\":[]}},\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"dectehfiqsc\",\"tags\":{\"kgqhcjrefovg\":\"pvhez\",\"jpkcattpng\":\"kqsleyyvxy\",\"czsqpjhvm\":\"cr\"},\"id\":\"ajvnysounqe\",\"name\":\"a\",\"type\":\"oaeupfhyhltrpmo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DashboardManager manager = - DashboardManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.grafanas().listByResourceGroup("usue", Context.NONE); - - Assertions.assertEquals("dectehfiqsc", response.iterator().next().location()); - Assertions.assertEquals("pvhez", response.iterator().next().tags().get("kgqhcjrefovg")); - Assertions.assertEquals("zwdejbavor", response.iterator().next().sku().name()); - Assertions - .assertEquals(PublicNetworkAccess.DISABLED, response.iterator().next().properties().publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.ENABLED, response.iterator().next().properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.ENABLED, response.iterator().next().properties().apiKey()); - Assertions - .assertEquals( - DeterministicOutboundIp.DISABLED, response.iterator().next().properties().deterministicOutboundIp()); - Assertions - .assertEquals( - AutoGeneratedDomainNameLabelScope.TENANT_REUSE, - response.iterator().next().properties().autoGeneratedDomainNameLabelScope()); - Assertions - .assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasListTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasListTests.java deleted file mode 100644 index 8ae41af0f512..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/GrafanasListTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dashboard.DashboardManager; -import com.azure.resourcemanager.dashboard.models.ApiKey; -import com.azure.resourcemanager.dashboard.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; -import com.azure.resourcemanager.dashboard.models.ManagedGrafana; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; -import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GrafanasListTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"sku\":{\"name\":\"rjfeallnwsubisnj\"},\"properties\":{\"provisioningState\":\"Accepted\",\"grafanaVersion\":\"gnzscxaqwo\",\"endpoint\":\"hcbonqvpkvlr\",\"publicNetworkAccess\":\"Enabled\",\"zoneRedundancy\":\"Disabled\",\"apiKey\":\"Enabled\",\"deterministicOutboundIP\":\"Enabled\",\"outboundIPs\":[\"oflokey\"],\"privateEndpointConnections\":[],\"autoGeneratedDomainNameLabelScope\":\"TenantReuse\",\"grafanaIntegrations\":{\"azureMonitorWorkspaceIntegrations\":[]}},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"location\":\"djpjumasxazjpq\",\"tags\":{\"zvdudgwdslfhotwm\":\"ualhbxxhejj\"},\"id\":\"ynpwlbj\",\"name\":\"pgacftadehxnlty\",\"type\":\"sop\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DashboardManager manager = - DashboardManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.grafanas().list(Context.NONE); - - Assertions.assertEquals("djpjumasxazjpq", response.iterator().next().location()); - Assertions.assertEquals("ualhbxxhejj", response.iterator().next().tags().get("zvdudgwdslfhotwm")); - Assertions.assertEquals("rjfeallnwsubisnj", response.iterator().next().sku().name()); - Assertions - .assertEquals(PublicNetworkAccess.ENABLED, response.iterator().next().properties().publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.DISABLED, response.iterator().next().properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.ENABLED, response.iterator().next().properties().apiKey()); - Assertions - .assertEquals( - DeterministicOutboundIp.ENABLED, response.iterator().next().properties().deterministicOutboundIp()); - Assertions - .assertEquals( - AutoGeneratedDomainNameLabelScope.TENANT_REUSE, - response.iterator().next().properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaInnerTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaInnerTests.java deleted file mode 100644 index b6042b027f4b..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaInnerTests.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.ManagedGrafanaInner; -import com.azure.resourcemanager.dashboard.models.ApiKey; -import com.azure.resourcemanager.dashboard.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; -import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; -import com.azure.resourcemanager.dashboard.models.ManagedGrafanaProperties; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentity; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; -import com.azure.resourcemanager.dashboard.models.ResourceSku; -import com.azure.resourcemanager.dashboard.models.UserAssignedIdentity; -import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedGrafanaInnerTests { - @Test - public void testDeserialize() { - ManagedGrafanaInner model = - BinaryData - .fromString( - "{\"sku\":{\"name\":\"pmqnja\"},\"properties\":{\"provisioningState\":\"Updating\",\"grafanaVersion\":\"sprozvcput\",\"endpoint\":\"jvwmfda\",\"publicNetworkAccess\":\"Enabled\",\"zoneRedundancy\":\"Enabled\",\"apiKey\":\"Enabled\",\"deterministicOutboundIP\":\"Enabled\",\"outboundIPs\":[\"suuv\",\"kjozkrwfnd\",\"odjpslwejd\",\"vwryoqpso\"],\"privateEndpointConnections\":[{\"id\":\"zakljlahbc\",\"name\":\"yffdfdos\",\"type\":\"gexpaojakhmsbz\"},{\"id\":\"rzevdphlxaol\",\"name\":\"hqtrgqjbpf\",\"type\":\"fsinzgvfcjrwzoxx\"},{\"id\":\"elluwfziton\",\"name\":\"eqfpj\",\"type\":\"jlxofpdvhpfxxyp\"},{\"id\":\"nmayhuybb\",\"name\":\"podepoo\",\"type\":\"inuvamiheogn\"}],\"autoGeneratedDomainNameLabelScope\":\"TenantReuse\",\"grafanaIntegrations\":{\"azureMonitorWorkspaceIntegrations\":[]}},\"identity\":{\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"yevc\":{}}},\"location\":\"qi\",\"tags\":{\"bwjzr\":\"un\",\"fublj\":\"fygxgispemvtzfk\",\"aeqjhqjbasvms\":\"fxqeof\"},\"id\":\"jqul\",\"name\":\"gsntnbybkzgcwr\",\"type\":\"clxxwrljdo\"}") - .toObject(ManagedGrafanaInner.class); - Assertions.assertEquals("qi", model.location()); - Assertions.assertEquals("un", model.tags().get("bwjzr")); - Assertions.assertEquals("pmqnja", model.sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.ENABLED, model.properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.ENABLED, model.properties().apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, model.properties().deterministicOutboundIp()); - Assertions - .assertEquals( - AutoGeneratedDomainNameLabelScope.TENANT_REUSE, model.properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - } - - @Test - public void testSerialize() { - ManagedGrafanaInner model = - new ManagedGrafanaInner() - .withLocation("qi") - .withTags(mapOf("bwjzr", "un", "fublj", "fygxgispemvtzfk", "aeqjhqjbasvms", "fxqeof")) - .withSku(new ResourceSku().withName("pmqnja")) - .withProperties( - new ManagedGrafanaProperties() - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withZoneRedundancy(ZoneRedundancy.ENABLED) - .withApiKey(ApiKey.ENABLED) - .withDeterministicOutboundIp(DeterministicOutboundIp.ENABLED) - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE) - .withGrafanaIntegrations( - new GrafanaIntegrations().withAzureMonitorWorkspaceIntegrations(Arrays.asList()))) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("yevc", new UserAssignedIdentity()))); - model = BinaryData.fromObject(model).toObject(ManagedGrafanaInner.class); - Assertions.assertEquals("qi", model.location()); - Assertions.assertEquals("un", model.tags().get("bwjzr")); - Assertions.assertEquals("pmqnja", model.sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.ENABLED, model.properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.ENABLED, model.properties().apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, model.properties().deterministicOutboundIp()); - Assertions - .assertEquals( - AutoGeneratedDomainNameLabelScope.TENANT_REUSE, model.properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaListResponseTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaListResponseTests.java deleted file mode 100644 index 38b933fc8af6..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaListResponseTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.ManagedGrafanaInner; -import com.azure.resourcemanager.dashboard.models.ApiKey; -import com.azure.resourcemanager.dashboard.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; -import com.azure.resourcemanager.dashboard.models.ManagedGrafanaListResponse; -import com.azure.resourcemanager.dashboard.models.ManagedGrafanaProperties; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentity; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; -import com.azure.resourcemanager.dashboard.models.ResourceSku; -import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedGrafanaListResponseTests { - @Test - public void testDeserialize() { - ManagedGrafanaListResponse model = - BinaryData - .fromString( - "{\"value\":[{\"sku\":{\"name\":\"ithxqhabifpi\"},\"properties\":{\"provisioningState\":\"Accepted\",\"grafanaVersion\":\"byscnp\",\"endpoint\":\"uhivyqniw\",\"publicNetworkAccess\":\"Enabled\",\"zoneRedundancy\":\"Disabled\",\"apiKey\":\"Disabled\",\"deterministicOutboundIP\":\"Enabled\",\"outboundIPs\":[],\"privateEndpointConnections\":[],\"autoGeneratedDomainNameLabelScope\":\"TenantReuse\"},\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"gaudcc\",\"tags\":{\"cnyejhkryhtnapcz\":\"s\"},\"id\":\"lokjyemkk\",\"name\":\"ni\",\"type\":\"joxzjnchgejspodm\"}],\"nextLink\":\"lzydehojwyahux\"}") - .toObject(ManagedGrafanaListResponse.class); - Assertions.assertEquals("gaudcc", model.value().get(0).location()); - Assertions.assertEquals("s", model.value().get(0).tags().get("cnyejhkryhtnapcz")); - Assertions.assertEquals("ithxqhabifpi", model.value().get(0).sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.DISABLED, model.value().get(0).properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.DISABLED, model.value().get(0).properties().apiKey()); - Assertions - .assertEquals(DeterministicOutboundIp.ENABLED, model.value().get(0).properties().deterministicOutboundIp()); - Assertions - .assertEquals( - AutoGeneratedDomainNameLabelScope.TENANT_REUSE, - model.value().get(0).properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("lzydehojwyahux", model.nextLink()); - } - - @Test - public void testSerialize() { - ManagedGrafanaListResponse model = - new ManagedGrafanaListResponse() - .withValue( - Arrays - .asList( - new ManagedGrafanaInner() - .withLocation("gaudcc") - .withTags(mapOf("cnyejhkryhtnapcz", "s")) - .withSku(new ResourceSku().withName("ithxqhabifpi")) - .withProperties( - new ManagedGrafanaProperties() - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withZoneRedundancy(ZoneRedundancy.DISABLED) - .withApiKey(ApiKey.DISABLED) - .withDeterministicOutboundIp(DeterministicOutboundIp.ENABLED) - .withAutoGeneratedDomainNameLabelScope( - AutoGeneratedDomainNameLabelScope.TENANT_REUSE)) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())))) - .withNextLink("lzydehojwyahux"); - model = BinaryData.fromObject(model).toObject(ManagedGrafanaListResponse.class); - Assertions.assertEquals("gaudcc", model.value().get(0).location()); - Assertions.assertEquals("s", model.value().get(0).tags().get("cnyejhkryhtnapcz")); - Assertions.assertEquals("ithxqhabifpi", model.value().get(0).sku().name()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.DISABLED, model.value().get(0).properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.DISABLED, model.value().get(0).properties().apiKey()); - Assertions - .assertEquals(DeterministicOutboundIp.ENABLED, model.value().get(0).properties().deterministicOutboundIp()); - Assertions - .assertEquals( - AutoGeneratedDomainNameLabelScope.TENANT_REUSE, - model.value().get(0).properties().autoGeneratedDomainNameLabelScope()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("lzydehojwyahux", model.nextLink()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaPropertiesTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaPropertiesTests.java deleted file mode 100644 index 37b669242edb..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaPropertiesTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.ApiKey; -import com.azure.resourcemanager.dashboard.models.AutoGeneratedDomainNameLabelScope; -import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration; -import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; -import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; -import com.azure.resourcemanager.dashboard.models.ManagedGrafanaProperties; -import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; -import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedGrafanaPropertiesTests { - @Test - public void testDeserialize() { - ManagedGrafanaProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Deleted\",\"grafanaVersion\":\"hxbnjbiksqrg\",\"endpoint\":\"sainqpjwnzl\",\"publicNetworkAccess\":\"Enabled\",\"zoneRedundancy\":\"Enabled\",\"apiKey\":\"Enabled\",\"deterministicOutboundIP\":\"Enabled\",\"outboundIPs\":[\"gxsabkyq\",\"uujitcjc\"],\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Succeeded\"},\"id\":\"rwpdappdsbdkvwrw\",\"name\":\"feusnhut\",\"type\":\"eltmrldhugjzzdat\"},{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Deleting\"},\"id\":\"eablg\",\"name\":\"huticndvkao\",\"type\":\"wyiftyhxhur\"},{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Failed\"},\"id\":\"lniwpwcukjfkgiaw\",\"name\":\"klryplwck\",\"type\":\"asy\"},{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Failed\"},\"id\":\"gcbacphejkot\",\"name\":\"nqgoulzndli\",\"type\":\"wyqkgfgibm\"}],\"autoGeneratedDomainNameLabelScope\":\"TenantReuse\",\"grafanaIntegrations\":{\"azureMonitorWorkspaceIntegrations\":[{\"azureMonitorWorkspaceResourceId\":\"s\"},{\"azureMonitorWorkspaceResourceId\":\"yb\"},{\"azureMonitorWorkspaceResourceId\":\"qedqytbciqfoufl\"},{\"azureMonitorWorkspaceResourceId\":\"nkzsmodmglou\"}]}}") - .toObject(ManagedGrafanaProperties.class); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.ENABLED, model.zoneRedundancy()); - Assertions.assertEquals(ApiKey.ENABLED, model.apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, model.deterministicOutboundIp()); - Assertions - .assertEquals(AutoGeneratedDomainNameLabelScope.TENANT_REUSE, model.autoGeneratedDomainNameLabelScope()); - Assertions - .assertEquals( - "s", - model - .grafanaIntegrations() - .azureMonitorWorkspaceIntegrations() - .get(0) - .azureMonitorWorkspaceResourceId()); - } - - @Test - public void testSerialize() { - ManagedGrafanaProperties model = - new ManagedGrafanaProperties() - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withZoneRedundancy(ZoneRedundancy.ENABLED) - .withApiKey(ApiKey.ENABLED) - .withDeterministicOutboundIp(DeterministicOutboundIp.ENABLED) - .withAutoGeneratedDomainNameLabelScope(AutoGeneratedDomainNameLabelScope.TENANT_REUSE) - .withGrafanaIntegrations( - new GrafanaIntegrations() - .withAzureMonitorWorkspaceIntegrations( - Arrays - .asList( - new AzureMonitorWorkspaceIntegration().withAzureMonitorWorkspaceResourceId("s"), - new AzureMonitorWorkspaceIntegration().withAzureMonitorWorkspaceResourceId("yb"), - new AzureMonitorWorkspaceIntegration() - .withAzureMonitorWorkspaceResourceId("qedqytbciqfoufl"), - new AzureMonitorWorkspaceIntegration() - .withAzureMonitorWorkspaceResourceId("nkzsmodmglou")))); - model = BinaryData.fromObject(model).toObject(ManagedGrafanaProperties.class); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals(ZoneRedundancy.ENABLED, model.zoneRedundancy()); - Assertions.assertEquals(ApiKey.ENABLED, model.apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, model.deterministicOutboundIp()); - Assertions - .assertEquals(AutoGeneratedDomainNameLabelScope.TENANT_REUSE, model.autoGeneratedDomainNameLabelScope()); - Assertions - .assertEquals( - "s", - model - .grafanaIntegrations() - .azureMonitorWorkspaceIntegrations() - .get(0) - .azureMonitorWorkspaceResourceId()); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaPropertiesUpdateParametersTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaPropertiesUpdateParametersTests.java deleted file mode 100644 index 92a923588e1a..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaPropertiesUpdateParametersTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.ApiKey; -import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration; -import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; -import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; -import com.azure.resourcemanager.dashboard.models.ManagedGrafanaPropertiesUpdateParameters; -import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; -import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedGrafanaPropertiesUpdateParametersTests { - @Test - public void testDeserialize() { - ManagedGrafanaPropertiesUpdateParameters model = - BinaryData - .fromString( - "{\"zoneRedundancy\":\"Disabled\",\"apiKey\":\"Enabled\",\"deterministicOutboundIP\":\"Enabled\",\"publicNetworkAccess\":\"Enabled\",\"grafanaIntegrations\":{\"azureMonitorWorkspaceIntegrations\":[{\"azureMonitorWorkspaceResourceId\":\"bl\"},{\"azureMonitorWorkspaceResourceId\":\"gpbtoqcjmklj\"},{\"azureMonitorWorkspaceResourceId\":\"bqidtqaj\"},{\"azureMonitorWorkspaceResourceId\":\"ulpkudjkrl\"}]}}") - .toObject(ManagedGrafanaPropertiesUpdateParameters.class); - Assertions.assertEquals(ZoneRedundancy.DISABLED, model.zoneRedundancy()); - Assertions.assertEquals(ApiKey.ENABLED, model.apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, model.deterministicOutboundIp()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions - .assertEquals( - "bl", - model - .grafanaIntegrations() - .azureMonitorWorkspaceIntegrations() - .get(0) - .azureMonitorWorkspaceResourceId()); - } - - @Test - public void testSerialize() { - ManagedGrafanaPropertiesUpdateParameters model = - new ManagedGrafanaPropertiesUpdateParameters() - .withZoneRedundancy(ZoneRedundancy.DISABLED) - .withApiKey(ApiKey.ENABLED) - .withDeterministicOutboundIp(DeterministicOutboundIp.ENABLED) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withGrafanaIntegrations( - new GrafanaIntegrations() - .withAzureMonitorWorkspaceIntegrations( - Arrays - .asList( - new AzureMonitorWorkspaceIntegration().withAzureMonitorWorkspaceResourceId("bl"), - new AzureMonitorWorkspaceIntegration() - .withAzureMonitorWorkspaceResourceId("gpbtoqcjmklj"), - new AzureMonitorWorkspaceIntegration() - .withAzureMonitorWorkspaceResourceId("bqidtqaj"), - new AzureMonitorWorkspaceIntegration() - .withAzureMonitorWorkspaceResourceId("ulpkudjkrl")))); - model = BinaryData.fromObject(model).toObject(ManagedGrafanaPropertiesUpdateParameters.class); - Assertions.assertEquals(ZoneRedundancy.DISABLED, model.zoneRedundancy()); - Assertions.assertEquals(ApiKey.ENABLED, model.apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, model.deterministicOutboundIp()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions - .assertEquals( - "bl", - model - .grafanaIntegrations() - .azureMonitorWorkspaceIntegrations() - .get(0) - .azureMonitorWorkspaceResourceId()); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaUpdateParametersTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaUpdateParametersTests.java deleted file mode 100644 index a4a1c1fd5803..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedGrafanaUpdateParametersTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.ApiKey; -import com.azure.resourcemanager.dashboard.models.DeterministicOutboundIp; -import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations; -import com.azure.resourcemanager.dashboard.models.ManagedGrafanaPropertiesUpdateParameters; -import com.azure.resourcemanager.dashboard.models.ManagedGrafanaUpdateParameters; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentity; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.dashboard.models.PublicNetworkAccess; -import com.azure.resourcemanager.dashboard.models.UserAssignedIdentity; -import com.azure.resourcemanager.dashboard.models.ZoneRedundancy; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedGrafanaUpdateParametersTests { - @Test - public void testDeserialize() { - ManagedGrafanaUpdateParameters model = - BinaryData - .fromString( - "{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"mzinpvswjdk\":{},\"oodqxhcrm\":{},\"jtckwhdso\":{}}},\"tags\":{\"xsqwpgrjbznorc\":\"yip\"},\"properties\":{\"zoneRedundancy\":\"Disabled\",\"apiKey\":\"Disabled\",\"deterministicOutboundIP\":\"Enabled\",\"publicNetworkAccess\":\"Disabled\",\"grafanaIntegrations\":{\"azureMonitorWorkspaceIntegrations\":[]}}}") - .toObject(ManagedGrafanaUpdateParameters.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("yip", model.tags().get("xsqwpgrjbznorc")); - Assertions.assertEquals(ZoneRedundancy.DISABLED, model.properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.DISABLED, model.properties().apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, model.properties().deterministicOutboundIp()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); - } - - @Test - public void testSerialize() { - ManagedGrafanaUpdateParameters model = - new ManagedGrafanaUpdateParameters() - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf( - "mzinpvswjdk", - new UserAssignedIdentity(), - "oodqxhcrm", - new UserAssignedIdentity(), - "jtckwhdso", - new UserAssignedIdentity()))) - .withTags(mapOf("xsqwpgrjbznorc", "yip")) - .withProperties( - new ManagedGrafanaPropertiesUpdateParameters() - .withZoneRedundancy(ZoneRedundancy.DISABLED) - .withApiKey(ApiKey.DISABLED) - .withDeterministicOutboundIp(DeterministicOutboundIp.ENABLED) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withGrafanaIntegrations( - new GrafanaIntegrations().withAzureMonitorWorkspaceIntegrations(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(ManagedGrafanaUpdateParameters.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("yip", model.tags().get("xsqwpgrjbznorc")); - Assertions.assertEquals(ZoneRedundancy.DISABLED, model.properties().zoneRedundancy()); - Assertions.assertEquals(ApiKey.DISABLED, model.properties().apiKey()); - Assertions.assertEquals(DeterministicOutboundIp.ENABLED, model.properties().deterministicOutboundIp()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedServiceIdentityTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index fc374668eea9..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentity; -import com.azure.resourcemanager.dashboard.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.dashboard.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedServiceIdentityTests { - @Test - public void testDeserialize() { - ManagedServiceIdentity model = - BinaryData - .fromString( - "{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"z\":{},\"ac\":{},\"osfln\":{},\"fqpte\":{}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @Test - public void testSerialize() { - ManagedServiceIdentity model = - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "z", - new UserAssignedIdentity(), - "ac", - new UserAssignedIdentity(), - "osfln", - new UserAssignedIdentity(), - "fqpte", - new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationDisplayTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationDisplayTests.java deleted file mode 100644 index 6b6dd312eb71..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationDisplayTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.OperationDisplay; -import org.junit.jupiter.api.Test; - -public final class OperationDisplayTests { - @Test - public void testDeserialize() { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @Test - public void testSerialize() { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationInnerTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationInnerTests.java deleted file mode 100644 index f984422f0a71..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.OperationInner; -import com.azure.resourcemanager.dashboard.models.OperationDisplay; -import org.junit.jupiter.api.Test; - -public final class OperationInnerTests { - @Test - public void testDeserialize() { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @Test - public void testSerialize() { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationListResultTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationListResultTests.java deleted file mode 100644 index f8dd725b6cba..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.OperationListResult; -import org.junit.jupiter.api.Test; - -public final class OperationListResultTests { - @Test - public void testDeserialize() { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @Test - public void testSerialize() { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationsListTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationsListTests.java deleted file mode 100644 index eb1b3a5c6791..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/OperationsListTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dashboard.DashboardManager; -import com.azure.resourcemanager.dashboard.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"xlzevgbmqjqabcy\",\"isDataAction\":true,\"display\":{\"provider\":\"w\",\"resource\":\"uvcc\",\"operation\":\"nfnbacfionlebxe\",\"description\":\"gtzxdpn\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DashboardManager manager = - DashboardManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(Context.NONE); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionInnerTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 92f9ead2db61..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.dashboard.models.PrivateEndpoint; -import com.azure.resourcemanager.dashboard.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.dashboard.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionInnerTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"wtmutduq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"spwgcuertumkdosv\",\"actionsRequired\":\"hbmdgbbjfdd\"},\"groupIds\":[\"mbe\",\"ppbhtqqrolfp\",\"psalgbqux\",\"gjyjgzjaoyfhrtxi\"],\"provisioningState\":\"Creating\"},\"id\":\"kujysvlejuvfq\",\"name\":\"wrlyxwjkcprb\",\"type\":\"wbxgjvt\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("spwgcuertumkdosv", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("hbmdgbbjfdd", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("mbe", model.groupIds().get(0)); - } - - @Test - public void testSerialize() { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("spwgcuertumkdosv") - .withActionsRequired("hbmdgbbjfdd")) - .withGroupIds(Arrays.asList("mbe", "ppbhtqqrolfp", "psalgbqux", "gjyjgzjaoyfhrtxi")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("spwgcuertumkdosv", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("hbmdgbbjfdd", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("mbe", model.groupIds().get(0)); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionListResultTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 329233cc27ce..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.dashboard.models.PrivateEndpointConnectionListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionListResultTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Creating\"},\"id\":\"zgqexz\",\"name\":\"ocxscpaierhhbcs\",\"type\":\"l\"},{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Deleting\"},\"id\":\"aodxo\",\"name\":\"nbdxk\",\"type\":\"pxokajionp\"},{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Creating\"},\"id\":\"xgcp\",\"name\":\"dg\",\"type\":\"aajrm\"},{\"properties\":{\"groupIds\":[],\"provisioningState\":\"Failed\"},\"id\":\"ovmclwhijcoejct\",\"name\":\"zaqsqsycbkbfk\",\"type\":\"ukdkexxppofmxa\"}],\"nextLink\":\"fjpgddtocjjxhvp\"}") - .toObject(PrivateEndpointConnectionListResult.class); - } - - @Test - public void testSerialize() { - PrivateEndpointConnectionListResult model = - new PrivateEndpointConnectionListResult() - .withValue( - Arrays - .asList( - new PrivateEndpointConnectionInner().withGroupIds(Arrays.asList()), - new PrivateEndpointConnectionInner().withGroupIds(Arrays.asList()), - new PrivateEndpointConnectionInner().withGroupIds(Arrays.asList()), - new PrivateEndpointConnectionInner().withGroupIds(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index b61828d32c11..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.dashboard.models.PrivateEndpoint; -import com.azure.resourcemanager.dashboard.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.dashboard.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointConnectionPropertiesTests { - @Test - public void testDeserialize() { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"privateEndpoint\":{\"id\":\"ysszdnrujqguh\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qfprwzwbn\",\"actionsRequired\":\"itnwuizgazxufi\"},\"groupIds\":[\"kyfi\",\"rfidfvzwdz\"],\"provisioningState\":\"Succeeded\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qfprwzwbn", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("itnwuizgazxufi", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("kyfi", model.groupIds().get(0)); - } - - @Test - public void testSerialize() { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("qfprwzwbn") - .withActionsRequired("itnwuizgazxufi")) - .withGroupIds(Arrays.asList("kyfi", "rfidfvzwdz")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qfprwzwbn", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("itnwuizgazxufi", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("kyfi", model.groupIds().get(0)); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsListTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsListTests.java deleted file mode 100644 index 3b2ccbb70cb6..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointConnectionsListTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dashboard.DashboardManager; -import com.azure.resourcemanager.dashboard.models.PrivateEndpointConnection; -import com.azure.resourcemanager.dashboard.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"egukgjnpiucg\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qzntypm\",\"actionsRequired\":\"p\"},\"groupIds\":[\"drqjsdpy\"],\"provisioningState\":\"Creating\"},\"id\":\"hxdeoejz\",\"name\":\"cwif\",\"type\":\"jttgzf\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DashboardManager manager = - DashboardManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateEndpointConnections().list("oenkouknvudwti", "kbldngkpocipa", Context.NONE); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("qzntypm", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("p", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("drqjsdpy", response.iterator().next().groupIds().get(0)); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointTests.java deleted file mode 100644 index 93ae02cbf4a6..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.PrivateEndpoint; -import org.junit.jupiter.api.Test; - -public final class PrivateEndpointTests { - @Test - public void testDeserialize() { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"mwisdkfthwxmnt\"}").toObject(PrivateEndpoint.class); - } - - @Test - public void testSerialize() { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourceInnerTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index 75a9721447ac..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.PrivateLinkResourceInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourceInnerTests { - @Test - public void testDeserialize() { - PrivateLinkResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"groupId\":\"ftutqxlngxlefgu\",\"requiredMembers\":[\"krxd\",\"mi\"],\"requiredZoneNames\":[\"hzrvqd\"]},\"id\":\"bhj\",\"name\":\"big\",\"type\":\"h\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("hzrvqd", model.requiredZoneNames().get(0)); - } - - @Test - public void testSerialize() { - PrivateLinkResourceInner model = new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList("hzrvqd")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("hzrvqd", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourceListResultTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index 08bc95ba6cf4..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.dashboard.models.PrivateLinkResourceListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourceListResultTests { - @Test - public void testDeserialize() { - PrivateLinkResourceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleted\",\"groupId\":\"zxibqeoj\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"zvddntwndeicbtwn\",\"name\":\"zao\",\"type\":\"vuhrhcffcyddgl\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"groupId\":\"qkwpyeicxmqc\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"hkh\",\"name\":\"xuigdtopbobj\",\"type\":\"ghmewuam\"}],\"nextLink\":\"hrzayvvtpgvdf\"}") - .toObject(PrivateLinkResourceListResult.class); - } - - @Test - public void testSerialize() { - PrivateLinkResourceListResult model = - new PrivateLinkResourceListResult() - .withValue( - Arrays - .asList( - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList()), - new PrivateLinkResourceInner().withRequiredZoneNames(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcePropertiesTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 6a9e46b6a4fa..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkResourcePropertiesTests { - @Test - public void testDeserialize() { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Creating\",\"groupId\":\"owskanyktz\",\"requiredMembers\":[\"iywgqywgndrvynh\"],\"requiredZoneNames\":[\"phrcgyncoc\",\"ecfvmm\",\"oo\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("phrcgyncoc", model.requiredZoneNames().get(0)); - } - - @Test - public void testSerialize() { - PrivateLinkResourceProperties model = - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("phrcgyncoc", "ecfvmm", "oo")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("phrcgyncoc", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesListTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesListTests.java deleted file mode 100644 index bef751c54b0d..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkResourcesListTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.dashboard.DashboardManager; -import com.azure.resourcemanager.dashboard.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"NotSpecified\",\"groupId\":\"md\",\"requiredMembers\":[\"g\",\"lpbuxwgipwhonowk\",\"shwankixzbinje\",\"uttmrywnuzoqft\"],\"requiredZoneNames\":[\"zrnkcqvyxlwh\",\"lsicohoqqnwv\",\"ryavwhheunmmqh\",\"yxzk\"]},\"id\":\"ocukoklyax\",\"name\":\"conuqszfkbeype\",\"type\":\"rmjmwvvjektc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - DashboardManager manager = - DashboardManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.privateLinkResources().list("ishc", "khaj", Context.NONE); - - Assertions.assertEquals("zrnkcqvyxlwh", response.iterator().next().requiredZoneNames().get(0)); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index e783701b1f00..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.dashboard.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class PrivateLinkServiceConnectionStateTests { - @Test - public void testDeserialize() { - PrivateLinkServiceConnectionState model = - BinaryData - .fromString("{\"status\":\"Rejected\",\"description\":\"opvkmijcm\",\"actionsRequired\":\"dcuf\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("opvkmijcm", model.description()); - Assertions.assertEquals("dcuf", model.actionsRequired()); - } - - @Test - public void testSerialize() { - PrivateLinkServiceConnectionState model = - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("opvkmijcm") - .withActionsRequired("dcuf"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("opvkmijcm", model.description()); - Assertions.assertEquals("dcuf", model.actionsRequired()); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ResourceSkuTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ResourceSkuTests.java deleted file mode 100644 index b077797b067e..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/ResourceSkuTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.ResourceSku; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ResourceSkuTests { - @Test - public void testDeserialize() { - ResourceSku model = BinaryData.fromString("{\"name\":\"skcqvkocrcjd\"}").toObject(ResourceSku.class); - Assertions.assertEquals("skcqvkocrcjd", model.name()); - } - - @Test - public void testSerialize() { - ResourceSku model = new ResourceSku().withName("skcqvkocrcjd"); - model = BinaryData.fromObject(model).toObject(ResourceSku.class); - Assertions.assertEquals("skcqvkocrcjd", model.name()); - } -} diff --git a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/UserAssignedIdentityTests.java b/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 56d25d0c460a..000000000000 --- a/sdk/dashboard/azure-resourcemanager-dashboard/src/test/java/com/azure/resourcemanager/dashboard/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.dashboard.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.dashboard.models.UserAssignedIdentity; -import org.junit.jupiter.api.Test; - -public final class UserAssignedIdentityTests { - @Test - public void testDeserialize() { - UserAssignedIdentity model = BinaryData.fromString("{}").toObject(UserAssignedIdentity.class); - } - - @Test - public void testSerialize() { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -}