diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md index c33a6a0f4e61..18214ccf16e0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md @@ -1,14 +1,90 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.3.0-beta.1 (2025-11-07) -### Features Added +- Azure Resource Manager NewRelicObservability client library for Java. This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2025-05-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.MonitorsSwitchBillingResponse` was removed + +#### `models.MonitorsSwitchBillingHeaders` was removed + +#### `models.BillingCycle` was removed + +#### `models.PlanData` was modified + +* `models.BillingCycle billingCycle()` -> `java.lang.String billingCycle()` +* `withBillingCycle(models.BillingCycle)` was removed + +### Features Added + +* `models.SaaS` was added + +* `models.LatestLinkedSaaSResponse` was added + +* `models.ActivateSaaSParameterRequest` was added + +* `models.ResubscribeProperties` was added + +* `models.SaaSData` was added + +* `models.SaaSResourceDetailsResponse` was added + +#### `models.PlanData` was modified + +* `withBillingCycle(java.lang.String)` was added + +#### `models.MarketplaceSaaSInfo` was modified + +* `withPublisherId(java.lang.String)` was added +* `withOfferId(java.lang.String)` was added +* `publisherId()` was added +* `offerId()` was added + +#### `models.NewRelicMonitorResource$Update` was modified + +* `withSaaSData(models.SaaSData)` was added + +#### `models.NewRelicMonitorResource` was modified + +* `latestLinkedSaaS()` was added +* `linkSaaS(models.SaaSData)` was added +* `refreshIngestionKeyWithResponse(com.azure.core.util.Context)` was added +* `linkSaaS(models.SaaSData,com.azure.core.util.Context)` was added +* `refreshIngestionKey()` was added +* `resubscribe()` was added +* `latestLinkedSaaSWithResponse(com.azure.core.util.Context)` was added +* `saaSData()` was added +* `resubscribe(models.ResubscribeProperties,com.azure.core.util.Context)` was added + +#### `models.NewRelicMonitorResource$Definition` was modified + +* `withSaaSData(models.SaaSData)` was added + +#### `models.NewRelicMonitorResourceUpdate` was modified + +* `withSaaSData(models.SaaSData)` was added +* `saaSData()` was added + +#### `models.MonitoredSubscriptionProperties` was modified + +* `systemData()` was added + +#### `models.Monitors` was modified + +* `resubscribe(java.lang.String,java.lang.String,models.ResubscribeProperties,com.azure.core.util.Context)` was added +* `latestLinkedSaaS(java.lang.String,java.lang.String)` was added +* `refreshIngestionKeyWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `resubscribe(java.lang.String,java.lang.String)` was added +* `latestLinkedSaaSWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `linkSaaS(java.lang.String,java.lang.String,models.SaaSData,com.azure.core.util.Context)` was added +* `linkSaaS(java.lang.String,java.lang.String,models.SaaSData)` was added +* `refreshIngestionKey(java.lang.String,java.lang.String)` was added + +#### `NewRelicObservabilityManager` was modified -### Other Changes +* `saaS()` was added ## 1.2.0 (2024-12-19) diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md index c59c56d1ba2b..def001411d76 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md @@ -2,7 +2,7 @@ Azure Resource Manager NewRelicObservability client library for Java. -This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. Package tag package-2024-01-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 NewRelicObservability Management SDK. Package tag package-2025-05-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ NewRelicObservabilityManager manager = NewRelicObservabilityManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md index c2df2326dd3b..9be8fa73682a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md @@ -15,7 +15,7 @@ ## MonitoredSubscriptions -- [CreateorUpdate](#monitoredsubscriptions_createorupdate) +- [CreateOrUpdate](#monitoredsubscriptions_createorupdate) - [Delete](#monitoredsubscriptions_delete) - [Get](#monitoredsubscriptions_get) - [List](#monitoredsubscriptions_list) @@ -28,12 +28,16 @@ - [GetByResourceGroup](#monitors_getbyresourcegroup) - [GetMetricRules](#monitors_getmetricrules) - [GetMetricStatus](#monitors_getmetricstatus) +- [LatestLinkedSaaS](#monitors_latestlinkedsaas) +- [LinkSaaS](#monitors_linksaas) - [List](#monitors_list) - [ListAppServices](#monitors_listappservices) - [ListByResourceGroup](#monitors_listbyresourcegroup) - [ListHosts](#monitors_listhosts) - [ListLinkedResources](#monitors_listlinkedresources) - [ListMonitoredResources](#monitors_listmonitoredresources) +- [RefreshIngestionKey](#monitors_refreshingestionkey) +- [Resubscribe](#monitors_resubscribe) - [SwitchBilling](#monitors_switchbilling) - [Update](#monitors_update) - [VmHostPayload](#monitors_vmhostpayload) @@ -50,6 +54,10 @@ - [List](#plans_list) +## SaaS + +- [ActivateResource](#saas_activateresource) + ## TagRules - [CreateOrUpdate](#tagrules_createorupdate) @@ -65,7 +73,8 @@ */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Accounts_List_MinimumSet_Gen.json */ /** @@ -79,7 +88,8 @@ public final class AccountsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Accounts_List_MaximumSet_Gen.json */ /** @@ -103,7 +113,8 @@ public final class AccountsListSamples { public final class BillingInfoGetSamples { /* * x-ms-original-file: - * specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/BillingInfo_Get.json + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * BillingInfo_Get.json */ /** * Sample code: BillingInfo_Get. @@ -125,7 +136,8 @@ public final class BillingInfoGetSamples { */ public final class ConnectedPartnerResourcesListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * ConnectedPartnerResources_List.json */ /** @@ -141,18 +153,19 @@ public final class ConnectedPartnerResourcesListSamples { } ``` -### MonitoredSubscriptions_CreateorUpdate +### MonitoredSubscriptions_CreateOrUpdate ```java import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; /** - * Samples for MonitoredSubscriptions CreateorUpdate. + * Samples for MonitoredSubscriptions CreateOrUpdate. */ -public final class MonitoredSubscriptionsCreateorUpdateSamples { +public final class MonitoredSubscriptionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ - * MonitoredSubscriptions_CreateorUpdate.json + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * MonitoredSubscriptions_CreateOrUpdate.json */ /** * Sample code: Monitors_AddMonitoredSubscriptions. @@ -179,7 +192,8 @@ import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; */ public final class MonitoredSubscriptionsDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * MonitoredSubscriptions_Delete.json */ /** @@ -205,7 +219,8 @@ import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; */ public final class MonitoredSubscriptionsGetSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * MonitoredSubscriptions_Get.json */ /** @@ -230,7 +245,8 @@ public final class MonitoredSubscriptionsGetSamples { */ public final class MonitoredSubscriptionsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * MonitoredSubscriptions_List.json */ /** @@ -256,7 +272,8 @@ import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscript */ public final class MonitoredSubscriptionsUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * MonitoredSubscriptions_Update.json */ /** @@ -280,7 +297,6 @@ public final class MonitoredSubscriptionsUpdateSamples { ```java import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.AccountInfo; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; @@ -289,6 +305,7 @@ import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.OrganizationInfo; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; import com.azure.resourcemanager.newrelicobservability.models.SingleSignOnStates; import com.azure.resourcemanager.newrelicobservability.models.UsageType; import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; @@ -302,7 +319,8 @@ import java.util.Map; */ public final class MonitorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_CreateOrUpdate_MaximumSet_Gen.json */ /** @@ -335,9 +353,11 @@ public final class MonitorsCreateOrUpdateSamples { .withPhoneNumber("krf") .withCountry("hslqnwdanrconqyekwbnttaetv")) .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) + .withBillingCycle("Yearly") .withPlanDetails("tbbiaga") .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withSaaSData(new SaaSData().withSaaSResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/Microsoft.SaaS/resources/abcd")) .withOrgCreationSource(OrgCreationSource.LIFTR) .withAccountCreationSource(AccountCreationSource.LIFTR) .withSubscriptionState("Suspended") @@ -367,7 +387,8 @@ public final class MonitorsCreateOrUpdateSamples { */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_Delete_MinimumSet_Gen.json */ /** @@ -378,12 +399,13 @@ public final class MonitorsDeleteSamples { public static void monitorsDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { manager.monitors() - .delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + .delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "ruxvg@xqkmdhrnoo.hlmbpm", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_Delete_MaximumSet_Gen.json */ /** @@ -394,7 +416,7 @@ public final class MonitorsDeleteSamples { public static void monitorsDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { manager.monitors() - .delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + .delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "ruxvg@xqkmdhrnoo.hlmbpm", com.azure.core.util.Context.NONE); } } @@ -408,7 +430,8 @@ public final class MonitorsDeleteSamples { */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_Get_MaximumSet_Gen.json */ /** @@ -433,7 +456,8 @@ import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; */ public final class MonitorsGetMetricRulesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_GetMetricRules_MinimumSet_Gen.json */ /** @@ -449,7 +473,8 @@ public final class MonitorsGetMetricRulesSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_GetMetricRules_MaximumSet_Gen.json */ /** @@ -477,7 +502,8 @@ import java.util.Arrays; */ public final class MonitorsGetMetricStatusSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_GetMetricStatus_MinimumSet_Gen.json */ /** @@ -496,7 +522,8 @@ public final class MonitorsGetMetricStatusSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_GetMetricStatus_MaximumSet_Gen.json */ /** @@ -516,6 +543,76 @@ public final class MonitorsGetMetricStatusSamples { } ``` +### Monitors_LatestLinkedSaaS + +```java +/** + * Samples for Monitors LatestLinkedSaaS. + */ +public final class MonitorsLatestLinkedSaaSSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_LatestLinkedSaaS_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_LatestLinkedSaaS_MinimumSet_Gen. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsLatestLinkedSaaSMinimumSetGen( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors() + .latestLinkedSaaSWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_LatestLinkedSaaS_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_LatestLinkedSaaS_MaximumSet_Gen. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsLatestLinkedSaaSMaximumSetGen( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors() + .latestLinkedSaaSWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + } +} +``` + +### Monitors_LinkSaaS + +```java +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; + +/** + * Samples for Monitors LinkSaaS. + */ +public final class MonitorsLinkSaaSSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_LinkSaaS.json + */ + /** + * Sample code: Monitors_LinkSaaS. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void + monitorsLinkSaaS(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors() + .linkSaaS("myResourceGroup", "myMonitor", new SaaSData().withSaaSResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/Microsoft.SaaS/resources/abcd"), + com.azure.core.util.Context.NONE); + } +} +``` + ### Monitors_List ```java @@ -524,7 +621,8 @@ public final class MonitorsGetMetricStatusSamples { */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListBySubscription_MaximumSet_Gen.json */ /** @@ -550,7 +648,8 @@ import java.util.Arrays; */ public final class MonitorsListAppServicesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListAppServices_MaximumSet_Gen.json */ /** @@ -569,7 +668,8 @@ public final class MonitorsListAppServicesSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListAppServices_MinimumSet_Gen.json */ /** @@ -597,7 +697,8 @@ public final class MonitorsListAppServicesSamples { */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListByResourceGroup_MaximumSet_Gen.json */ /** @@ -623,7 +724,8 @@ import java.util.Arrays; */ public final class MonitorsListHostsSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListHosts_MinimumSet_Gen.json */ /** @@ -641,7 +743,8 @@ public final class MonitorsListHostsSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListHosts_MaximumSet_Gen.json */ /** @@ -669,8 +772,8 @@ public final class MonitorsListHostsSamples { public final class MonitorsListLinkedResourcesSamples { /* * x-ms-original-file: - * specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/LinkedResources_List. - * json + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * LinkedResources_List.json */ /** * Sample code: Monitors_ListLinkedResources. @@ -692,7 +795,8 @@ public final class MonitorsListLinkedResourcesSamples { */ public final class MonitorsListMonitoredResourcesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListMonitoredResources_MinimumSet_Gen.json */ /** @@ -707,7 +811,8 @@ public final class MonitorsListMonitoredResourcesSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListMonitoredResources_MaximumSet_Gen.json */ /** @@ -723,10 +828,59 @@ public final class MonitorsListMonitoredResourcesSamples { } ``` +### Monitors_RefreshIngestionKey + +```java +/** + * Samples for Monitors RefreshIngestionKey. + */ +public final class MonitorsRefreshIngestionKeySamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_RefreshIngestionKey.json + */ + /** + * Sample code: Monitors_RefreshIngestionKey. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsRefreshIngestionKey( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors() + .refreshIngestionKeyWithResponse("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} +``` + +### Monitors_Resubscribe + +```java + +/** + * Samples for Monitors Resubscribe. + */ +public final class MonitorsResubscribeSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_Resubscribe.json + */ + /** + * Sample code: Monitors_Resubscribe. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void + monitorsResubscribe(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors().resubscribe("myResourceGroup", "myMonitor", null, com.azure.core.util.Context.NONE); + } +} +``` + ### Monitors_SwitchBilling ```java -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; import com.azure.resourcemanager.newrelicobservability.models.UsageType; @@ -737,7 +891,8 @@ import java.time.OffsetDateTime; */ public final class MonitorsSwitchBillingSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_SwitchBilling_MinimumSet_Gen.json */ /** @@ -753,7 +908,8 @@ public final class MonitorsSwitchBillingSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_SwitchBilling_MaximumSet_Gen.json */ /** @@ -769,7 +925,7 @@ public final class MonitorsSwitchBillingSamples { "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") .withOrganizationId("k") .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) + .withBillingCycle("Yearly") .withPlanDetails("tbbiaga") .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), @@ -783,7 +939,6 @@ public final class MonitorsSwitchBillingSamples { ```java import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.AccountInfo; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; @@ -806,7 +961,8 @@ import java.util.Map; */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_Update_MaximumSet_Gen.json */ /** @@ -839,7 +995,7 @@ public final class MonitorsUpdateSamples { .withPhoneNumber("krf") .withCountry("hslqnwdanrconqyekwbnttaetv")) .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) + .withBillingCycle("Yearly") .withPlanDetails("tbbiaga") .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) .withOrgCreationSource(OrgCreationSource.LIFTR) @@ -869,7 +1025,8 @@ public final class MonitorsUpdateSamples { */ public final class MonitorsVmHostPayloadSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_VmHostPayload_MinimumSet_Gen.json */ /** @@ -884,7 +1041,8 @@ public final class MonitorsVmHostPayloadSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_VmHostPayload_MaximumSet_Gen.json */ /** @@ -908,7 +1066,8 @@ public final class MonitorsVmHostPayloadSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Operations_List_MinimumSet_Gen.json */ /** @@ -922,7 +1081,8 @@ public final class OperationsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Operations_List_MaximumSet_Gen.json */ /** @@ -945,7 +1105,8 @@ public final class OperationsListSamples { */ public final class OrganizationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Organizations_List_MinimumSet_Gen.json */ /** @@ -959,7 +1120,8 @@ public final class OrganizationsListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Organizations_List_MaximumSet_Gen.json */ /** @@ -982,7 +1144,8 @@ public final class OrganizationsListSamples { */ public final class PlansListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Plans_List_MaximumSet_Gen.json */ /** @@ -996,7 +1159,8 @@ public final class PlansListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Plans_List_MinimumSet_Gen.json */ /** @@ -1011,6 +1175,36 @@ public final class PlansListSamples { } ``` +### SaaS_ActivateResource + +```java +import com.azure.resourcemanager.newrelicobservability.models.ActivateSaaSParameterRequest; + +/** + * Samples for SaaS ActivateResource. + */ +public final class SaaSActivateResourceSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ActivateSaaS. + * json + */ + /** + * Sample code: ActivateSaaS. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void + activateSaaS(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.saaS() + .activateResourceWithResponse( + new ActivateSaaSParameterRequest().withSaasGuid("00000000-0000-0000-0000-000005430000") + .withPublisherId("publisherId"), + com.azure.core.util.Context.NONE); + } +} +``` + ### TagRules_CreateOrUpdate ```java @@ -1028,7 +1222,8 @@ import java.util.Arrays; */ public final class TagRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_CreateOrUpdate_MaximumSet_Gen.json */ /** @@ -1056,7 +1251,8 @@ public final class TagRulesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_CreateOrUpdate_MinimumSet_Gen.json */ /** @@ -1082,7 +1278,8 @@ public final class TagRulesCreateOrUpdateSamples { */ public final class TagRulesDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Delete_MinimumSet_Gen.json */ /** @@ -1098,7 +1295,8 @@ public final class TagRulesDeleteSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Delete_MaximumSet_Gen.json */ /** @@ -1123,7 +1321,8 @@ public final class TagRulesDeleteSamples { */ public final class TagRulesGetSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Get_MinimumSet_Gen.json */ /** @@ -1139,7 +1338,8 @@ public final class TagRulesGetSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Get_MaximumSet_Gen.json */ /** @@ -1164,7 +1364,8 @@ public final class TagRulesGetSamples { */ public final class TagRulesListByNewRelicMonitorResourceSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json */ /** @@ -1180,7 +1381,8 @@ public final class TagRulesListByNewRelicMonitorResourceSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json */ /** @@ -1215,7 +1417,8 @@ import java.util.Arrays; */ public final class TagRulesUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Update_MaximumSet_Gen.json */ /** @@ -1245,7 +1448,8 @@ public final class TagRulesUpdateSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Update_MinimumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml index 639c2590f2ca..8d4aebe84ea3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for NewRelicObservability Management - This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-01-01. + This package contains Microsoft Azure SDK for NewRelicObservability Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2025-05-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java index 37e31488cc71..065dbe346afe 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/NewRelicObservabilityManager.java @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.NewRelicObservability; import com.azure.resourcemanager.newrelicobservability.implementation.AccountsImpl; @@ -33,6 +34,7 @@ import com.azure.resourcemanager.newrelicobservability.implementation.OperationsImpl; import com.azure.resourcemanager.newrelicobservability.implementation.OrganizationsImpl; import com.azure.resourcemanager.newrelicobservability.implementation.PlansImpl; +import com.azure.resourcemanager.newrelicobservability.implementation.SaaSImpl; import com.azure.resourcemanager.newrelicobservability.implementation.TagRulesImpl; import com.azure.resourcemanager.newrelicobservability.models.Accounts; import com.azure.resourcemanager.newrelicobservability.models.BillingInfoes; @@ -42,11 +44,13 @@ import com.azure.resourcemanager.newrelicobservability.models.Operations; import com.azure.resourcemanager.newrelicobservability.models.Organizations; import com.azure.resourcemanager.newrelicobservability.models.Plans; +import com.azure.resourcemanager.newrelicobservability.models.SaaS; import com.azure.resourcemanager.newrelicobservability.models.TagRules; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -58,6 +62,8 @@ public final class NewRelicObservabilityManager { private Accounts accounts; + private SaaS saaS; + private Monitors monitors; private Organizations organizations; @@ -68,10 +74,10 @@ public final class NewRelicObservabilityManager { private ConnectedPartnerResources connectedPartnerResources; - private TagRules tagRules; - private MonitoredSubscriptions monitoredSubscriptions; + private TagRules tagRules; + private final NewRelicObservability clientObject; private NewRelicObservabilityManager(HttpPipeline httpPipeline, AzureProfile profile, @@ -125,6 +131,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-newrelicobservability.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -232,12 +241,14 @@ public NewRelicObservabilityManager authenticate(TokenCredential credential, Azu Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.newrelicobservability") .append("/") - .append("1.2.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -307,6 +318,18 @@ public Accounts accounts() { return accounts; } + /** + * Gets the resource collection API of SaaS. + * + * @return Resource collection API of SaaS. + */ + public SaaS saaS() { + if (this.saaS == null) { + this.saaS = new SaaSImpl(clientObject.getSaaS(), this); + } + return saaS; + } + /** * Gets the resource collection API of Monitors. It manages NewRelicMonitorResource. * @@ -368,18 +391,6 @@ public ConnectedPartnerResources connectedPartnerResources() { return connectedPartnerResources; } - /** - * Gets the resource collection API of TagRules. It manages TagRule. - * - * @return Resource collection API of TagRules. - */ - public TagRules tagRules() { - if (this.tagRules == null) { - this.tagRules = new TagRulesImpl(clientObject.getTagRules(), this); - } - return tagRules; - } - /** * Gets the resource collection API of MonitoredSubscriptions. It manages MonitoredSubscriptionProperties. * @@ -393,6 +404,18 @@ public MonitoredSubscriptions monitoredSubscriptions() { return monitoredSubscriptions; } + /** + * Gets the resource collection API of TagRules. It manages TagRule. + * + * @return Resource collection API of TagRules. + */ + public TagRules tagRules() { + if (this.tagRules == null) { + this.tagRules = new TagRulesImpl(clientObject.getTagRules(), this); + } + return tagRules; + } + /** * Gets wrapped service client NewRelicObservability providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/AccountsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/AccountsClient.java index c8897603e468..dcb32fb4dbf3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/AccountsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/AccountsClient.java @@ -15,7 +15,8 @@ */ public interface AccountsClient { /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -28,7 +29,8 @@ public interface AccountsClient { PagedIterable list(String userEmail, String location); /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/BillingInfoesClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/BillingInfoesClient.java index 24fbecdcd7ca..c9c0bb41cad3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/BillingInfoesClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/BillingInfoesClient.java @@ -15,7 +15,9 @@ */ public interface BillingInfoesClient { /** - * Get marketplace info mapped to the given monitor. + * Retrieves marketplace and organization information mapped to the given New Relic monitor resource + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -23,20 +25,23 @@ public interface BillingInfoesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return marketplace info mapped to the given monitor along with {@link Response}. + * @return marketplace Subscription and Organization details to which resource gets billed into along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String monitorName, Context context); /** - * Get marketplace info mapped to the given monitor. + * Retrieves marketplace and organization information mapped to the given New Relic monitor resource + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 marketplace info mapped to the given monitor. + * @return marketplace Subscription and Organization details to which resource gets billed into. */ @ServiceMethod(returns = ReturnType.SINGLE) BillingInfoResponseInner get(String resourceGroupName, String monitorName); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/ConnectedPartnerResourcesClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/ConnectedPartnerResourcesClient.java index fdb42682cc57..dc7939712ef0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/ConnectedPartnerResourcesClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/ConnectedPartnerResourcesClient.java @@ -17,6 +17,8 @@ public interface ConnectedPartnerResourcesClient { /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,6 +32,8 @@ public interface ConnectedPartnerResourcesClient { /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param body Email Id of the user. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitoredSubscriptionsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitoredSubscriptionsClient.java index 9363f36ddcc4..cc878c80383c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitoredSubscriptionsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitoredSubscriptionsClient.java @@ -19,20 +19,25 @@ */ public interface MonitoredSubscriptionsClient { /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return paged collection of MonitoredSubscriptionProperties items as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String monitorName); /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -40,14 +45,17 @@ public interface MonitoredSubscriptionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return paged collection of MonitoredSubscriptionProperties items as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String monitorName, Context context); /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -56,15 +64,16 @@ PagedIterable list(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response}. + * @return a MonitoredSubscriptionProperties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String monitorName, ConfigurationName configurationName, Context context); /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -72,14 +81,16 @@ Response getWithResponse(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @return a MonitoredSubscriptionProperties. */ @ServiceMethod(returns = ReturnType.SINGLE) MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monitorName, ConfigurationName configurationName); /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -92,10 +103,12 @@ MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monito */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MonitoredSubscriptionPropertiesInner> - beginCreateorUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName); + beginCreateOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName); /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -110,11 +123,13 @@ MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monito */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, MonitoredSubscriptionPropertiesInner> - beginCreateorUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, + beginCreateOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context); /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -125,11 +140,13 @@ MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monito * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, String monitorName, + MonitoredSubscriptionPropertiesInner createOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName); /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -142,11 +159,14 @@ MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, St * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, String monitorName, + MonitoredSubscriptionPropertiesInner createOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -162,7 +182,10 @@ MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, St beginUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -181,7 +204,10 @@ SyncPoller, MonitoredSubscripti MonitoredSubscriptionPropertiesInner body, Context context); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -196,7 +222,10 @@ MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String mon ConfigurationName configurationName); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -213,7 +242,10 @@ MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String mon ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -228,7 +260,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String ConfigurationName configurationName); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -244,7 +279,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String ConfigurationName configurationName, Context context); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -257,7 +295,10 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java index 549902266fa9..5fdfb8a895da 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java @@ -12,6 +12,7 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LatestLinkedSaaSResponseInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner; @@ -23,8 +24,9 @@ import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; -import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse; import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate; +import com.azure.resourcemanager.newrelicobservability.models.ResubscribeProperties; +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; /** @@ -32,7 +34,7 @@ */ public interface MonitorsClient { /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -43,7 +45,7 @@ public interface MonitorsClient { PagedIterable list(); /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -56,7 +58,7 @@ public interface MonitorsClient { PagedIterable list(Context context); /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -69,7 +71,7 @@ public interface MonitorsClient { PagedIterable listByResourceGroup(String resourceGroupName); /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. @@ -83,7 +85,8 @@ public interface MonitorsClient { PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -91,27 +94,30 @@ public interface MonitorsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 NewRelicMonitorResource along with {@link Response}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, Context context); /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NewRelicMonitorResource. + * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) NewRelicMonitorResourceInner getByResourceGroup(String resourceGroupName, String monitorName); /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -126,7 +132,9 @@ Response getByResourceGroupWithResponse(String res beginCreateOrUpdate(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource); /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -142,7 +150,9 @@ SyncPoller, NewRelicMonitorResourceInne String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context); /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -157,7 +167,9 @@ NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String mon NewRelicMonitorResourceInner resource); /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -173,7 +185,22 @@ NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String mon NewRelicMonitorResourceInner resource, Context context); /** - * Update a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param properties The resource properties to be 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 a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NewRelicMonitorResourceInner> + beginUpdate(String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties); + + /** + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -182,14 +209,14 @@ NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String mon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic along with {@link Response}. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String monitorName, - NewRelicMonitorResourceUpdate properties, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NewRelicMonitorResourceInner> beginUpdate( + String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties, Context context); /** - * Update a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -204,25 +231,43 @@ NewRelicMonitorResourceInner update(String resourceGroupName, String monitorName NewRelicMonitorResourceUpdate properties); /** - * Delete a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param properties The resource properties to be 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 a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NewRelicMonitorResourceInner update(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties, Context context); + + /** + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 userEmail, String monitorName); + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String userEmail); /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -230,38 +275,40 @@ NewRelicMonitorResourceInner update(String resourceGroupName, String monitorName * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String userEmail, String monitorName, + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String userEmail, Context context); /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 userEmail, String monitorName); + void delete(String resourceGroupName, String monitorName, String userEmail); /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 userEmail, String monitorName, Context context); + void delete(String resourceGroupName, String monitorName, String userEmail, Context context); /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -270,14 +317,14 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules along with {@link Response}. + * @return set of rules for sending metrics for the Monitor resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getMetricRulesWithResponse(String resourceGroupName, String monitorName, MetricsRequest request, Context context); /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -285,13 +332,13 @@ Response getMetricRulesWithResponse(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules. + * @return set of rules for sending metrics for the Monitor resource. */ @ServiceMethod(returns = ReturnType.SINGLE) MetricRulesInner getMetricRules(String resourceGroupName, String monitorName, MetricsRequest request); /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -300,14 +347,14 @@ Response getMetricRulesWithResponse(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status along with {@link Response}. + * @return response of get metrics status Operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getMetricStatusWithResponse(String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context); /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -315,76 +362,136 @@ Response getMetricStatusWithResponse(String 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 metric status. + * @return response of get metrics status Operation. */ @ServiceMethod(returns = ReturnType.SINGLE) MetricsStatusResponseInner getMetricStatus(String resourceGroupName, String monitorName, MetricsStatusRequest request); /** - * List the app service resources currently being monitored by the NewRelic resource. + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + * @return response of get latest linked SaaS resource operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppServices(String resourceGroupName, String monitorName, - AppServicesGetRequest request); + @ServiceMethod(returns = ReturnType.SINGLE) + Response latestLinkedSaaSWithResponse(String resourceGroupName, String monitorName, + Context context); /** - * List the app service resources currently being monitored by the NewRelic resource. + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + * @return response of get latest linked SaaS resource operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAppServices(String resourceGroupName, String monitorName, - AppServicesGetRequest request, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + LatestLinkedSaaSResponseInner latestLinkedSaaS(String resourceGroupName, String monitorName); /** - * Switches the billing for NewRelic monitor resource. + * Links a new SaaS to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. + * @param body Link SaaS body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NewRelicMonitorResourceInner> + beginLinkSaaS(String resourceGroupName, String monitorName, SaaSData body); + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body 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 the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NewRelicMonitorResourceInner> + beginLinkSaaS(String resourceGroupName, String monitorName, SaaSData body, Context context); + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - MonitorsSwitchBillingResponse switchBillingWithResponse(String resourceGroupName, String monitorName, - SwitchBillingRequest request, Context context); + NewRelicMonitorResourceInner linkSaaS(String resourceGroupName, String monitorName, SaaSData body); /** - * Switches the billing for NewRelic monitor resource. + * Links a new SaaS to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. + * @param body Link SaaS body 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 a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) - NewRelicMonitorResourceInner switchBilling(String resourceGroupName, String monitorName, - SwitchBillingRequest request); + NewRelicMonitorResourceInner linkSaaS(String resourceGroupName, String monitorName, SaaSData body, Context context); + + /** + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request); /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context); + + /** + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -398,7 +505,8 @@ NewRelicMonitorResourceInner switchBilling(String resourceGroupName, String moni PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request); /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -414,7 +522,38 @@ PagedIterable listHosts(String resourceGroupName, String monitorNam Context context); /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLinkedResources(String resourceGroupName, String monitorName); + + /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listLinkedResources(String resourceGroupName, String monitorName, + Context context); + + /** + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -428,7 +567,8 @@ PagedIterable listHosts(String resourceGroupName, String monitorNam PagedIterable listMonitoredResources(String resourceGroupName, String monitorName); /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -444,35 +584,132 @@ PagedIterable listMonitoredResources(String resourceGrou Context context); /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listLinkedResources(String resourceGroupName, String monitorName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response refreshIngestionKeyWithResponse(String resourceGroupName, String monitorName, Context context); /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void refreshIngestionKey(String resourceGroupName, String monitorName); + + /** + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NewRelicMonitorResourceInner> + beginResubscribe(String resourceGroupName, String monitorName); + + /** + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Resubscribe Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listLinkedResources(String resourceGroupName, String monitorName, + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NewRelicMonitorResourceInner> + beginResubscribe(String resourceGroupName, String monitorName, ResubscribeProperties body, Context context); + + /** + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NewRelicMonitorResourceInner resubscribe(String resourceGroupName, String monitorName); + + /** + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Resubscribe Properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NewRelicMonitorResourceInner resubscribe(String resourceGroupName, String monitorName, ResubscribeProperties body, Context context); /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the switch billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response switchBillingWithResponse(String resourceGroupName, String monitorName, + SwitchBillingRequest request, Context context); + + /** + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the switch billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NewRelicMonitorResourceInner switchBilling(String resourceGroupName, String monitorName, + SwitchBillingRequest request); + + /** + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -487,7 +724,8 @@ Response vmHostPayloadWithResponse(String resourceGroup Context context); /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/NewRelicObservability.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/NewRelicObservability.java index 7e0ff48dea9d..86cba2bb9dd9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/NewRelicObservability.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/NewRelicObservability.java @@ -60,6 +60,13 @@ public interface NewRelicObservability { */ AccountsClient getAccounts(); + /** + * Gets the SaaSClient object to access its operations. + * + * @return the SaaSClient object. + */ + SaaSClient getSaaS(); + /** * Gets the MonitorsClient object to access its operations. * @@ -96,16 +103,16 @@ public interface NewRelicObservability { ConnectedPartnerResourcesClient getConnectedPartnerResources(); /** - * Gets the TagRulesClient object to access its operations. + * Gets the MonitoredSubscriptionsClient object to access its operations. * - * @return the TagRulesClient object. + * @return the MonitoredSubscriptionsClient object. */ - TagRulesClient getTagRules(); + MonitoredSubscriptionsClient getMonitoredSubscriptions(); /** - * Gets the MonitoredSubscriptionsClient object to access its operations. + * Gets the TagRulesClient object to access its operations. * - * @return the MonitoredSubscriptionsClient object. + * @return the TagRulesClient object. */ - MonitoredSubscriptionsClient getMonitoredSubscriptions(); + TagRulesClient getTagRules(); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OrganizationsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OrganizationsClient.java index 491a4703922a..fb94d3ee469e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OrganizationsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/OrganizationsClient.java @@ -15,7 +15,8 @@ */ public interface OrganizationsClient { /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -28,7 +29,8 @@ public interface OrganizationsClient { PagedIterable list(String userEmail, String location); /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/PlansClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/PlansClient.java index 0b27f3e793e2..a32f6ad514e2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/PlansClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/PlansClient.java @@ -15,7 +15,7 @@ */ public interface PlansClient { /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -25,7 +25,7 @@ public interface PlansClient { PagedIterable list(); /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @param accountId Account Id. * @param organizationId Organization Id. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/SaaSClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/SaaSClient.java new file mode 100644 index 000000000000..daa2eb9bbfbe --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/SaaSClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.newrelicobservability.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.newrelicobservability.models.ActivateSaaSParameterRequest; + +/** + * An instance of this class provides access to all the operations defined in SaaSClient. + */ +public interface SaaSClient { + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param request The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response activateResourceWithResponse(ActivateSaaSParameterRequest request, + Context context); + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param request The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SaaSResourceDetailsResponseInner activateResource(ActivateSaaSParameterRequest request); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/TagRulesClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/TagRulesClient.java index e3d1e34d15e1..80a143d06ef8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/TagRulesClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/TagRulesClient.java @@ -19,7 +19,8 @@ */ public interface TagRulesClient { /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -32,7 +33,8 @@ public interface TagRulesClient { PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName); /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -47,7 +49,8 @@ PagedIterable listByNewRelicMonitorResource(String resourceGroupNa Context context); /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -56,14 +59,15 @@ PagedIterable listByNewRelicMonitorResource(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 TagRule along with {@link Response}. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String resourceGroupName, String monitorName, String ruleSetName, Context context); /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -71,13 +75,14 @@ Response getWithResponse(String resourceGroupName, String monitorN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 TagRule. + * @return a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) TagRuleInner get(String resourceGroupName, String monitorName, String ruleSetName); /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -93,7 +98,8 @@ SyncPoller, TagRuleInner> beginCreateOrUpdate(String re String ruleSetName, TagRuleInner resource); /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -110,7 +116,8 @@ SyncPoller, TagRuleInner> beginCreateOrUpdate(String re String ruleSetName, TagRuleInner resource, Context context); /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -126,7 +133,8 @@ TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, String TagRuleInner resource); /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -143,37 +151,43 @@ TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, String Context context); /** - * Delete a TagRule. + * Updates the tag rules for a specific New Relic monitor resource, allowing you to modify the rules that control + * which Azure resources are monitored. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. + * @param properties The resource properties to be 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 long-running operation. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String ruleSetName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties, Context context); /** - * Delete a TagRule. + * Updates the tag rules for a specific New Relic monitor resource, allowing you to modify the rules that control + * which Azure resources are monitored. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param context The context to associate with this operation. + * @param properties The resource properties to be 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 long-running operation. + * @return a tag rule belonging to NewRelic account. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String ruleSetName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + TagRuleInner update(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties); /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -181,12 +195,14 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String monitorName, String ruleSetName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String ruleSetName); /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -195,40 +211,38 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String ruleSetName, + Context context); /** - * Update a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param properties The resource properties to be 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 a tag rule belonging to NewRelic account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String monitorName, String ruleSetName, - TagRuleUpdateInner properties, Context context); + void delete(String resourceGroupName, String monitorName, String ruleSetName); /** - * Update a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param properties The resource properties to be 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 a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagRuleInner update(String resourceGroupName, String monitorName, String ruleSetName, - TagRuleUpdateInner properties); + void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LatestLinkedSaaSResponseInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LatestLinkedSaaSResponseInner.java new file mode 100644 index 000000000000..f8b66e5a312a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LatestLinkedSaaSResponseInner.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response of get latest linked SaaS resource operation. + */ +@Fluent +public final class LatestLinkedSaaSResponseInner implements JsonSerializable { + /* + * SaaS resource id + */ + private String saaSResourceId; + + /* + * Flag indicating if the SaaS resource is hidden + */ + private Boolean isHiddenSaaS; + + /** + * Creates an instance of LatestLinkedSaaSResponseInner class. + */ + public LatestLinkedSaaSResponseInner() { + } + + /** + * Get the saaSResourceId property: SaaS resource id. + * + * @return the saaSResourceId value. + */ + public String saaSResourceId() { + return this.saaSResourceId; + } + + /** + * Set the saaSResourceId property: SaaS resource id. + * + * @param saaSResourceId the saaSResourceId value to set. + * @return the LatestLinkedSaaSResponseInner object itself. + */ + public LatestLinkedSaaSResponseInner withSaaSResourceId(String saaSResourceId) { + this.saaSResourceId = saaSResourceId; + return this; + } + + /** + * Get the isHiddenSaaS property: Flag indicating if the SaaS resource is hidden. + * + * @return the isHiddenSaaS value. + */ + public Boolean isHiddenSaaS() { + return this.isHiddenSaaS; + } + + /** + * Set the isHiddenSaaS property: Flag indicating if the SaaS resource is hidden. + * + * @param isHiddenSaaS the isHiddenSaaS value to set. + * @return the LatestLinkedSaaSResponseInner object itself. + */ + public LatestLinkedSaaSResponseInner withIsHiddenSaaS(Boolean isHiddenSaaS) { + this.isHiddenSaaS = isHiddenSaaS; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("saaSResourceId", this.saaSResourceId); + jsonWriter.writeBooleanField("isHiddenSaaS", this.isHiddenSaaS); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LatestLinkedSaaSResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LatestLinkedSaaSResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LatestLinkedSaaSResponseInner. + */ + public static LatestLinkedSaaSResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LatestLinkedSaaSResponseInner deserializedLatestLinkedSaaSResponseInner + = new LatestLinkedSaaSResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saaSResourceId".equals(fieldName)) { + deserializedLatestLinkedSaaSResponseInner.saaSResourceId = reader.getString(); + } else if ("isHiddenSaaS".equals(fieldName)) { + deserializedLatestLinkedSaaSResponseInner.isHiddenSaaS = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLatestLinkedSaaSResponseInner; + }); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricRulesInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricRulesInner.java index 737bb3631ac9..4ffb4c3dc6c0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricRulesInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricRulesInner.java @@ -30,7 +30,7 @@ public final class MetricRulesInner implements JsonSerializable filteringTags; /* - * User Email + * Reusable representation of an email address */ private String userEmail; @@ -81,7 +81,7 @@ public MetricRulesInner withFilteringTags(List filteringTags) { } /** - * Get the userEmail property: User Email. + * Get the userEmail property: Reusable representation of an email address. * * @return the userEmail value. */ @@ -90,7 +90,7 @@ public String userEmail() { } /** - * Set the userEmail property: User Email. + * Set the userEmail property: Reusable representation of an email address. * * @param userEmail the userEmail value to set. * @return the MetricRulesInner object itself. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitorProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitorProperties.java index 454404c3be46..0946bdf977b8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitorProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitorProperties.java @@ -17,6 +17,7 @@ import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; import com.azure.resourcemanager.newrelicobservability.models.UserInfo; import java.io.IOException; @@ -60,6 +61,11 @@ public final class MonitorProperties implements JsonSerializable { + SaaSResourceDetailsResponseInner deserializedSaaSResourceDetailsResponseInner + = new SaaSResourceDetailsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.type = reader.getString(); + } else if ("saasId".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.saasId = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedSaaSResourceDetailsResponseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSaaSResourceDetailsResponseInner; + }); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsClientImpl.java index 354f27cf8b47..2ad72d769a8e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/AccountsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.AccountsClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner; import com.azure.resourcemanager.newrelicobservability.models.AccountsListResponse; @@ -59,7 +60,7 @@ public final class AccountsClientImpl implements AccountsClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityAccounts") public interface AccountsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/accounts") @@ -70,16 +71,33 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("userEmail") String userEmail, @QueryParam("location") String location, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/accounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("userEmail") String userEmail, @QueryParam("location") String location, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -115,61 +133,63 @@ private Mono> listSinglePageAsync(String use } /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of get all accounts Operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String userEmail, String location, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (userEmail == null) { - return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), userEmail, - location, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String userEmail, String location) { + return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all accounts Operation as paginated response with {@link PagedFlux}. + * @return response of get all accounts Operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String userEmail, String location) { - return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String userEmail, String location) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (userEmail == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), userEmail, location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -177,16 +197,38 @@ private PagedFlux listAsync(String userEmail, String locat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all accounts Operation as paginated response with {@link PagedFlux}. + * @return response of get all accounts Operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String userEmail, String location, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String userEmail, String location, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (userEmail == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), userEmail, location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -197,11 +239,12 @@ private PagedFlux listAsync(String userEmail, String locat */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String userEmail, String location) { - return new PagedIterable<>(listAsync(userEmail, location)); + return new PagedIterable<>(() -> listSinglePage(userEmail, location), nextLink -> listNextSinglePage(nextLink)); } /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -213,7 +256,8 @@ public PagedIterable list(String userEmail, String locatio */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String userEmail, String location, Context context) { - return new PagedIterable<>(listAsync(userEmail, location, context)); + return new PagedIterable<>(() -> listSinglePage(userEmail, location, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -242,6 +286,33 @@ private Mono> listNextSinglePageAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of get all accounts Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -250,22 +321,24 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of get all accounts Operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(AccountsClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesClientImpl.java index 8751c9d24dfd..c9f50bf28e86 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/BillingInfoesClientImpl.java @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.BillingInfoesClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner; import reactor.core.publisher.Mono; @@ -55,7 +56,7 @@ public final class BillingInfoesClientImpl implements BillingInfoesClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityBillingInfoes") public interface BillingInfoesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getBillingInfo") @@ -65,18 +66,29 @@ Mono> get(@HostParam("$host") String endpoint @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getBillingInfo") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); } /** - * Get marketplace info mapped to the given monitor. + * Retrieves marketplace and organization information mapped to the given New Relic monitor resource + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 marketplace info mapped to the given monitor along with {@link Response} on successful completion of - * {@link Mono}. + * @return marketplace Subscription and Organization details to which resource gets billed into along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -104,50 +116,17 @@ private Mono> getWithResponseAsync(String res } /** - * Get marketplace info mapped to the given monitor. + * Retrieves marketplace and organization information mapped to the given New Relic monitor resource * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors 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 marketplace info mapped to the given monitor along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, - 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, accept, context); - } - - /** - * Get marketplace info mapped to the given monitor. + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 marketplace info mapped to the given monitor on successful completion of {@link Mono}. + * @return marketplace Subscription and Organization details to which resource gets billed into on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String monitorName) { @@ -155,7 +134,9 @@ private Mono getAsync(String resourceGroupName, String } /** - * Get marketplace info mapped to the given monitor. + * Retrieves marketplace and organization information mapped to the given New Relic monitor resource + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -163,26 +144,51 @@ private Mono getAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return marketplace info mapped to the given monitor along with {@link Response}. + * @return marketplace Subscription and Organization details to which resource gets billed into along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String monitorName, Context context) { - return getWithResponseAsync(resourceGroupName, monitorName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, context); } /** - * Get marketplace info mapped to the given monitor. + * Retrieves marketplace and organization information mapped to the given New Relic monitor resource + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 marketplace info mapped to the given monitor. + * @return marketplace Subscription and Organization details to which resource gets billed into. */ @ServiceMethod(returns = ReturnType.SINGLE) public BillingInfoResponseInner get(String resourceGroupName, String monitorName) { return getWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(BillingInfoesClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesClientImpl.java index 0d8517e85136..2e46e35bc460 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ConnectedPartnerResourcesClientImpl.java @@ -27,6 +27,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.ConnectedPartnerResourcesClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListResponse; @@ -62,7 +63,7 @@ public final class ConnectedPartnerResourcesClientImpl implements ConnectedPartn * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityConnectedPartnerResources") public interface ConnectedPartnerResourcesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listConnectedPartnerResources") @@ -73,6 +74,15 @@ Mono> list(@HostParam("$host") S @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @BodyParam("application/json") String body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listConnectedPartnerResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") String body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -80,11 +90,21 @@ Mono> list(@HostParam("$host") S Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param body Email Id of the user. @@ -125,57 +145,39 @@ private Mono> listSingle /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param body Email Id of the user. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all active newrelic deployments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of all active newrelic deployments as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String monitorName, String body, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, body, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName, + String body) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, body), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param body Email Id of the user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of all active newrelic deployments as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String monitorName, - String body) { + private PagedFlux listAsync(String resourceGroupName, + String monitorName) { + final String body = null; return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, body), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -183,24 +185,50 @@ private PagedFlux listAsync(String res /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @param body Email Id of the user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all active newrelic deployments as paginated response with {@link PagedFlux}. + * @return list of all active newrelic deployments along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, - String monitorName) { - final String body = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, body), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String monitorName, String body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, body, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param body Email Id of the user. @@ -208,18 +236,42 @@ private PagedFlux listAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all active newrelic deployments as paginated response with {@link PagedFlux}. + * @return list of all active newrelic deployments along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String monitorName, - String body, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, body, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String monitorName, String body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, body, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -230,12 +282,15 @@ private PagedFlux listAsync(String res @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String monitorName) { final String body = null; - return new PagedIterable<>(listAsync(resourceGroupName, monitorName, body)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, monitorName, body), + nextLink -> listNextSinglePage(nextLink)); } /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param body Email Id of the user. @@ -248,10 +303,13 @@ public PagedIterable list(String resou @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String monitorName, String body, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, monitorName, body, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, monitorName, body, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -279,6 +337,37 @@ private Mono> listNextSi } /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all active newrelic deployments along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -286,23 +375,26 @@ private Mono> listNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all active newrelic deployments along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of all active newrelic deployments along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectedPartnerResourcesClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/LatestLinkedSaaSResponseImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/LatestLinkedSaaSResponseImpl.java new file mode 100644 index 000000000000..ab1a1e2a106a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/LatestLinkedSaaSResponseImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.LatestLinkedSaaSResponseInner; +import com.azure.resourcemanager.newrelicobservability.models.LatestLinkedSaaSResponse; + +public final class LatestLinkedSaaSResponseImpl implements LatestLinkedSaaSResponse { + private LatestLinkedSaaSResponseInner innerObject; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + LatestLinkedSaaSResponseImpl(LatestLinkedSaaSResponseInner innerObject, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String saaSResourceId() { + return this.innerModel().saaSResourceId(); + } + + public Boolean isHiddenSaaS() { + return this.innerModel().isHiddenSaaS(); + } + + public LatestLinkedSaaSResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionPropertiesImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionPropertiesImpl.java index 72257cb8dd98..37be0cb7a972 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionPropertiesImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionPropertiesImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.newrelicobservability.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; @@ -32,6 +33,10 @@ public SubscriptionList properties() { return this.innerModel().properties(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String resourceGroupName() { return resourceGroupName; } @@ -59,14 +64,14 @@ public MonitoredSubscriptionPropertiesImpl withExistingMonitor(String resourceGr public MonitoredSubscriptionProperties create() { this.innerObject = serviceManager.serviceClient() .getMonitoredSubscriptions() - .createorUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), Context.NONE); return this; } public MonitoredSubscriptionProperties create(Context context) { this.innerObject = serviceManager.serviceClient() .getMonitoredSubscriptions() - .createorUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), context); + .createOrUpdate(resourceGroupName, monitorName, configurationName, this.innerModel(), context); return this; } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsClientImpl.java index 78b8b8f60490..57fc62716664 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitoredSubscriptionsClientImpl.java @@ -28,8 +28,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.newrelicobservability.fluent.MonitoredSubscriptionsClient; @@ -70,36 +72,65 @@ public final class MonitoredSubscriptionsClientImpl implements MonitoredSubscrip * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityMonitoredSubscriptions") public interface MonitoredSubscriptionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("configurationName") ConfigurationName configurationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("configurationName") ConfigurationName configurationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @PathParam("configurationName") ConfigurationName configurationName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @BodyParam("application/json") MonitoredSubscriptionPropertiesInner body, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createorUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @PathParam("configurationName") ConfigurationName configurationName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") MonitoredSubscriptionPropertiesInner body, @HeaderParam("Accept") String accept, Context context); @@ -108,10 +139,20 @@ Mono>> createorUpdate(@HostParam("$host") String endpo @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("configurationName") ConfigurationName configurationName, + @BodyParam("application/json") MonitoredSubscriptionPropertiesInner body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @PathParam("configurationName") ConfigurationName configurationName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") MonitoredSubscriptionPropertiesInner body, @HeaderParam("Accept") String accept, Context context); @@ -120,10 +161,20 @@ Mono>> update(@HostParam("$host") String endpoint, @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, - @PathParam("configurationName") ConfigurationName configurationName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("configurationName") ConfigurationName configurationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredSubscriptions/{configurationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("configurationName") ConfigurationName configurationName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -132,17 +183,28 @@ Mono>> delete(@HostParam("$host") String endpoint, Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of MonitoredSubscriptionProperties items along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, @@ -164,69 +226,76 @@ private Mono> listSinglePage } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, 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 the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of MonitoredSubscriptionProperties items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of MonitoredSubscriptionProperties items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String monitorName, Context context) { + private PagedResponse listSinglePage(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName 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, monitorName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String monitorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -234,32 +303,60 @@ private PagedFlux listAsync(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return paged collection of MonitoredSubscriptionProperties items along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String monitorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, monitorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return paged collection of MonitoredSubscriptionProperties items as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String monitorName) { - return new PagedIterable<>(listAsync(resourceGroupName, monitorName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, monitorName), + nextLink -> listNextSinglePage(nextLink)); } /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -267,16 +364,20 @@ public PagedIterable list(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return paged collection of MonitoredSubscriptionProperties items as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String monitorName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, monitorName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, monitorName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -284,8 +385,7 @@ public PagedIterable list(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response} on successful completion of {@link Mono}. + * @return a MonitoredSubscriptionProperties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, @@ -311,54 +411,15 @@ private Mono> getWithResponseAsyn } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, configurationName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param configurationName The configuration name. Only 'default' value is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String monitorName, ConfigurationName configurationName, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName 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, monitorName, - configurationName, this.client.getApiVersion(), accept, context); - } - - /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Get a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -366,8 +427,7 @@ private Mono> getWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful - * completion of {@link Mono}. + * @return a MonitoredSubscriptionProperties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String monitorName, @@ -377,7 +437,9 @@ private Mono getAsync(String resourceGroup } /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -386,17 +448,42 @@ private Mono getAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response}. + * @return a MonitoredSubscriptionProperties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String monitorName, ConfigurationName configurationName, Context context) { - return getWithResponseAsync(resourceGroupName, monitorName, configurationName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, configurationName, accept, context); } /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -404,7 +491,7 @@ public Response getWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @return a MonitoredSubscriptionProperties. */ @ServiceMethod(returns = ReturnType.SINGLE) public MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monitorName, @@ -413,7 +500,9 @@ public MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -426,7 +515,7 @@ public MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createorUpdateWithResponseAsync(String resourceGroupName, + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -452,13 +541,65 @@ private Mono>> createorUpdateWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createorUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, configurationName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, body, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The body 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 request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, body, accept, + Context.NONE); + } + + /** + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -469,42 +610,45 @@ private Mono>> createorUpdateWithResponseAsync(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createorUpdateWithResponseAsync(String resourceGroupName, - String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, - Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createorUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - monitorName, configurationName, this.client.getApiVersion(), body, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, body, accept, context); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -518,17 +662,19 @@ private Mono>> createorUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MonitoredSubscriptionPropertiesInner> - beginCreateorUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, + beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { Mono>> mono - = createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); return this.client.getLroResult( mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, MonitoredSubscriptionPropertiesInner.class, this.client.getContext()); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -541,43 +687,45 @@ private Mono>> createorUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, MonitoredSubscriptionPropertiesInner> - beginCreateorUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName) { final MonitoredSubscriptionPropertiesInner body = null; Mono>> mono - = createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); + = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body); return this.client.getLroResult( mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, MonitoredSubscriptionPropertiesInner.class, this.client.getContext()); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param configurationName The configuration name. Only 'default' value is supported. * @param body The body parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the * NewRelic monitor resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MonitoredSubscriptionPropertiesInner> - beginCreateorUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, - MonitoredSubscriptionPropertiesInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createorUpdateWithResponseAsync(resourceGroupName, monitorName, configurationName, body, context); + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginCreateOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body) { + Response response + = createOrUpdateWithResponse(resourceGroupName, monitorName, configurationName, body); return this.client.getLroResult( - mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, - MonitoredSubscriptionPropertiesInner.class, context); + response, MonitoredSubscriptionPropertiesInner.class, MonitoredSubscriptionPropertiesInner.class, + Context.NONE); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -590,13 +738,19 @@ private Mono>> createorUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MonitoredSubscriptionPropertiesInner> - beginCreateorUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName) { + beginCreateOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName) { final MonitoredSubscriptionPropertiesInner body = null; - return this.beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, monitorName, configurationName, body); + return this.client.getLroResult( + response, MonitoredSubscriptionPropertiesInner.class, MonitoredSubscriptionPropertiesInner.class, + Context.NONE); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -611,14 +765,18 @@ private Mono>> createorUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, MonitoredSubscriptionPropertiesInner> - beginCreateorUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, + beginCreateOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { - return this.beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, monitorName, configurationName, body, context); + return this.client.getLroResult( + response, MonitoredSubscriptionPropertiesInner.class, MonitoredSubscriptionPropertiesInner.class, context); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -631,14 +789,16 @@ private Mono>> createorUpdateWithResponseAsync(String * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createorUpdateAsync(String resourceGroupName, String monitorName, + private Mono createOrUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { - return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body).last() + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, configurationName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -650,36 +810,17 @@ private Mono createorUpdateAsync(String re * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createorUpdateAsync(String resourceGroupName, String monitorName, + private Mono createOrUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName) { final MonitoredSubscriptionPropertiesInner body = null; - return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body).last() + return beginCreateOrUpdateAsync(resourceGroupName, monitorName, configurationName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param configurationName The configuration name. Only 'default' value is supported. - * @param body The body 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 request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createorUpdateAsync(String resourceGroupName, String monitorName, - ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { - return beginCreateorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -690,14 +831,16 @@ private Mono createorUpdateAsync(String re * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, String monitorName, + public MonitoredSubscriptionPropertiesInner createOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName) { final MonitoredSubscriptionPropertiesInner body = null; - return createorUpdateAsync(resourceGroupName, monitorName, configurationName, body).block(); + return beginCreateOrUpdate(resourceGroupName, monitorName, configurationName, body).getFinalResult(); } /** - * Add the subscriptions that should be monitored by the NewRelic monitor resource. + * Add subscriptions to be monitored by the New Relic monitor resource, enabling observability and monitoring. + * + * Create a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -710,13 +853,16 @@ public MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupN * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, String monitorName, + public MonitoredSubscriptionPropertiesInner createOrUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { - return createorUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).block(); + return beginCreateOrUpdate(resourceGroupName, monitorName, configurationName, body, context).getFinalResult(); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -754,14 +900,66 @@ private Mono>> updateWithResponseAsync(String resource body.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, configurationName, this.client.getApiVersion(), body, accept, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param configurationName The configuration name. Only 'default' value is supported. + * @param body The body 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 request to update subscriptions needed to be monitored by the NewRelic monitor resource along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, body, accept, + Context.NONE); + } + + /** + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -772,41 +970,46 @@ private Mono>> updateWithResponseAsync(String resource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response} on successful completion of {@link Mono}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String monitorName, + private Response updateWithResponse(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - monitorName, configurationName, this.client.getApiVersion(), body, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, body, accept, context); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -830,7 +1033,10 @@ private Mono>> updateWithResponseAsync(String resource } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -853,33 +1059,36 @@ private Mono>> updateWithResponseAsync(String resource } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param configurationName The configuration name. Only 'default' value is supported. * @param body The body parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the request to update subscriptions needed to be monitored by the + * @return the {@link SyncPoller} for polling of the request to update subscriptions needed to be monitored by the * NewRelic monitor resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MonitoredSubscriptionPropertiesInner> - beginUpdateAsync(String resourceGroupName, String monitorName, ConfigurationName configurationName, - MonitoredSubscriptionPropertiesInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, monitorName, configurationName, body, context); + public SyncPoller, MonitoredSubscriptionPropertiesInner> + beginUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, + MonitoredSubscriptionPropertiesInner body) { + Response response = updateWithResponse(resourceGroupName, monitorName, configurationName, body); return this.client.getLroResult( - mono, this.client.getHttpPipeline(), MonitoredSubscriptionPropertiesInner.class, - MonitoredSubscriptionPropertiesInner.class, context); + response, MonitoredSubscriptionPropertiesInner.class, MonitoredSubscriptionPropertiesInner.class, + Context.NONE); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -894,11 +1103,17 @@ private Mono>> updateWithResponseAsync(String resource public SyncPoller, MonitoredSubscriptionPropertiesInner> beginUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName) { final MonitoredSubscriptionPropertiesInner body = null; - return this.beginUpdateAsync(resourceGroupName, monitorName, configurationName, body).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, monitorName, configurationName, body); + return this.client.getLroResult( + response, MonitoredSubscriptionPropertiesInner.class, MonitoredSubscriptionPropertiesInner.class, + Context.NONE); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -915,11 +1130,17 @@ private Mono>> updateWithResponseAsync(String resource public SyncPoller, MonitoredSubscriptionPropertiesInner> beginUpdate(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { - return this.beginUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, monitorName, configurationName, body, context); + return this.client.getLroResult( + response, MonitoredSubscriptionPropertiesInner.class, MonitoredSubscriptionPropertiesInner.class, context); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -939,7 +1160,10 @@ private Mono updateAsync(String resourceGr } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -959,28 +1183,10 @@ private Mono updateAsync(String resourceGr } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param configurationName The configuration name. Only 'default' value is supported. - * @param body The body 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 request to update subscriptions needed to be monitored by the NewRelic monitor resource on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String monitorName, - ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { - return beginUpdateAsync(resourceGroupName, monitorName, configurationName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -994,11 +1200,14 @@ private Mono updateAsync(String resourceGr public MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String monitorName, ConfigurationName configurationName) { final MonitoredSubscriptionPropertiesInner body = null; - return updateAsync(resourceGroupName, monitorName, configurationName, body).block(); + return beginUpdate(resourceGroupName, monitorName, configurationName, body).getFinalResult(); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Update subscriptions to be monitored by the New Relic monitor resource, ensuring optimal observability and + * performance + * + * Update a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1013,11 +1222,14 @@ public MonitoredSubscriptionPropertiesInner update(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String monitorName, ConfigurationName configurationName, MonitoredSubscriptionPropertiesInner body, Context context) { - return updateAsync(resourceGroupName, monitorName, configurationName, body, context).block(); + return beginUpdate(resourceGroupName, monitorName, configurationName, body, context).getFinalResult(); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1051,78 +1263,109 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, configurationName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param configurationName The configuration name. Only 'default' value is supported. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, - ConfigurationName configurationName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName 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, - monitorName, configurationName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, accept, Context.NONE); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param configurationName The configuration name. Only 'default' value is supported. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, - ConfigurationName configurationName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, monitorName, configurationName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String monitorName, + ConfigurationName configurationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, configurationName, accept, context); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param configurationName The configuration name. Only 'default' value is supported. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1130,16 +1373,18 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, - ConfigurationName configurationName, Context context) { - context = this.client.mergeContext(context); + ConfigurationName configurationName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, monitorName, configurationName, context); + = deleteWithResponseAsync(resourceGroupName, monitorName, configurationName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1152,11 +1397,15 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, ConfigurationName configurationName) { - return this.beginDeleteAsync(resourceGroupName, monitorName, configurationName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, monitorName, configurationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1170,11 +1419,15 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, ConfigurationName configurationName, Context context) { - return this.beginDeleteAsync(resourceGroupName, monitorName, configurationName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, monitorName, configurationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1191,26 +1444,10 @@ private Mono deleteAsync(String resourceGroupName, String monitorName, Con } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param configurationName The configuration name. Only 'default' value is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 monitorName, ConfigurationName configurationName, - Context context) { - return beginDeleteAsync(resourceGroupName, monitorName, configurationName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1221,11 +1458,14 @@ private Mono deleteAsync(String resourceGroupName, String monitorName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName) { - deleteAsync(resourceGroupName, monitorName, configurationName).block(); + beginDelete(resourceGroupName, monitorName, configurationName).getFinalResult(); } /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1238,17 +1478,20 @@ public void delete(String resourceGroupName, String monitorName, ConfigurationNa @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName, Context context) { - deleteAsync(resourceGroupName, monitorName, configurationName, context).block(); + beginDelete(resourceGroupName, monitorName, configurationName, context).getFinalResult(); } /** + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of MonitoredSubscriptionProperties items along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1267,6 +1510,37 @@ private Mono> listNextSingle } /** + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of MonitoredSubscriptionProperties items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1274,22 +1548,25 @@ private Mono> listNextSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return paged collection of MonitoredSubscriptionProperties items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(MonitoredSubscriptionsClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java index 4c2acd40e870..0e781c872313 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java @@ -29,12 +29,15 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.newrelicobservability.fluent.MonitorsClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LatestLinkedSaaSResponseInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner; @@ -49,9 +52,10 @@ import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; import com.azure.resourcemanager.newrelicobservability.models.MonitoredResourceListResponse; -import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse; import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceListResult; import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate; +import com.azure.resourcemanager.newrelicobservability.models.ResubscribeProperties; +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; import com.azure.resourcemanager.newrelicobservability.models.VMHostsListResponse; import java.nio.ByteBuffer; @@ -87,7 +91,7 @@ public final class MonitorsClientImpl implements MonitorsClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityMonitors") public interface MonitorsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/monitors") @@ -97,6 +101,14 @@ Mono> list(@HostParam("$host") Strin @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/monitors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors") @ExpectedResponses({ 200 }) @@ -106,6 +118,15 @@ Mono> listByResourceGroup(@HostParam @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") @ExpectedResponses({ 200 }) @@ -115,6 +136,15 @@ Mono> getByResourceGroup(@HostParam("$hos @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") @ExpectedResponses({ 200, 201 }) @@ -125,11 +155,31 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") NewRelicMonitorResourceInner resource, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") NewRelicMonitorResourceInner resource, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") - @ExpectedResponses({ 200 }) + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") NewRelicMonitorResourceUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @BodyParam("application/json") NewRelicMonitorResourceUpdate properties, @@ -141,8 +191,17 @@ Mono> update(@HostParam("$host") String e @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("userEmail") String userEmail, - @PathParam("monitorName") String monitorName, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @QueryParam("userEmail") String userEmail, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @QueryParam("userEmail") String userEmail, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getMetricRules") @@ -154,6 +213,16 @@ Mono> getMetricRules(@HostParam("$host") String endpo @BodyParam("application/json") MetricsRequest request, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getMetricRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getMetricRulesSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") MetricsRequest request, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getMetricStatus") @ExpectedResponses({ 200 }) @@ -164,6 +233,52 @@ Mono> getMetricStatus(@HostParam("$host") S @BodyParam("application/json") MetricsStatusRequest request, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getMetricStatus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getMetricStatusSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") MetricsStatusRequest request, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/latestLinkedSaaS") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> latestLinkedSaaS(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/latestLinkedSaaS") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response latestLinkedSaaSSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/linkSaaS") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> linkSaaS(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") SaaSData body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/linkSaaS") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response linkSaaSSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") SaaSData body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listAppServices") @ExpectedResponses({ 200 }) @@ -175,13 +290,13 @@ Mono> listAppServices(@HostParam("$host") Stri Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/switchBilling") - @ExpectedResponses({ 200, 202, 204 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listAppServices") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono switchBilling(@HostParam("$host") String endpoint, + Response listAppServicesSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, - @BodyParam("application/json") SwitchBillingRequest request, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AppServicesGetRequest request, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -194,6 +309,34 @@ Mono> listHosts(@HostParam("$host") String endpoin @BodyParam("application/json") HostsGetRequest request, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listHosts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listHostsSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") HostsGetRequest request, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listLinkedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLinkedResources(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listLinkedResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listLinkedResourcesSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredResources") @ExpectedResponses({ 200 }) @@ -204,13 +347,71 @@ Mono> listMonitoredResources(@HostParam( @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listLinkedResources") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/monitoredResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listLinkedResources(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listMonitoredResourcesSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/refreshIngestionKey") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> refreshIngestionKey(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/refreshIngestionKey") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response refreshIngestionKeySync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/resubscribe") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resubscribe(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") ResubscribeProperties body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/resubscribe") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resubscribeSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") ResubscribeProperties body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/switchBilling") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> switchBilling(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @BodyParam("application/json") SwitchBillingRequest request, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/switchBilling") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response switchBillingSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @BodyParam("application/json") SwitchBillingRequest request, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/vmHostPayloads") @@ -221,6 +422,15 @@ Mono> vmHostPayload(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/vmHostPayloads") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response vmHostPayloadSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -229,6 +439,14 @@ Mono> listBySubscriptionNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -237,6 +455,14 @@ Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -245,6 +471,14 @@ Mono> listAppServicesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAppServicesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -253,6 +487,29 @@ Mono> listHostsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listHostsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLinkedResourcesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listLinkedResourcesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -265,13 +522,13 @@ Mono> listMonitoredResourcesNext( @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listLinkedResourcesNext( + Response listMonitoredResourcesNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -298,36 +555,7 @@ private Mono> listSinglePageAsync() } /** - * List NewRelicMonitorResource resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -340,35 +568,74 @@ private PagedFlux listAsync() { } /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}. + * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with - * {@link PagedIterable}. + * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all New Relic monitor resources either within a specific subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NewRelicMonitorResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -379,11 +646,12 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -417,74 +685,88 @@ public PagedIterable list(Context context) { } /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}. + * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}. + * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -495,11 +777,12 @@ private PagedFlux listByResourceGroupAsync(String */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. @@ -511,18 +794,20 @@ public PagedIterable listByResourceGroup(String re */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NewRelicMonitorResource along with {@link Response} on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, @@ -550,49 +835,15 @@ private Mono> getByResourceGroupWithRespo } /** - * Get a NewRelicMonitorResource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NewRelicMonitorResource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String monitorName, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); - } - - /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NewRelicMonitorResource on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String monitorName) { @@ -601,7 +852,8 @@ private Mono getByResourceGroupAsync(String resour } /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -609,23 +861,44 @@ private Mono getByResourceGroupAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 NewRelicMonitorResource along with {@link Response}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); } /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NewRelicMonitorResource. + * @return a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.SINGLE) public NewRelicMonitorResourceInner getByResourceGroup(String resourceGroupName, String monitorName) { @@ -633,7 +906,9 @@ public NewRelicMonitorResourceInner getByResourceGroup(String resourceGroupName, } /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -674,92 +949,123 @@ private Mono>> createOrUpdateWithResponseAsync(String } /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String monitorName, NewRelicMonitorResourceInner resource, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String monitorName, + NewRelicMonitorResourceInner resource) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); } else { resource.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, resource, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, resource, accept, Context.NONE); } /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a Monitor Resource by NewRelic. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NewRelicMonitorResourceInner> - beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String monitorName, + NewRelicMonitorResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, resource, accept, context); } /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of a Monitor Resource by NewRelic. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NewRelicMonitorResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) { - context = this.client.mergeContext(context); + private PollerFlux, NewRelicMonitorResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource, context); + = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, - context); + this.client.getContext()); } /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -772,11 +1078,15 @@ private PollerFlux, NewRelicMonitorReso @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NewRelicMonitorResourceInner> beginCreateOrUpdate(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, monitorName, resource); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, Context.NONE); } /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -790,11 +1100,15 @@ private PollerFlux, NewRelicMonitorReso @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NewRelicMonitorResourceInner> beginCreateOrUpdate( String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, monitorName, resource, context); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, context); } /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -812,26 +1126,9 @@ private Mono createOrUpdateAsync(String resourceGr } /** - * Create a NewRelicMonitorResource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String monitorName, - NewRelicMonitorResourceInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -844,11 +1141,13 @@ private Mono createOrUpdateAsync(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) public NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) { - return createOrUpdateAsync(resourceGroupName, monitorName, resource).block(); + return beginCreateOrUpdate(resourceGroupName, monitorName, resource).getFinalResult(); } /** - * Create a NewRelicMonitorResource. + * Creates a new or updates an existing New Relic monitor resource in your Azure subscription. This sets up the + * integration between Azure and your New Relic account, enabling observability and monitoring of your Azure + * resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -862,11 +1161,11 @@ public NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, monitorName, resource, context).block(); + return beginCreateOrUpdate(resourceGroupName, monitorName, resource, context).getFinalResult(); } /** - * Update a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -877,8 +1176,8 @@ public NewRelicMonitorResourceInner createOrUpdate(String resourceGroupName, Str * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String monitorName, NewRelicMonitorResourceUpdate properties) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -907,84 +1206,114 @@ private Mono> updateWithResponseAsync(Str } /** - * Update a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be 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 a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String monitorName, NewRelicMonitorResourceUpdate properties, Context context) { + private Response updateWithResponse(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { properties.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, properties, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, properties, accept, Context.NONE); } /** - * Update a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be 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 a Monitor Resource by NewRelic on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String monitorName, - NewRelicMonitorResourceUpdate properties) { - return updateWithResponseAsync(resourceGroupName, monitorName, properties) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Response updateWithResponse(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, properties, accept, context); } /** - * Update a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param properties The resource properties to be 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 a Monitor Resource by NewRelic along with {@link Response}. + * @return the {@link PollerFlux} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String monitorName, - NewRelicMonitorResourceUpdate properties, Context context) { - return updateWithResponseAsync(resourceGroupName, monitorName, properties, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NewRelicMonitorResourceInner> + beginUpdateAsync(String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, monitorName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, + this.client.getContext()); } /** - * Update a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -992,68 +1321,104 @@ public Response updateWithResponse(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Monitor Resource by NewRelic. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NewRelicMonitorResourceInner update(String resourceGroupName, String monitorName, - NewRelicMonitorResourceUpdate properties) { - return updateWithResponse(resourceGroupName, monitorName, properties, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NewRelicMonitorResourceInner> + beginUpdate(String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties) { + Response response = updateWithResponse(resourceGroupName, monitorName, properties); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, Context.NONE); } /** - * Delete a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param properties The resource properties to be 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 Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String userEmail, - String monitorName) { - 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 (userEmail == null) { - return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); - } - if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, userEmail, monitorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NewRelicMonitorResourceInner> beginUpdate( + String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties, Context context) { + Response response = updateWithResponse(resourceGroupName, monitorName, properties, context); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, context); } /** - * Delete a NewRelicMonitorResource. + * Updates an existing New Relic monitor resource from your Azure subscription. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. + * @param properties The resource properties to be 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 Response} on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String userEmail, - String monitorName, Context context) { + private Mono updateAsync(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties) { + return beginUpdateAsync(resourceGroupName, monitorName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing New Relic monitor resource from your Azure subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param properties The resource properties to be 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 a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NewRelicMonitorResourceInner update(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties) { + return beginUpdate(resourceGroupName, monitorName, properties).getFinalResult(); + } + + /** + * Updates an existing New Relic monitor resource from your Azure subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param properties The resource properties to be 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 a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NewRelicMonitorResourceInner update(String resourceGroupName, String monitorName, + NewRelicMonitorResourceUpdate properties, Context context) { + return beginUpdate(resourceGroupName, monitorName, properties, context).getFinalResult(); + } + + /** + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 monitorName, + String userEmail) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1066,162 +1431,215 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (userEmail == null) { - return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); - } if (monitorName == null) { return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } + if (userEmail == null) { + return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); + } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, userEmail, monitorName, accept, context); + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, userEmail, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String userEmail, - String monitorName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, userEmail, monitorName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String monitorName, String userEmail) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (userEmail == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, userEmail, accept, Context.NONE); } /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String userEmail, - String monitorName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, userEmail, monitorName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String monitorName, String userEmail, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (userEmail == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, userEmail, accept, context); } /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String userEmail, - String monitorName) { - return this.beginDeleteAsync(resourceGroupName, userEmail, monitorName).getSyncPoller(); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, + String userEmail) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName, userEmail); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. + * @param userEmail User Email. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 userEmail, - String monitorName, Context context) { - return this.beginDeleteAsync(resourceGroupName, userEmail, monitorName, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + String userEmail) { + Response response = deleteWithResponse(resourceGroupName, monitorName, userEmail); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String userEmail, String monitorName) { - return beginDeleteAsync(resourceGroupName, userEmail, monitorName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + String userEmail, Context context) { + Response response = deleteWithResponse(resourceGroupName, monitorName, userEmail, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. + * @param userEmail User Email. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 userEmail, String monitorName, Context context) { - return beginDeleteAsync(resourceGroupName, userEmail, monitorName, context).last() + private Mono deleteAsync(String resourceGroupName, String monitorName, String userEmail) { + return beginDeleteAsync(resourceGroupName, monitorName, userEmail).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 userEmail, String monitorName) { - deleteAsync(resourceGroupName, userEmail, monitorName).block(); + public void delete(String resourceGroupName, String monitorName, String userEmail) { + beginDelete(resourceGroupName, monitorName, userEmail).getFinalResult(); } /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 userEmail, String monitorName, Context context) { - deleteAsync(resourceGroupName, userEmail, monitorName, context).block(); + public void delete(String resourceGroupName, String monitorName, String userEmail, Context context) { + beginDelete(resourceGroupName, monitorName, userEmail, context).getFinalResult(); } /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1229,7 +1647,8 @@ public void delete(String resourceGroupName, String userEmail, String monitorNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules along with {@link Response} on successful completion of {@link Mono}. + * @return set of rules for sending metrics for the Monitor resource along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getMetricRulesWithResponseAsync(String resourceGroupName, @@ -1262,48 +1681,7 @@ private Mono> getMetricRulesWithResponseAsync(String } /** - * Get metric rules. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param request The details of the get metrics status request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMetricRulesWithResponseAsync(String resourceGroupName, - String monitorName, MetricsRequest request, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getMetricRules(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); - } - - /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1311,7 +1689,7 @@ private Mono> getMetricRulesWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules on successful completion of {@link Mono}. + * @return set of rules for sending metrics for the Monitor resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getMetricRulesAsync(String resourceGroupName, String monitorName, @@ -1321,7 +1699,7 @@ private Mono getMetricRulesAsync(String resourceGroupName, Str } /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1330,16 +1708,42 @@ private Mono getMetricRulesAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules along with {@link Response}. + * @return set of rules for sending metrics for the Monitor resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getMetricRulesWithResponse(String resourceGroupName, String monitorName, MetricsRequest request, Context context) { - return getMetricRulesWithResponseAsync(resourceGroupName, monitorName, request, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return service.getMetricRulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); } /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1347,7 +1751,7 @@ public Response getMetricRulesWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules. + * @return set of rules for sending metrics for the Monitor resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public MetricRulesInner getMetricRules(String resourceGroupName, String monitorName, MetricsRequest request) { @@ -1355,7 +1759,7 @@ public MetricRulesInner getMetricRules(String resourceGroupName, String monitorN } /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1363,7 +1767,8 @@ public MetricRulesInner getMetricRules(String resourceGroupName, String monitorN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status along with {@link Response} on successful completion of {@link Mono}. + * @return response of get metrics status Operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getMetricStatusWithResponseAsync(String resourceGroupName, @@ -1396,48 +1801,7 @@ private Mono> getMetricStatusWithResponseAs } /** - * Get metric status. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param request The details of the get metrics status request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMetricStatusWithResponseAsync(String resourceGroupName, - String monitorName, MetricsStatusRequest request, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getMetricStatus(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); - } - - /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1445,7 +1809,7 @@ private Mono> getMetricStatusWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status on successful completion of {@link Mono}. + * @return response of get metrics status Operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getMetricStatusAsync(String resourceGroupName, String monitorName, @@ -1455,7 +1819,7 @@ private Mono getMetricStatusAsync(String resourceGro } /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1464,16 +1828,42 @@ private Mono getMetricStatusAsync(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status along with {@link Response}. + * @return response of get metrics status Operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getMetricStatusWithResponse(String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context) { - return getMetricStatusWithResponseAsync(resourceGroupName, monitorName, request, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return service.getMetricStatusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); } /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -1481,7 +1871,7 @@ public Response getMetricStatusWithResponse(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status. + * @return response of get metrics status Operation. */ @ServiceMethod(returns = ReturnType.SINGLE) public MetricsStatusResponseInner getMetricStatus(String resourceGroupName, String monitorName, @@ -1490,20 +1880,19 @@ public MetricsStatusResponseInner getMetricStatus(String resourceGroupName, Stri } /** - * List the app service resources currently being monitored by the NewRelic resource. + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of get latest linked SaaS resource operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicesSinglePageAsync(String resourceGroupName, - String monitorName, AppServicesGetRequest request) { + private Mono> latestLinkedSaaSWithResponseAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1519,45 +1908,540 @@ private Mono> listAppServicesSinglePageAsync( if (monitorName == null) { return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAppServices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.latestLinkedSaaS(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List the app service resources currently being monitored by the NewRelic resource. + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of get latest linked SaaS resource operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicesSinglePageAsync(String resourceGroupName, - String monitorName, AppServicesGetRequest request, 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) { + private Mono latestLinkedSaaSAsync(String resourceGroupName, String monitorName) { + return latestLinkedSaaSWithResponseAsync(resourceGroupName, monitorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of get latest linked SaaS resource operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response latestLinkedSaaSWithResponse(String resourceGroupName, + String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.latestLinkedSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); + } + + /** + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of get latest linked SaaS resource operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LatestLinkedSaaSResponseInner latestLinkedSaaS(String resourceGroupName, String monitorName) { + return latestLinkedSaaSWithResponse(resourceGroupName, monitorName, Context.NONE).getValue(); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body 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 a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> linkSaaSWithResponseAsync(String resourceGroupName, String monitorName, + SaaSData body) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.linkSaaS(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body 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 a Monitor Resource by NewRelic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response linkSaaSWithResponse(String resourceGroupName, String monitorName, SaaSData body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.linkSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, body, accept, Context.NONE); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response linkSaaSWithResponse(String resourceGroupName, String monitorName, SaaSData body, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.linkSaaSSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, body, accept, context); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body 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 {@link PollerFlux} for polling of a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NewRelicMonitorResourceInner> + beginLinkSaaSAsync(String resourceGroupName, String monitorName, SaaSData body) { + Mono>> mono = linkSaaSWithResponseAsync(resourceGroupName, monitorName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, + this.client.getContext()); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body 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 {@link SyncPoller} for polling of a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NewRelicMonitorResourceInner> + beginLinkSaaS(String resourceGroupName, String monitorName, SaaSData body) { + Response response = linkSaaSWithResponse(resourceGroupName, monitorName, body); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, Context.NONE); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NewRelicMonitorResourceInner> + beginLinkSaaS(String resourceGroupName, String monitorName, SaaSData body, Context context) { + Response response = linkSaaSWithResponse(resourceGroupName, monitorName, body, context); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, context); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body 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 a Monitor Resource by NewRelic on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono linkSaaSAsync(String resourceGroupName, String monitorName, + SaaSData body) { + return beginLinkSaaSAsync(resourceGroupName, monitorName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body 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 a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NewRelicMonitorResourceInner linkSaaS(String resourceGroupName, String monitorName, SaaSData body) { + return beginLinkSaaS(resourceGroupName, monitorName, body).getFinalResult(); + } + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Link SaaS body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NewRelicMonitorResourceInner linkSaaS(String resourceGroupName, String monitorName, SaaSData body, + Context context) { + return beginLinkSaaS(resourceGroupName, monitorName, body, context).getFinalResult(); + } + + /** + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAppServicesSinglePageAsync(String resourceGroupName, + String monitorName, AppServicesGetRequest request) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAppServices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAppServicesAsync(String resourceGroupName, String monitorName, + AppServicesGetRequest request) { + return new PagedFlux<>(() -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request), + nextLink -> listAppServicesNextSinglePageAsync(nextLink)); + } + + /** + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAppServicesSinglePage(String resourceGroupName, String monitorName, + AppServicesGetRequest request) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + Response res + = service.listAppServicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAppServicesSinglePage(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + Response res + = service.listAppServicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request) { + return new PagedIterable<>(() -> listAppServicesSinglePage(resourceGroupName, monitorName, request), + nextLink -> listAppServicesNextSinglePage(nextLink)); + } + + /** + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context) { + return new PagedIterable<>(() -> listAppServicesSinglePage(resourceGroupName, monitorName, request, context), + nextLink -> listAppServicesNextSinglePage(nextLink, context)); + } + + /** + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the Hosts get request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listHostsSinglePageAsync(String resourceGroupName, String monitorName, + HostsGetRequest request) { + 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.")); } @@ -1570,100 +2454,180 @@ private Mono> listAppServicesSinglePageAsync( request.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAppServices(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, request, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return FluxUtil + .withContext(context -> service.listHosts(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, 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 the app service resources currently being monitored by the NewRelic resource. + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. + * @param request The details of the Hosts get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedFlux}. + * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAppServicesAsync(String resourceGroupName, String monitorName, - AppServicesGetRequest request) { - return new PagedFlux<>(() -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request), - nextLink -> listAppServicesNextSinglePageAsync(nextLink)); + private PagedFlux listHostsAsync(String resourceGroupName, String monitorName, + HostsGetRequest request) { + return new PagedFlux<>(() -> listHostsSinglePageAsync(resourceGroupName, monitorName, request), + nextLink -> listHostsNextSinglePageAsync(nextLink)); } /** - * List the app service resources currently being monitored by the NewRelic resource. + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. + * @param request The details of the Hosts get request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listHostsSinglePage(String resourceGroupName, String monitorName, + HostsGetRequest request) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + Response res + = service.listHostsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the Hosts get request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedFlux}. + * @return response of a list VM Host Operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAppServicesAsync(String resourceGroupName, String monitorName, - AppServicesGetRequest request, Context context) { - return new PagedFlux<>(() -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request, context), - nextLink -> listAppServicesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listHostsSinglePage(String resourceGroupName, String monitorName, + HostsGetRequest request, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + Response res + = service.listHostsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List the app service resources currently being monitored by the NewRelic resource. + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. + * @param request The details of the Hosts get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppServices(String resourceGroupName, String monitorName, - AppServicesGetRequest request) { - return new PagedIterable<>(listAppServicesAsync(resourceGroupName, monitorName, request)); + public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) { + return new PagedIterable<>(() -> listHostsSinglePage(resourceGroupName, monitorName, request), + nextLink -> listHostsNextSinglePage(nextLink)); } /** - * List the app service resources currently being monitored by the NewRelic resource. + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. + * @param request The details of the Hosts get request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAppServices(String resourceGroupName, String monitorName, - AppServicesGetRequest request, Context context) { - return new PagedIterable<>(listAppServicesAsync(resourceGroupName, monitorName, request, context)); + public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request, + Context context) { + return new PagedIterable<>(() -> listHostsSinglePage(resourceGroupName, monitorName, request, context), + nextLink -> listHostsNextSinglePage(nextLink, context)); } /** - * Switches the billing for NewRelic monitor resource. + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Monitor Resource by NewRelic on successful completion of {@link Mono}. + * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono switchBillingWithResponseAsync(String resourceGroupName, - String monitorName, SwitchBillingRequest request) { + private Mono> listLinkedResourcesSinglePageAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1679,33 +2643,164 @@ private Mono switchBillingWithResponseAsync(Strin if (monitorName == null) { return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.switchBilling(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) + .withContext(context -> service.listLinkedResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, 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())); } /** - * Switches the billing for NewRelic monitor resource. + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listLinkedResourcesAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>(() -> listLinkedResourcesSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listLinkedResourcesNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listLinkedResourcesSinglePage(String resourceGroupName, + String monitorName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listLinkedResourcesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Monitor Resource by NewRelic on successful completion of {@link Mono}. + * @return response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono switchBillingWithResponseAsync(String resourceGroupName, - String monitorName, SwitchBillingRequest request, Context context) { + private PagedResponse listLinkedResourcesSinglePage(String resourceGroupName, + String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listLinkedResourcesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLinkedResources(String resourceGroupName, String monitorName) { + return new PagedIterable<>(() -> listLinkedResourcesSinglePage(resourceGroupName, monitorName), + nextLink -> listLinkedResourcesNextSinglePage(nextLink)); + } + + /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLinkedResources(String resourceGroupName, String monitorName, + Context context) { + return new PagedIterable<>(() -> listLinkedResourcesSinglePage(resourceGroupName, monitorName, context), + nextLink -> listLinkedResourcesNextSinglePage(nextLink, context)); + } + + /** + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMonitoredResourcesSinglePageAsync(String resourceGroupName, + String monitorName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1721,130 +2816,166 @@ private Mono switchBillingWithResponseAsync(Strin if (monitorName == null) { return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.switchBilling(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); + return FluxUtil + .withContext( + context -> service.listMonitoredResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, 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())); } /** - * Switches the billing for NewRelic monitor resource. + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Monitor Resource by NewRelic on successful completion of {@link Mono}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMonitoredResourcesAsync(String resourceGroupName, + String monitorName) { + return new PagedFlux<>(() -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono switchBillingAsync(String resourceGroupName, String monitorName, - SwitchBillingRequest request) { - return switchBillingWithResponseAsync(resourceGroupName, monitorName, request) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listMonitoredResourcesSinglePage(String resourceGroupName, + String monitorName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listMonitoredResourcesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Switches the billing for NewRelic monitor resource. + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Monitor Resource by NewRelic. + * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MonitorsSwitchBillingResponse switchBillingWithResponse(String resourceGroupName, String monitorName, - SwitchBillingRequest request, Context context) { - return switchBillingWithResponseAsync(resourceGroupName, monitorName, request, context).block(); + private PagedResponse listMonitoredResourcesSinglePage(String resourceGroupName, + String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listMonitoredResourcesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Switches the billing for NewRelic monitor resource. + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Monitor Resource by NewRelic. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NewRelicMonitorResourceInner switchBilling(String resourceGroupName, String monitorName, - SwitchBillingRequest request) { - return switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) { + return new PagedIterable<>(() -> listMonitoredResourcesSinglePage(resourceGroupName, monitorName), + nextLink -> listMonitoredResourcesNextSinglePage(nextLink)); } /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the Hosts get request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostsSinglePageAsync(String resourceGroupName, String monitorName, - HostsGetRequest request) { - 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listHosts(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName, + Context context) { + return new PagedIterable<>(() -> listMonitoredResourcesSinglePage(resourceGroupName, monitorName, context), + nextLink -> listMonitoredResourcesNextSinglePage(nextLink, context)); } /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the Hosts get request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostsSinglePageAsync(String resourceGroupName, String monitorName, - HostsGetRequest request, Context context) { + private Mono> refreshIngestionKeyWithResponseAsync(String resourceGroupName, String monitorName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1860,105 +2991,95 @@ private Mono> listHostsSinglePageAsync(String resourc if (monitorName == null) { return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } - if (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listHosts(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, request, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return FluxUtil + .withContext(context -> service.refreshIngestionKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the Hosts get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHostsAsync(String resourceGroupName, String monitorName, - HostsGetRequest request) { - return new PagedFlux<>(() -> listHostsSinglePageAsync(resourceGroupName, monitorName, request), - nextLink -> listHostsNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshIngestionKeyAsync(String resourceGroupName, String monitorName) { + return refreshIngestionKeyWithResponseAsync(resourceGroupName, monitorName).flatMap(ignored -> Mono.empty()); } /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the Hosts get request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listHostsAsync(String resourceGroupName, String monitorName, HostsGetRequest request, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response refreshIngestionKeyWithResponse(String resourceGroupName, String monitorName, Context context) { - return new PagedFlux<>(() -> listHostsSinglePageAsync(resourceGroupName, monitorName, request, context), - nextLink -> listHostsNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.refreshIngestionKeySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); } /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the Hosts get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) { - return new PagedIterable<>(listHostsAsync(resourceGroupName, monitorName, request)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void refreshIngestionKey(String resourceGroupName, String monitorName) { + refreshIngestionKeyWithResponse(resourceGroupName, monitorName, Context.NONE); } /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param request The details of the Hosts get request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request, - Context context) { - return new PagedIterable<>(listHostsAsync(resourceGroupName, monitorName, request, context)); - } - - /** - * List the resources currently being monitored by the NewRelic monitor resource. + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @param body Resubscribe Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMonitoredResourcesSinglePageAsync(String resourceGroupName, - String monitorName) { + private Mono>> resubscribeWithResponseAsync(String resourceGroupName, String monitorName, + ResubscribeProperties body) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1974,282 +3095,300 @@ private Mono> listMonitoredResourcesSingle if (monitorName == null) { return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } + if (body != null) { + body.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listMonitoredResources(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.resubscribe(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. + * @param body Resubscribe Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMonitoredResourcesSinglePageAsync(String resourceGroupName, - String monitorName, Context context) { + private Response resubscribeWithResponse(String resourceGroupName, String monitorName, + ResubscribeProperties body) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (body != null) { + body.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listMonitoredResources(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.resubscribeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, body, accept, Context.NONE); } /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @param body Resubscribe Properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with - * {@link PagedFlux}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMonitoredResourcesAsync(String resourceGroupName, - String monitorName) { - return new PagedFlux<>(() -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName), - nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response resubscribeWithResponse(String resourceGroupName, String monitorName, + ResubscribeProperties body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.resubscribeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, body, accept, context); } /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. + * @param body Resubscribe Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with - * {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMonitoredResourcesAsync(String resourceGroupName, String monitorName, - Context context) { - return new PagedFlux<>(() -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName, context), - nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NewRelicMonitorResourceInner> + beginResubscribeAsync(String resourceGroupName, String monitorName, ResubscribeProperties body) { + Mono>> mono = resubscribeWithResponseAsync(resourceGroupName, monitorName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, + this.client.getContext()); } /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 list of all the resources being monitored by NewRelic monitor resource as paginated response with - * {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) { - return new PagedIterable<>(listMonitoredResourcesAsync(resourceGroupName, monitorName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NewRelicMonitorResourceInner> + beginResubscribeAsync(String resourceGroupName, String monitorName) { + final ResubscribeProperties body = null; + Mono>> mono = resubscribeWithResponseAsync(resourceGroupName, monitorName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, + this.client.getContext()); } /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. + * @param body Resubscribe Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with - * {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName, - Context context) { - return new PagedIterable<>(listMonitoredResourcesAsync(resourceGroupName, monitorName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NewRelicMonitorResourceInner> + beginResubscribe(String resourceGroupName, String monitorName, ResubscribeProperties body) { + Response response = resubscribeWithResponse(resourceGroupName, monitorName, body); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, Context.NONE); } /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLinkedResourcesSinglePageAsync(String resourceGroupName, - String monitorName) { - 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listLinkedResources(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, 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())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NewRelicMonitorResourceInner> + beginResubscribe(String resourceGroupName, String monitorName) { + final ResubscribeProperties body = null; + Response response = resubscribeWithResponse(resourceGroupName, monitorName, body); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, Context.NONE); } /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @param body Resubscribe Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLinkedResourcesSinglePageAsync(String resourceGroupName, - String monitorName, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listLinkedResources(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - monitorName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NewRelicMonitorResourceInner> + beginResubscribe(String resourceGroupName, String monitorName, ResubscribeProperties body, Context context) { + Response response = resubscribeWithResponse(resourceGroupName, monitorName, body, context); + return this.client.getLroResult(response, + NewRelicMonitorResourceInner.class, NewRelicMonitorResourceInner.class, context); } /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @param body Resubscribe Properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedFlux}. + * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listLinkedResourcesAsync(String resourceGroupName, String monitorName) { - return new PagedFlux<>(() -> listLinkedResourcesSinglePageAsync(resourceGroupName, monitorName), - nextLink -> listLinkedResourcesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resubscribeAsync(String resourceGroupName, String monitorName, + ResubscribeProperties body) { + return beginResubscribeAsync(resourceGroupName, monitorName, body).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedFlux}. + * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listLinkedResourcesAsync(String resourceGroupName, String monitorName, - Context context) { - return new PagedFlux<>(() -> listLinkedResourcesSinglePageAsync(resourceGroupName, monitorName, context), - nextLink -> listLinkedResourcesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resubscribeAsync(String resourceGroupName, String monitorName) { + final ResubscribeProperties body = null; + return beginResubscribeAsync(resourceGroupName, monitorName, body).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + * @return a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLinkedResources(String resourceGroupName, String monitorName) { - return new PagedIterable<>(listLinkedResourcesAsync(resourceGroupName, monitorName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public NewRelicMonitorResourceInner resubscribe(String resourceGroupName, String monitorName) { + final ResubscribeProperties body = null; + return beginResubscribe(resourceGroupName, monitorName, body).getFinalResult(); } /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @param body Resubscribe Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return a Monitor Resource by NewRelic. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLinkedResources(String resourceGroupName, String monitorName, - Context context) { - return new PagedIterable<>(listLinkedResourcesAsync(resourceGroupName, monitorName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public NewRelicMonitorResourceInner resubscribe(String resourceGroupName, String monitorName, + ResubscribeProperties body, Context context) { + return beginResubscribe(resourceGroupName, monitorName, body, context).getFinalResult(); } /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @param request The details of the switch billing request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of payload to be passed while installing VM agent along with {@link Response} on successful - * completion of {@link Mono}. + * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> vmHostPayloadWithResponseAsync(String resourceGroupName, - String monitorName) { + private Mono> switchBillingWithResponseAsync(String resourceGroupName, + String monitorName, SwitchBillingRequest request) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2265,28 +3404,112 @@ private Mono> vmHostPayloadWithResponseAsync(S if (monitorName == null) { return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.vmHostPayload(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) + .withContext(context -> service.switchBilling(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the switch billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Monitor Resource by NewRelic on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono switchBillingAsync(String resourceGroupName, String monitorName, + SwitchBillingRequest request) { + return switchBillingWithResponseAsync(resourceGroupName, monitorName, request) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @param request The details of the switch billing request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Monitor Resource by NewRelic along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response switchBillingWithResponse(String resourceGroupName, + String monitorName, SwitchBillingRequest request, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (request == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return service.switchBillingSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, request, accept, context); + } + + /** + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the switch billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Monitor Resource by NewRelic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NewRelicMonitorResourceInner switchBilling(String resourceGroupName, String monitorName, + SwitchBillingRequest request) { + return switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue(); + } + + /** + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of payload to be passed while installing VM agent along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> vmHostPayloadWithResponseAsync(String resourceGroupName, - String monitorName, Context context) { + String monitorName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2303,13 +3526,15 @@ private Mono> vmHostPayloadWithResponseAsync(S return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.vmHostPayload(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); + return FluxUtil + .withContext(context -> service.vmHostPayload(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2325,7 +3550,8 @@ private Mono vmHostPayloadAsync(String resourceGroupNam } /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2338,11 +3564,32 @@ private Mono vmHostPayloadAsync(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) public Response vmHostPayloadWithResponse(String resourceGroupName, String monitorName, Context context) { - return vmHostPayloadWithResponseAsync(resourceGroupName, monitorName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.vmHostPayloadSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); } /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2384,6 +3631,33 @@ private Mono> listBySubscriptionNext .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2392,24 +3666,25 @@ private Mono> listBySubscriptionNext * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2440,6 +3715,33 @@ private Mono> listByResourceGroupNex .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2448,24 +3750,25 @@ private Mono> listByResourceGroupNex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2495,6 +3798,33 @@ private Mono> listAppServicesNextSinglePageAs .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAppServicesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listAppServicesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2503,24 +3833,24 @@ private Mono> listAppServicesNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of a list app services Operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAppServicesNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listAppServicesNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAppServicesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listAppServicesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2550,6 +3880,33 @@ private Mono> listHostsNextSinglePageAsync(String nex .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list VM Host Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listHostsNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listHostsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2558,37 +3915,40 @@ private Mono> listHostsNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of a list VM Host Operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHostsNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listHostsNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listHostsNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listHostsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMonitoredResourcesNextSinglePageAsync(String nextLink) { + private Mono> listLinkedResourcesNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2599,13 +3959,46 @@ private Mono> listMonitoredResourcesNextSi final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + context -> service.listLinkedResourcesNext(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())); } /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listLinkedResourcesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listLinkedResourcesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2613,24 +4006,24 @@ private Mono> listMonitoredResourcesNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return response of a list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMonitoredResourcesNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listLinkedResourcesNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listLinkedResourcesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2640,10 +4033,11 @@ private Mono> listMonitoredResourcesNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLinkedResourcesNextSinglePageAsync(String nextLink) { + private Mono> listMonitoredResourcesNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2654,12 +4048,39 @@ private Mono> listLinkedResourcesNextSinglePa final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listLinkedResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), + context -> service.listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMonitoredResourcesNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listMonitoredResourcesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2668,22 +4089,26 @@ private Mono> listLinkedResourcesNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLinkedResourcesNextSinglePageAsync(String nextLink, + private PagedResponse listMonitoredResourcesNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listLinkedResourcesNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listMonitoredResourcesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(MonitorsClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java index 6b5c40a49849..47c3f5aa6cd9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsImpl.java @@ -11,6 +11,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.MonitorsClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LatestLinkedSaaSResponseInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner; @@ -21,6 +22,7 @@ import com.azure.resourcemanager.newrelicobservability.models.AppServiceInfo; import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; +import com.azure.resourcemanager.newrelicobservability.models.LatestLinkedSaaSResponse; import com.azure.resourcemanager.newrelicobservability.models.LinkedResource; import com.azure.resourcemanager.newrelicobservability.models.MetricRules; import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; @@ -28,8 +30,9 @@ import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusResponse; import com.azure.resourcemanager.newrelicobservability.models.MonitoredResource; import com.azure.resourcemanager.newrelicobservability.models.Monitors; -import com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingResponse; import com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResource; +import com.azure.resourcemanager.newrelicobservability.models.ResubscribeProperties; +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; import com.azure.resourcemanager.newrelicobservability.models.VMExtensionPayload; import com.azure.resourcemanager.newrelicobservability.models.VMInfo; @@ -89,12 +92,12 @@ public NewRelicMonitorResource getByResourceGroup(String resourceGroupName, Stri } } - public void delete(String resourceGroupName, String userEmail, String monitorName) { - this.serviceClient().delete(resourceGroupName, userEmail, monitorName); + public void delete(String resourceGroupName, String monitorName, String userEmail) { + this.serviceClient().delete(resourceGroupName, monitorName, userEmail); } - public void delete(String resourceGroupName, String userEmail, String monitorName, Context context) { - this.serviceClient().delete(resourceGroupName, userEmail, monitorName, context); + public void delete(String resourceGroupName, String monitorName, String userEmail, Context context) { + this.serviceClient().delete(resourceGroupName, monitorName, userEmail, context); } public Response getMetricRulesWithResponse(String resourceGroupName, String monitorName, @@ -141,36 +144,40 @@ public MetricsStatusResponse getMetricStatus(String resourceGroupName, String mo } } - public PagedIterable listAppServices(String resourceGroupName, String monitorName, - AppServicesGetRequest request) { - PagedIterable inner - = this.serviceClient().listAppServices(resourceGroupName, monitorName, request); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); + public Response latestLinkedSaaSWithResponse(String resourceGroupName, String monitorName, + Context context) { + Response inner + = this.serviceClient().latestLinkedSaaSWithResponse(resourceGroupName, monitorName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LatestLinkedSaaSResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable listAppServices(String resourceGroupName, String monitorName, - AppServicesGetRequest request, Context context) { - PagedIterable inner - = this.serviceClient().listAppServices(resourceGroupName, monitorName, request, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); + public LatestLinkedSaaSResponse latestLinkedSaaS(String resourceGroupName, String monitorName) { + LatestLinkedSaaSResponseInner inner = this.serviceClient().latestLinkedSaaS(resourceGroupName, monitorName); + if (inner != null) { + return new LatestLinkedSaaSResponseImpl(inner, this.manager()); + } else { + return null; + } } - public Response switchBillingWithResponse(String resourceGroupName, String monitorName, - SwitchBillingRequest request, Context context) { - MonitorsSwitchBillingResponse inner - = this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context); + public NewRelicMonitorResource linkSaaS(String resourceGroupName, String monitorName, SaaSData body) { + NewRelicMonitorResourceInner inner = this.serviceClient().linkSaaS(resourceGroupName, monitorName, body); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new NewRelicMonitorResourceImpl(inner.getValue(), this.manager())); + return new NewRelicMonitorResourceImpl(inner, this.manager()); } else { return null; } } - public NewRelicMonitorResource switchBilling(String resourceGroupName, String monitorName, - SwitchBillingRequest request) { + public NewRelicMonitorResource linkSaaS(String resourceGroupName, String monitorName, SaaSData body, + Context context) { NewRelicMonitorResourceInner inner - = this.serviceClient().switchBilling(resourceGroupName, monitorName, request); + = this.serviceClient().linkSaaS(resourceGroupName, monitorName, body, context); if (inner != null) { return new NewRelicMonitorResourceImpl(inner, this.manager()); } else { @@ -178,6 +185,20 @@ public NewRelicMonitorResource switchBilling(String resourceGroupName, String mo } } + public PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request) { + PagedIterable inner + = this.serviceClient().listAppServices(resourceGroupName, monitorName, request); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); + } + + public PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context) { + PagedIterable inner + = this.serviceClient().listAppServices(resourceGroupName, monitorName, request, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager())); + } + public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) { PagedIterable inner = this.serviceClient().listHosts(resourceGroupName, monitorName, request); return ResourceManagerUtils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager())); @@ -190,6 +211,19 @@ public PagedIterable listHosts(String resourceGroupName, String monitorN return ResourceManagerUtils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager())); } + public PagedIterable listLinkedResources(String resourceGroupName, String monitorName) { + PagedIterable inner + = this.serviceClient().listLinkedResources(resourceGroupName, monitorName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkedResourceImpl(inner1, this.manager())); + } + + public PagedIterable listLinkedResources(String resourceGroupName, String monitorName, + Context context) { + PagedIterable inner + = this.serviceClient().listLinkedResources(resourceGroupName, monitorName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkedResourceImpl(inner1, this.manager())); + } + public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) { PagedIterable inner = this.serviceClient().listMonitoredResources(resourceGroupName, monitorName); @@ -203,17 +237,56 @@ public PagedIterable listMonitoredResources(String resourceGr return ResourceManagerUtils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager())); } - public PagedIterable listLinkedResources(String resourceGroupName, String monitorName) { - PagedIterable inner - = this.serviceClient().listLinkedResources(resourceGroupName, monitorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkedResourceImpl(inner1, this.manager())); + public Response refreshIngestionKeyWithResponse(String resourceGroupName, String monitorName, + Context context) { + return this.serviceClient().refreshIngestionKeyWithResponse(resourceGroupName, monitorName, context); } - public PagedIterable listLinkedResources(String resourceGroupName, String monitorName, + public void refreshIngestionKey(String resourceGroupName, String monitorName) { + this.serviceClient().refreshIngestionKey(resourceGroupName, monitorName); + } + + public NewRelicMonitorResource resubscribe(String resourceGroupName, String monitorName) { + NewRelicMonitorResourceInner inner = this.serviceClient().resubscribe(resourceGroupName, monitorName); + if (inner != null) { + return new NewRelicMonitorResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public NewRelicMonitorResource resubscribe(String resourceGroupName, String monitorName, ResubscribeProperties body, Context context) { - PagedIterable inner - = this.serviceClient().listLinkedResources(resourceGroupName, monitorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LinkedResourceImpl(inner1, this.manager())); + NewRelicMonitorResourceInner inner + = this.serviceClient().resubscribe(resourceGroupName, monitorName, body, context); + if (inner != null) { + return new NewRelicMonitorResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response switchBillingWithResponse(String resourceGroupName, String monitorName, + SwitchBillingRequest request, Context context) { + Response inner + = this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NewRelicMonitorResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NewRelicMonitorResource switchBilling(String resourceGroupName, String monitorName, + SwitchBillingRequest request) { + NewRelicMonitorResourceInner inner + = this.serviceClient().switchBilling(resourceGroupName, monitorName, request); + if (inner != null) { + return new NewRelicMonitorResourceImpl(inner, this.manager()); + } else { + return null; + } } public Response vmHostPayloadWithResponse(String resourceGroupName, String monitorName, diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java index ea4a7248f58a..0beed0c38f20 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicMonitorResourceImpl.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.newrelicobservability.models.AppServiceInfo; import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; +import com.azure.resourcemanager.newrelicobservability.models.LatestLinkedSaaSResponse; import com.azure.resourcemanager.newrelicobservability.models.LiftrResourceCategories; import com.azure.resourcemanager.newrelicobservability.models.LinkedResource; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; @@ -30,6 +31,8 @@ import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; +import com.azure.resourcemanager.newrelicobservability.models.ResubscribeProperties; +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; import com.azure.resourcemanager.newrelicobservability.models.UserInfo; import com.azure.resourcemanager.newrelicobservability.models.VMExtensionPayload; @@ -104,6 +107,10 @@ public PlanData planData() { return this.innerModel().planData(); } + public SaaSData saaSData() { + return this.innerModel().saaSData(); + } + public LiftrResourceCategories liftrResourceCategory() { return this.innerModel().liftrResourceCategory(); } @@ -188,16 +195,14 @@ public NewRelicMonitorResourceImpl update() { public NewRelicMonitorResource apply() { this.innerObject = serviceManager.serviceClient() .getMonitors() - .updateWithResponse(resourceGroupName, monitorName, updateProperties, Context.NONE) - .getValue(); + .update(resourceGroupName, monitorName, updateProperties, Context.NONE); return this; } public NewRelicMonitorResource apply(Context context) { this.innerObject = serviceManager.serviceClient() .getMonitors() - .updateWithResponse(resourceGroupName, monitorName, updateProperties, context) - .getValue(); + .update(resourceGroupName, monitorName, updateProperties, context); return this; } @@ -241,20 +246,28 @@ public MetricsStatusResponse getMetricStatus(MetricsStatusRequest request) { return serviceManager.monitors().getMetricStatus(resourceGroupName, monitorName, request); } - public PagedIterable listAppServices(AppServicesGetRequest request) { - return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request); + public Response latestLinkedSaaSWithResponse(Context context) { + return serviceManager.monitors().latestLinkedSaaSWithResponse(resourceGroupName, monitorName, context); } - public PagedIterable listAppServices(AppServicesGetRequest request, Context context) { - return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request, context); + public LatestLinkedSaaSResponse latestLinkedSaaS() { + return serviceManager.monitors().latestLinkedSaaS(resourceGroupName, monitorName); } - public Response switchBillingWithResponse(SwitchBillingRequest request, Context context) { - return serviceManager.monitors().switchBillingWithResponse(resourceGroupName, monitorName, request, context); + public NewRelicMonitorResource linkSaaS(SaaSData body) { + return serviceManager.monitors().linkSaaS(resourceGroupName, monitorName, body); } - public NewRelicMonitorResource switchBilling(SwitchBillingRequest request) { - return serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request); + public NewRelicMonitorResource linkSaaS(SaaSData body, Context context) { + return serviceManager.monitors().linkSaaS(resourceGroupName, monitorName, body, context); + } + + public PagedIterable listAppServices(AppServicesGetRequest request) { + return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request); + } + + public PagedIterable listAppServices(AppServicesGetRequest request, Context context) { + return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request, context); } public PagedIterable listHosts(HostsGetRequest request) { @@ -265,6 +278,14 @@ public PagedIterable listHosts(HostsGetRequest request, Context context) return serviceManager.monitors().listHosts(resourceGroupName, monitorName, request, context); } + public PagedIterable listLinkedResources() { + return serviceManager.monitors().listLinkedResources(resourceGroupName, monitorName); + } + + public PagedIterable listLinkedResources(Context context) { + return serviceManager.monitors().listLinkedResources(resourceGroupName, monitorName, context); + } + public PagedIterable listMonitoredResources() { return serviceManager.monitors().listMonitoredResources(resourceGroupName, monitorName); } @@ -273,12 +294,28 @@ public PagedIterable listMonitoredResources(Context context) return serviceManager.monitors().listMonitoredResources(resourceGroupName, monitorName, context); } - public PagedIterable listLinkedResources() { - return serviceManager.monitors().listLinkedResources(resourceGroupName, monitorName); + public Response refreshIngestionKeyWithResponse(Context context) { + return serviceManager.monitors().refreshIngestionKeyWithResponse(resourceGroupName, monitorName, context); } - public PagedIterable listLinkedResources(Context context) { - return serviceManager.monitors().listLinkedResources(resourceGroupName, monitorName, context); + public void refreshIngestionKey() { + serviceManager.monitors().refreshIngestionKey(resourceGroupName, monitorName); + } + + public NewRelicMonitorResource resubscribe() { + return serviceManager.monitors().resubscribe(resourceGroupName, monitorName); + } + + public NewRelicMonitorResource resubscribe(ResubscribeProperties body, Context context) { + return serviceManager.monitors().resubscribe(resourceGroupName, monitorName, body, context); + } + + public Response switchBillingWithResponse(SwitchBillingRequest request, Context context) { + return serviceManager.monitors().switchBillingWithResponse(resourceGroupName, monitorName, request, context); + } + + public NewRelicMonitorResource switchBilling(SwitchBillingRequest request) { + return serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request); } public Response vmHostPayloadWithResponse(Context context) { @@ -350,6 +387,16 @@ public NewRelicMonitorResourceImpl withPlanData(PlanData planData) { } } + public NewRelicMonitorResourceImpl withSaaSData(SaaSData saaSData) { + if (isInCreateMode()) { + this.innerModel().withSaaSData(saaSData); + return this; + } else { + this.updateProperties.withSaaSData(saaSData); + return this; + } + } + public NewRelicMonitorResourceImpl withOrgCreationSource(OrgCreationSource orgCreationSource) { if (isInCreateMode()) { this.innerModel().withOrgCreationSource(orgCreationSource); @@ -381,6 +428,6 @@ public NewRelicMonitorResourceImpl withSaaSAzureSubscriptionStatus(String saaSAz } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java index 4a492601703a..2459f422aa5b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/NewRelicObservabilityImpl.java @@ -15,12 +15,15 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.newrelicobservability.fluent.AccountsClient; @@ -32,6 +35,7 @@ import com.azure.resourcemanager.newrelicobservability.fluent.OperationsClient; import com.azure.resourcemanager.newrelicobservability.fluent.OrganizationsClient; import com.azure.resourcemanager.newrelicobservability.fluent.PlansClient; +import com.azure.resourcemanager.newrelicobservability.fluent.SaaSClient; import com.azure.resourcemanager.newrelicobservability.fluent.TagRulesClient; import java.io.IOException; import java.lang.reflect.Type; @@ -159,6 +163,20 @@ public AccountsClient getAccounts() { return this.accounts; } + /** + * The SaaSClient object to access its operations. + */ + private final SaaSClient saaS; + + /** + * Gets the SaaSClient object to access its operations. + * + * @return the SaaSClient object. + */ + public SaaSClient getSaaS() { + return this.saaS; + } + /** * The MonitorsClient object to access its operations. */ @@ -230,31 +248,31 @@ public ConnectedPartnerResourcesClient getConnectedPartnerResources() { } /** - * The TagRulesClient object to access its operations. + * The MonitoredSubscriptionsClient object to access its operations. */ - private final TagRulesClient tagRules; + private final MonitoredSubscriptionsClient monitoredSubscriptions; /** - * Gets the TagRulesClient object to access its operations. + * Gets the MonitoredSubscriptionsClient object to access its operations. * - * @return the TagRulesClient object. + * @return the MonitoredSubscriptionsClient object. */ - public TagRulesClient getTagRules() { - return this.tagRules; + public MonitoredSubscriptionsClient getMonitoredSubscriptions() { + return this.monitoredSubscriptions; } /** - * The MonitoredSubscriptionsClient object to access its operations. + * The TagRulesClient object to access its operations. */ - private final MonitoredSubscriptionsClient monitoredSubscriptions; + private final TagRulesClient tagRules; /** - * Gets the MonitoredSubscriptionsClient object to access its operations. + * Gets the TagRulesClient object to access its operations. * - * @return the MonitoredSubscriptionsClient object. + * @return the TagRulesClient object. */ - public MonitoredSubscriptionsClient getMonitoredSubscriptions() { - return this.monitoredSubscriptions; + public TagRulesClient getTagRules() { + return this.tagRules; } /** @@ -274,16 +292,17 @@ public MonitoredSubscriptionsClient getMonitoredSubscriptions() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-01-01"; + this.apiVersion = "2025-05-01-preview"; this.operations = new OperationsClientImpl(this); this.accounts = new AccountsClientImpl(this); + this.saaS = new SaaSClientImpl(this); this.monitors = new MonitorsClientImpl(this); this.organizations = new OrganizationsClientImpl(this); this.plans = new PlansClientImpl(this); this.billingInfoes = new BillingInfoesClientImpl(this); this.connectedPartnerResources = new ConnectedPartnerResourcesClientImpl(this); - this.tagRules = new TagRulesClientImpl(this); this.monitoredSubscriptions = new MonitoredSubscriptionsClientImpl(this); + this.tagRules = new TagRulesClientImpl(this); } /** @@ -323,6 +342,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsClientImpl.java index 677c5fd1c791..37a12f0f1fd0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OperationsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.OperationsClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.OperationInner; import com.azure.resourcemanager.newrelicobservability.models.OperationListResult; @@ -60,7 +61,7 @@ public final class OperationsClientImpl implements OperationsClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/NewRelic.Observability/operations") @@ -69,12 +70,26 @@ public interface OperationsService { Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/NewRelic.Observability/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -103,24 +118,14 @@ private Mono> listSinglePageAsync() { /** * List the operations for the provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,12 +133,20 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -143,13 +156,20 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -162,7 +182,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -177,7 +197,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -206,6 +226,33 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -214,22 +261,24 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsClientImpl.java index c566f056f48d..837afddfcf58 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/OrganizationsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.OrganizationsClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner; import com.azure.resourcemanager.newrelicobservability.models.OrganizationsListResponse; @@ -60,7 +61,7 @@ public final class OrganizationsClientImpl implements OrganizationsClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityOrganizations") public interface OrganizationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/organizations") @@ -71,6 +72,15 @@ Mono> list(@HostParam("$host") String endpoi @QueryParam("userEmail") String userEmail, @QueryParam("location") String location, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/organizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("userEmail") String userEmail, @QueryParam("location") String location, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -78,10 +88,18 @@ Mono> list(@HostParam("$host") String endpoi Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -117,61 +135,63 @@ private Mono> listSinglePageAsync(Strin } /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all organizations Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of get all organizations Operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String userEmail, String location, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (userEmail == null) { - return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), userEmail, - location, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String userEmail, String location) { + return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all organizations Operation as paginated response with {@link PagedFlux}. + * @return response of get all organizations Operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String userEmail, String location) { - return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String userEmail, String location) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (userEmail == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), userEmail, location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -179,16 +199,39 @@ private PagedFlux listAsync(String userEmail, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all organizations Operation as paginated response with {@link PagedFlux}. + * @return response of get all organizations Operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String userEmail, String location, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(userEmail, location, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String userEmail, String location, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (userEmail == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter userEmail is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), userEmail, location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -199,11 +242,12 @@ private PagedFlux listAsync(String userEmail, String */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String userEmail, String location) { - return new PagedIterable<>(listAsync(userEmail, location)); + return new PagedIterable<>(() -> listSinglePage(userEmail, location), nextLink -> listNextSinglePage(nextLink)); } /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -215,7 +259,8 @@ public PagedIterable list(String userEmail, String lo */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String userEmail, String location, Context context) { - return new PagedIterable<>(listAsync(userEmail, location, context)); + return new PagedIterable<>(() -> listSinglePage(userEmail, location, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -244,6 +289,33 @@ private Mono> listNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of get all organizations Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -252,22 +324,25 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all organizations Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of get all organizations Operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(OrganizationsClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansClientImpl.java index 2f74169245a2..cdf38684d3c0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/PlansClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.newrelicobservability.fluent.PlansClient; import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; import com.azure.resourcemanager.newrelicobservability.models.PlanDataListResponse; @@ -59,7 +60,7 @@ public final class PlansClientImpl implements PlansClient { * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityPlans") public interface PlansService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/plans") @@ -70,16 +71,32 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("accountId") String accountId, @QueryParam("organizationId") String organizationId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/plans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("accountId") String accountId, @QueryParam("organizationId") String organizationId, + @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @param accountId Account Id. * @param organizationId Organization Id. @@ -109,39 +126,7 @@ private Mono> listSinglePageAsync(String ac } /** - * List plans data. - * - * @param accountId Account Id. - * @param organizationId Organization Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all plan data Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String accountId, String organizationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accountId, - organizationId, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @param accountId Account Id. * @param organizationId Organization Id. @@ -157,7 +142,7 @@ private PagedFlux listAsync(String accountId, String orga } /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -172,7 +157,36 @@ private PagedFlux listAsync() { } /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. + * + * @param accountId Account Id. + * @param organizationId Organization Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of get all plan data Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String accountId, String organizationId) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accountId, organizationId, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @param accountId Account Id. * @param organizationId Organization Id. @@ -180,16 +194,30 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all plan data Operation as paginated response with {@link PagedFlux}. + * @return response of get all plan data Operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String accountId, String organizationId, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(accountId, organizationId, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String accountId, String organizationId, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accountId, organizationId, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -199,11 +227,12 @@ private PagedFlux listAsync(String accountId, String orga public PagedIterable list() { final String accountId = null; final String organizationId = null; - return new PagedIterable<>(listAsync(accountId, organizationId)); + return new PagedIterable<>(() -> listSinglePage(accountId, organizationId), + nextLink -> listNextSinglePage(nextLink)); } /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @param accountId Account Id. * @param organizationId Organization Id. @@ -215,7 +244,8 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String accountId, String organizationId, Context context) { - return new PagedIterable<>(listAsync(accountId, organizationId, context)); + return new PagedIterable<>(() -> listSinglePage(accountId, organizationId, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -244,6 +274,33 @@ private Mono> listNextSinglePageAsync(Strin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of get all plan data Operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -252,22 +309,24 @@ private Mono> listNextSinglePageAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of get all plan data Operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return response of get all plan data Operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(PlansClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSClientImpl.java new file mode 100644 index 000000000000..a99cb67a0daf --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSClientImpl.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.newrelicobservability.fluent.SaaSClient; +import com.azure.resourcemanager.newrelicobservability.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.newrelicobservability.models.ActivateSaaSParameterRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SaaSClient. + */ +public final class SaaSClientImpl implements SaaSClient { + /** + * The proxy service used to perform REST calls. + */ + private final SaaSService service; + + /** + * The service client containing this operation class. + */ + private final NewRelicObservabilityImpl client; + + /** + * Initializes an instance of SaaSClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SaaSClientImpl(NewRelicObservabilityImpl client) { + this.service = RestProxy.create(SaaSService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NewRelicObservabilitySaaS to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NewRelicObservabilitySaaS") + public interface SaaSService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/activateSaaS") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> activateResource(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ActivateSaaSParameterRequest request, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/activateSaaS") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response activateResourceSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ActivateSaaSParameterRequest request, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param request The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + activateResourceWithResponseAsync(ActivateSaaSParameterRequest request) { + 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 (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.activateResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), request, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param request The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono activateResourceAsync(ActivateSaaSParameterRequest request) { + return activateResourceWithResponseAsync(request).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param request The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response activateResourceWithResponse(ActivateSaaSParameterRequest request, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (request == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return service.activateResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), request, accept, context); + } + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param request The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SaaSResourceDetailsResponseInner activateResource(ActivateSaaSParameterRequest request) { + return activateResourceWithResponse(request, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(SaaSClientImpl.class); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSImpl.java new file mode 100644 index 000000000000..3ca44b9fec4f --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.newrelicobservability.fluent.SaaSClient; +import com.azure.resourcemanager.newrelicobservability.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.newrelicobservability.models.ActivateSaaSParameterRequest; +import com.azure.resourcemanager.newrelicobservability.models.SaaS; +import com.azure.resourcemanager.newrelicobservability.models.SaaSResourceDetailsResponse; + +public final class SaaSImpl implements SaaS { + private static final ClientLogger LOGGER = new ClientLogger(SaaSImpl.class); + + private final SaaSClient innerClient; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + public SaaSImpl(SaaSClient innerClient, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response activateResourceWithResponse(ActivateSaaSParameterRequest request, + Context context) { + Response inner + = this.serviceClient().activateResourceWithResponse(request, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SaaSResourceDetailsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SaaSResourceDetailsResponse activateResource(ActivateSaaSParameterRequest request) { + SaaSResourceDetailsResponseInner inner = this.serviceClient().activateResource(request); + if (inner != null) { + return new SaaSResourceDetailsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private SaaSClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSResourceDetailsResponseImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSResourceDetailsResponseImpl.java new file mode 100644 index 000000000000..0ec75f80b4f7 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/SaaSResourceDetailsResponseImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.SaaSResourceDetailsResponseInner; +import com.azure.resourcemanager.newrelicobservability.models.SaaSResourceDetailsResponse; + +public final class SaaSResourceDetailsResponseImpl implements SaaSResourceDetailsResponse { + private SaaSResourceDetailsResponseInner innerObject; + + private final com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager; + + SaaSResourceDetailsResponseImpl(SaaSResourceDetailsResponseInner innerObject, + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String saasId() { + return this.innerModel().saasId(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SaaSResourceDetailsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleImpl.java index 3bf70202a68e..7aa55be22f40 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRuleImpl.java @@ -166,6 +166,6 @@ public TagRuleImpl withMetricRules(MetricRulesInner metricRules) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesClientImpl.java index 54daa8f39d7a..2bfd926d1829 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/TagRulesClientImpl.java @@ -28,8 +28,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.newrelicobservability.fluent.TagRulesClient; @@ -69,7 +71,7 @@ public final class TagRulesClientImpl implements TagRulesClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "NewRelicObservabilit") + @ServiceInterface(name = "NewRelicObservabilityTagRules") public interface TagRulesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules") @@ -80,6 +82,15 @@ Mono> listByNewRelicMonitorResource(@HostParam("$hos @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByNewRelicMonitorResourceSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") @ExpectedResponses({ 200 }) @@ -89,6 +100,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, @PathParam("ruleSetName") String ruleSetName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") @ExpectedResponses({ 200, 201 }) @@ -100,13 +120,14 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Response createOrUpdateSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, - @PathParam("ruleSetName") String ruleSetName, @HeaderParam("Accept") String accept, Context context); + @PathParam("ruleSetName") String ruleSetName, @BodyParam("application/json") TagRuleInner resource, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") @@ -118,6 +139,34 @@ Mono> update(@HostParam("$host") String endpoint, @PathParam("ruleSetName") String ruleSetName, @BodyParam("application/json") TagRuleUpdateInner properties, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, @BodyParam("application/json") TagRuleUpdateInner properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/tagRules/{ruleSetName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("monitorName") String monitorName, + @PathParam("ruleSetName") String ruleSetName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -125,10 +174,19 @@ Mono> update(@HostParam("$host") String endpoint, Mono> listByNewRelicMonitorResourceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByNewRelicMonitorResourceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -167,62 +225,65 @@ private Mono> listByNewRelicMonitorResourceSinglePag } /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a TagRule list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNewRelicMonitorResourceSinglePageAsync(String resourceGroupName, - String monitorName, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByNewRelicMonitorResource(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByNewRelicMonitorResourceAsync(String resourceGroupName, String monitorName) { + return new PagedFlux<>(() -> listByNewRelicMonitorResourceSinglePageAsync(resourceGroupName, monitorName), + nextLink -> listByNewRelicMonitorResourceNextSinglePageAsync(nextLink)); } /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a TagRule list operation as paginated response with {@link PagedFlux}. + * @return the response of a TagRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNewRelicMonitorResourceAsync(String resourceGroupName, String monitorName) { - return new PagedFlux<>(() -> listByNewRelicMonitorResourceSinglePageAsync(resourceGroupName, monitorName), - nextLink -> listByNewRelicMonitorResourceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByNewRelicMonitorResourceSinglePage(String resourceGroupName, + String monitorName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByNewRelicMonitorResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -230,18 +291,40 @@ private PagedFlux listByNewRelicMonitorResourceAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a TagRule list operation as paginated response with {@link PagedFlux}. + * @return the response of a TagRule list operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByNewRelicMonitorResourceAsync(String resourceGroupName, String monitorName, - Context context) { - return new PagedFlux<>( - () -> listByNewRelicMonitorResourceSinglePageAsync(resourceGroupName, monitorName, context), - nextLink -> listByNewRelicMonitorResourceNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByNewRelicMonitorResourceSinglePage(String resourceGroupName, + String monitorName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByNewRelicMonitorResourceSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -252,11 +335,13 @@ private PagedFlux listByNewRelicMonitorResourceAsync(String resour */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName) { - return new PagedIterable<>(listByNewRelicMonitorResourceAsync(resourceGroupName, monitorName)); + return new PagedIterable<>(() -> listByNewRelicMonitorResourceSinglePage(resourceGroupName, monitorName), + nextLink -> listByNewRelicMonitorResourceNextSinglePage(nextLink)); } /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -269,11 +354,14 @@ public PagedIterable listByNewRelicMonitorResource(String resource @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName, Context context) { - return new PagedIterable<>(listByNewRelicMonitorResourceAsync(resourceGroupName, monitorName, context)); + return new PagedIterable<>( + () -> listByNewRelicMonitorResourceSinglePage(resourceGroupName, monitorName, context), + nextLink -> listByNewRelicMonitorResourceNextSinglePage(nextLink, context)); } /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -281,7 +369,8 @@ public PagedIterable listByNewRelicMonitorResource(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a TagRule along with {@link Response} on successful completion of {@link Mono}. + * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, @@ -312,46 +401,8 @@ private Mono> getWithResponseAsync(String resourceGroupNa } /** - * Get a TagRule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param ruleSetName Name of the TagRule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 TagRule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String monitorName, - String ruleSetName, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - if (ruleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, ruleSetName, accept, context); - } - - /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -359,7 +410,7 @@ private Mono> getWithResponseAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 TagRule on successful completion of {@link Mono}. + * @return a tag rule belonging to NewRelic account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String monitorName, String ruleSetName) { @@ -368,7 +419,8 @@ private Mono getAsync(String resourceGroupName, String monitorName } /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -377,16 +429,41 @@ private Mono getAsync(String resourceGroupName, String monitorName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 TagRule along with {@link Response}. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String monitorName, String ruleSetName, Context context) { - return getWithResponseAsync(resourceGroupName, monitorName, ruleSetName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, monitorName, ruleSetName, accept, context); } /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -394,7 +471,7 @@ public Response getWithResponse(String resourceGroupName, String m * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 TagRule. + * @return a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) public TagRuleInner get(String resourceGroupName, String monitorName, String ruleSetName) { @@ -402,7 +479,8 @@ public TagRuleInner get(String resourceGroupName, String monitorName, String rul } /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -449,80 +527,113 @@ private Mono>> createOrUpdateWithResponseAsync(String } /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of - * {@link Mono}. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String monitorName, String ruleSetName, TagRuleInner resource, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String monitorName, + String ruleSetName, TagRuleInner resource) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); } if (ruleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); } if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); } else { resource.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, resource, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, resource, accept, + Context.NONE); } /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. * @param resource Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a tag rule belonging to NewRelic account. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TagRuleInner> beginCreateOrUpdateAsync(String resourceGroupName, - String monitorName, String ruleSetName, TagRuleInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TagRuleInner.class, TagRuleInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String monitorName, + String ruleSetName, TagRuleInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, resource, accept, context); } /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. * @param resource Resource create parameters. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -530,16 +641,16 @@ private PollerFlux, TagRuleInner> beginCreateOrUpdateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TagRuleInner> beginCreateOrUpdateAsync(String resourceGroupName, - String monitorName, String ruleSetName, TagRuleInner resource, Context context) { - context = this.client.mergeContext(context); + String monitorName, String ruleSetName, TagRuleInner resource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource, context); + = createOrUpdateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TagRuleInner.class, TagRuleInner.class, context); + TagRuleInner.class, TagRuleInner.class, this.client.getContext()); } /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -553,11 +664,15 @@ private PollerFlux, TagRuleInner> beginCreateOrUpdateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TagRuleInner> beginCreateOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, monitorName, ruleSetName, resource); + return this.client.getLroResult(response, TagRuleInner.class, TagRuleInner.class, + Context.NONE); } /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -572,12 +687,15 @@ public SyncPoller, TagRuleInner> beginCreateOrUpdate(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TagRuleInner> beginCreateOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, monitorName, ruleSetName, resource, context); + return this.client.getLroResult(response, TagRuleInner.class, TagRuleInner.class, + context); } /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -596,27 +714,8 @@ private Mono createOrUpdateAsync(String resourceGroupName, String } /** - * Create a TagRule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param ruleSetName Name of the TagRule. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a tag rule belonging to NewRelic account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String monitorName, String ruleSetName, - TagRuleInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -630,11 +729,12 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource) { - return createOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource).block(); + return beginCreateOrUpdate(resourceGroupName, monitorName, ruleSetName, resource).getFinalResult(); } /** - * Create a TagRule. + * Creates a new set of tag rules for a specific New Relic monitor resource, determining which Azure resources are + * monitored based on their tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -649,23 +749,26 @@ public TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, @ServiceMethod(returns = ReturnType.SINGLE) public TagRuleInner createOrUpdate(String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, resource, context).block(); + return beginCreateOrUpdate(resourceGroupName, monitorName, ruleSetName, resource, context).getFinalResult(); } /** - * Delete a TagRule. + * Updates the tag rules for a specific New Relic monitor resource, allowing you to modify the rules that control + * which Azure resources are monitored. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. + * @param properties The resource properties to be 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 Response} on successful completion of {@link Mono}. + * @return a tag rule belonging to NewRelic account along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, - String ruleSetName) { + private Mono> updateWithResponseAsync(String resourceGroupName, String monitorName, + String ruleSetName, TagRuleUpdateInner properties) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -684,130 +787,109 @@ private Mono>> deleteWithResponseAsync(String resource if (ruleSetName == null) { return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, accept, context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a TagRule. + * Updates the tag rules for a specific New Relic monitor resource, allowing you to modify the rules that control + * which Azure resources are monitored. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param context The context to associate with this operation. + * @param properties The resource properties to be 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 Response} on successful completion of {@link Mono}. + * @return a tag rule belonging to NewRelic account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, - String ruleSetName, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - if (ruleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, ruleSetName, accept, context); - } - - /** - * Delete a TagRule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param ruleSetName Name of the TagRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 monitorName, - String ruleSetName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName, ruleSetName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + private Mono updateAsync(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties) { + return updateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete a TagRule. + * Updates the tag rules for a specific New Relic monitor resource, allowing you to modify the rules that control + * which Azure resources are monitored. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. + * @param properties The resource properties to be 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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, - String ruleSetName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, monitorName, ruleSetName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a TagRule. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param monitorName Name of the Monitors resource. - * @param ruleSetName Name of the TagRule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, - String ruleSetName) { - return this.beginDeleteAsync(resourceGroupName, monitorName, ruleSetName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, properties, accept, context); } /** - * Delete a TagRule. + * Updates the tag rules for a specific New Relic monitor resource, allowing you to modify the rules that control + * which Azure resources are monitored. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param context The context to associate with this operation. + * @param properties The resource properties to be 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 long-running operation. + * @return a tag rule belonging to NewRelic account. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, - String ruleSetName, Context context) { - return this.beginDeleteAsync(resourceGroupName, monitorName, ruleSetName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public TagRuleInner update(String resourceGroupName, String monitorName, String ruleSetName, + TagRuleUpdateInner properties) { + return updateWithResponse(resourceGroupName, monitorName, ruleSetName, properties, Context.NONE).getValue(); } /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -815,208 +897,228 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String monitorName, String ruleSetName) { - return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String monitorName, + String ruleSetName) { + 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 (monitorName == null) { + return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String monitorName, String ruleSetName, Context context) { - return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Response deleteWithResponse(String resourceGroupName, String monitorName, String ruleSetName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, accept, Context.NONE); } /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 void delete(String resourceGroupName, String monitorName, String ruleSetName) { - deleteAsync(resourceGroupName, monitorName, ruleSetName).block(); + private Response deleteWithResponse(String resourceGroupName, String monitorName, String ruleSetName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (monitorName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); + } + if (ruleSetName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, accept, context); } /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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.SINGLE) - public void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context) { - deleteAsync(resourceGroupName, monitorName, ruleSetName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String monitorName, + String ruleSetName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, monitorName, ruleSetName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Update a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param properties The resource properties to be 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 a tag rule belonging to NewRelic account along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String monitorName, - String ruleSetName, TagRuleUpdateInner properties) { - 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - if (ruleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, monitorName, ruleSetName, properties, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + String ruleSetName) { + Response response = deleteWithResponse(resourceGroupName, monitorName, ruleSetName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Update a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param properties The resource properties to be 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 a tag rule belonging to NewRelic account along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String monitorName, - String ruleSetName, TagRuleUpdateInner properties, 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 (monitorName == null) { - return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null.")); - } - if (ruleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleSetName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, monitorName, ruleSetName, properties, accept, context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, + String ruleSetName, Context context) { + Response response = deleteWithResponse(resourceGroupName, monitorName, ruleSetName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Update a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param properties The resource properties to be 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 a tag rule belonging to NewRelic account on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String monitorName, String ruleSetName, - TagRuleUpdateInner properties) { - return updateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, properties) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String monitorName, String ruleSetName) { + return beginDeleteAsync(resourceGroupName, monitorName, ruleSetName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param properties The resource properties to be 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 a tag rule belonging to NewRelic account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String monitorName, String ruleSetName, - TagRuleUpdateInner properties, Context context) { - return updateWithResponseAsync(resourceGroupName, monitorName, ruleSetName, properties, context).block(); + public void delete(String resourceGroupName, String monitorName, String ruleSetName) { + beginDelete(resourceGroupName, monitorName, ruleSetName).getFinalResult(); } /** - * Update a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param ruleSetName Name of the TagRule. - * @param properties The resource properties to be 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 a tag rule belonging to NewRelic account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagRuleInner update(String resourceGroupName, String monitorName, String ruleSetName, - TagRuleUpdateInner properties) { - return updateWithResponse(resourceGroupName, monitorName, ruleSetName, properties, Context.NONE).getValue(); + public void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context) { + beginDelete(resourceGroupName, monitorName, ruleSetName, context).getFinalResult(); } /** @@ -1046,6 +1148,33 @@ private Mono> listByNewRelicMonitorResourceNextSingl .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a TagRule list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByNewRelicMonitorResourceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByNewRelicMonitorResourceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1054,23 +1183,25 @@ private Mono> listByNewRelicMonitorResourceNextSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a TagRule list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a TagRule list operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByNewRelicMonitorResourceNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listByNewRelicMonitorResourceNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByNewRelicMonitorResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByNewRelicMonitorResourceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(TagRulesClientImpl.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountInfo.java index 00cbaac977b3..e4175cc2f974 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountInfo.java @@ -22,7 +22,7 @@ public final class AccountInfo implements JsonSerializable { private String accountId; /* - * ingestion key of account + * Credential string. */ private String ingestionKey; @@ -58,7 +58,7 @@ public AccountInfo withAccountId(String accountId) { } /** - * Get the ingestionKey property: ingestion key of account. + * Get the ingestionKey property: Credential string. * * @return the ingestionKey value. */ @@ -67,7 +67,7 @@ public String ingestionKey() { } /** - * Set the ingestionKey property: ingestion key of account. + * Set the ingestionKey property: Credential string. * * @param ingestionKey the ingestionKey value to set. * @return the AccountInfo object itself. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Accounts.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Accounts.java index ded2222f68a8..f5b05c224029 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Accounts.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Accounts.java @@ -12,7 +12,8 @@ */ public interface Accounts { /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -24,7 +25,8 @@ public interface Accounts { PagedIterable list(String userEmail, String location); /** - * List all the existing accounts. + * Lists all the New Relic accounts linked to your email address, helping you understand the existing accounts that + * have been created. * * @param userEmail User Email. * @param location Location for NewRelic. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActivateSaaSParameterRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActivateSaaSParameterRequest.java new file mode 100644 index 000000000000..345489bed89e --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActivateSaaSParameterRequest.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SaaS guid & PublishedId for Activate and Validate SaaS Resource. + */ +@Fluent +public final class ActivateSaaSParameterRequest implements JsonSerializable { + /* + * SaaS guid for Activate and Validate SaaS Resource + */ + private String saasGuid; + + /* + * Publisher Id for NewRelic resource + */ + private String publisherId; + + /** + * Creates an instance of ActivateSaaSParameterRequest class. + */ + public ActivateSaaSParameterRequest() { + } + + /** + * Get the saasGuid property: SaaS guid for Activate and Validate SaaS Resource. + * + * @return the saasGuid value. + */ + public String saasGuid() { + return this.saasGuid; + } + + /** + * Set the saasGuid property: SaaS guid for Activate and Validate SaaS Resource. + * + * @param saasGuid the saasGuid value to set. + * @return the ActivateSaaSParameterRequest object itself. + */ + public ActivateSaaSParameterRequest withSaasGuid(String saasGuid) { + this.saasGuid = saasGuid; + return this; + } + + /** + * Get the publisherId property: Publisher Id for NewRelic resource. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Publisher Id for NewRelic resource. + * + * @param publisherId the publisherId value to set. + * @return the ActivateSaaSParameterRequest object itself. + */ + public ActivateSaaSParameterRequest withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (saasGuid() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property saasGuid in model ActivateSaaSParameterRequest")); + } + if (publisherId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publisherId in model ActivateSaaSParameterRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ActivateSaaSParameterRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("saasGuid", this.saasGuid); + jsonWriter.writeStringField("publisherId", this.publisherId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActivateSaaSParameterRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActivateSaaSParameterRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ActivateSaaSParameterRequest. + */ + public static ActivateSaaSParameterRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActivateSaaSParameterRequest deserializedActivateSaaSParameterRequest = new ActivateSaaSParameterRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saasGuid".equals(fieldName)) { + deserializedActivateSaaSParameterRequest.saasGuid = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedActivateSaaSParameterRequest.publisherId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActivateSaaSParameterRequest; + }); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesGetRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesGetRequest.java index f9ffd7d72560..dfeabab0e7e6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesGetRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesGetRequest.java @@ -24,7 +24,7 @@ public final class AppServicesGetRequest implements JsonSerializable azureResourceIds; /* - * User Email + * Reusable representation of an email address */ private String userEmail; @@ -55,7 +55,7 @@ public AppServicesGetRequest withAzureResourceIds(List azureResourceIds) } /** - * Get the userEmail property: User Email. + * Get the userEmail property: Reusable representation of an email address. * * @return the userEmail value. */ @@ -64,7 +64,7 @@ public String userEmail() { } /** - * Set the userEmail property: User Email. + * Set the userEmail property: Reusable representation of an email address. * * @param userEmail the userEmail value to set. * @return the AppServicesGetRequest object itself. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingCycle.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingCycle.java deleted file mode 100644 index feebfc64e425..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingCycle.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.newrelicobservability.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Different usage type like YEARLY/MONTHLY. - */ -public final class BillingCycle extends ExpandableStringEnum { - /** - * Static value YEARLY for BillingCycle. - */ - public static final BillingCycle YEARLY = fromString("YEARLY"); - - /** - * Static value MONTHLY for BillingCycle. - */ - public static final BillingCycle MONTHLY = fromString("MONTHLY"); - - /** - * Static value WEEKLY for BillingCycle. - */ - public static final BillingCycle WEEKLY = fromString("WEEKLY"); - - /** - * Creates a new instance of BillingCycle value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BillingCycle() { - } - - /** - * Creates or finds a BillingCycle from its string representation. - * - * @param name a name to look for. - * @return the corresponding BillingCycle. - */ - public static BillingCycle fromString(String name) { - return fromString(name, BillingCycle.class); - } - - /** - * Gets known BillingCycle values. - * - * @return known BillingCycle values. - */ - public static Collection values() { - return values(BillingCycle.class); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoes.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoes.java index 16ae0506b26f..8338a5d72fd3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoes.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingInfoes.java @@ -12,7 +12,9 @@ */ public interface BillingInfoes { /** - * Get marketplace info mapped to the given monitor. + * Retrieves marketplace and organization information mapped to the given New Relic monitor resource + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -20,19 +22,22 @@ public interface BillingInfoes { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return marketplace info mapped to the given monitor along with {@link Response}. + * @return marketplace Subscription and Organization details to which resource gets billed into along with + * {@link Response}. */ Response getWithResponse(String resourceGroupName, String monitorName, Context context); /** - * Get marketplace info mapped to the given monitor. + * Retrieves marketplace and organization information mapped to the given New Relic monitor resource + * + * A synchronous resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 marketplace info mapped to the given monitor. + * @return marketplace Subscription and Organization details to which resource gets billed into. */ BillingInfoResponse get(String resourceGroupName, String monitorName); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResources.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResources.java index 43e14ff91e51..ce50c123c28a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResources.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResources.java @@ -14,6 +14,8 @@ public interface ConnectedPartnerResources { /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -26,6 +28,8 @@ public interface ConnectedPartnerResources { /** * List of all active deployments that are associated with the marketplace subscription linked to the given monitor. * + * A synchronous resource action. + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @param body Email Id of the user. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListResponse.java index 7d481faf8208..2721e2fd0d06 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourcesListResponse.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -20,12 +21,12 @@ public final class ConnectedPartnerResourcesListResponse implements JsonSerializable { /* - * Results of a list operation. + * The ConnectedPartnerResourcesListFormat items on this page */ private List value; /* - * Link to the next set of results, if any. + * The link to the next page of items */ private String nextLink; @@ -36,7 +37,7 @@ public ConnectedPartnerResourcesListResponse() { } /** - * Get the value property: Results of a list operation. + * Get the value property: The ConnectedPartnerResourcesListFormat items on this page. * * @return the value value. */ @@ -45,7 +46,7 @@ public List value() { } /** - * Set the value property: Results of a list operation. + * Set the value property: The ConnectedPartnerResourcesListFormat items on this page. * * @param value the value value to set. * @return the ConnectedPartnerResourcesListResponse object itself. @@ -56,7 +57,7 @@ public ConnectedPartnerResourcesListResponse withValue(List e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ConnectedPartnerResourcesListResponse.class); + /** * {@inheritDoc} */ @@ -103,6 +110,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ConnectedPartnerResourcesListResponse if the JsonReader was pointing to an instance of it, * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ConnectedPartnerResourcesListResponse. */ public static ConnectedPartnerResourcesListResponse fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/HostsGetRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/HostsGetRequest.java index 2e2ee7fe1d1e..56f672493a74 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/HostsGetRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/HostsGetRequest.java @@ -24,7 +24,7 @@ public final class HostsGetRequest implements JsonSerializable private List vmIds; /* - * User Email + * Reusable representation of an email address */ private String userEmail; @@ -55,7 +55,7 @@ public HostsGetRequest withVmIds(List vmIds) { } /** - * Get the userEmail property: User Email. + * Get the userEmail property: Reusable representation of an email address. * * @return the userEmail value. */ @@ -64,7 +64,7 @@ public String userEmail() { } /** - * Set the userEmail property: User Email. + * Set the userEmail property: Reusable representation of an email address. * * @param userEmail the userEmail value to set. * @return the HostsGetRequest object itself. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LatestLinkedSaaSResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LatestLinkedSaaSResponse.java new file mode 100644 index 000000000000..3dd52d39c82a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LatestLinkedSaaSResponse.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.resourcemanager.newrelicobservability.fluent.models.LatestLinkedSaaSResponseInner; + +/** + * An immutable client-side representation of LatestLinkedSaaSResponse. + */ +public interface LatestLinkedSaaSResponse { + /** + * Gets the saaSResourceId property: SaaS resource id. + * + * @return the saaSResourceId value. + */ + String saaSResourceId(); + + /** + * Gets the isHiddenSaaS property: Flag indicating if the SaaS resource is hidden. + * + * @return the isHiddenSaaS value. + */ + Boolean isHiddenSaaS(); + + /** + * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.LatestLinkedSaaSResponseInner + * object. + * + * @return the inner object. + */ + LatestLinkedSaaSResponseInner innerModel(); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResourceListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResourceListResponse.java index aae3ce0d7903..0a4f855a8d3f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResourceListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LinkedResourceListResponse.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -19,12 +20,12 @@ @Fluent public final class LinkedResourceListResponse implements JsonSerializable { /* - * Results of a list operation. + * The LinkedResource items on this page */ private List value; /* - * Link to the next set of results, if any. + * The link to the next page of items */ private String nextLink; @@ -35,7 +36,7 @@ public LinkedResourceListResponse() { } /** - * Get the value property: Results of a list operation. + * Get the value property: The LinkedResource items on this page. * * @return the value value. */ @@ -44,7 +45,7 @@ public List value() { } /** - * Set the value property: Results of a list operation. + * Set the value property: The LinkedResource items on this page. * * @param value the value value to set. * @return the LinkedResourceListResponse object itself. @@ -55,7 +56,7 @@ public LinkedResourceListResponse withValue(List value) { } /** - * Get the nextLink property: Link to the next set of results, if any. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,7 +65,7 @@ public String nextLink() { } /** - * Set the nextLink property: Link to the next set of results, if any. + * Set the nextLink property: The link to the next page of items. * * @param nextLink the nextLink value to set. * @return the LinkedResourceListResponse object itself. @@ -80,11 +81,17 @@ public LinkedResourceListResponse withNextLink(String nextLink) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LinkedResourceListResponse")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(LinkedResourceListResponse.class); + /** * {@inheritDoc} */ @@ -102,6 +109,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of LinkedResourceListResponse if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the LinkedResourceListResponse. */ public static LinkedResourceListResponse fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentityType.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentityType.java index f99582aab2d5..b676c3a46261 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentityType.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentityType.java @@ -27,10 +27,10 @@ public final class ManagedServiceIdentityType extends ExpandableStringEnum filteringTags(); /** - * Gets the userEmail property: User Email. + * Gets the userEmail property: Reusable representation of an email address. * * @return the userEmail value. */ diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsRequest.java index 828a11625efb..41be92f4d225 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsRequest.java @@ -18,7 +18,7 @@ @Fluent public final class MetricsRequest implements JsonSerializable { /* - * User Email + * Reusable representation of an email address */ private String userEmail; @@ -29,7 +29,7 @@ public MetricsRequest() { } /** - * Get the userEmail property: User Email. + * Get the userEmail property: Reusable representation of an email address. * * @return the userEmail value. */ @@ -38,7 +38,7 @@ public String userEmail() { } /** - * Set the userEmail property: User Email. + * Set the userEmail property: Reusable representation of an email address. * * @param userEmail the userEmail value to set. * @return the MetricsRequest object itself. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusRequest.java index fa78a76607e5..2f91207f0111 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MetricsStatusRequest.java @@ -24,7 +24,7 @@ public final class MetricsStatusRequest implements JsonSerializable azureResourceIds; /* - * User Email + * Reusable representation of an email address */ private String userEmail; @@ -55,7 +55,7 @@ public MetricsStatusRequest withAzureResourceIds(List azureResourceIds) } /** - * Get the userEmail property: User Email. + * Get the userEmail property: Reusable representation of an email address. * * @return the userEmail value. */ @@ -64,7 +64,7 @@ public String userEmail() { } /** - * Set the userEmail property: User Email. + * Set the userEmail property: Reusable representation of an email address. * * @param userEmail the userEmail value to set. * @return the MetricsStatusRequest object itself. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionProperties.java index 45a7565b4328..a7a06db01d72 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionProperties.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.newrelicobservability.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; @@ -40,6 +41,13 @@ public interface MonitoredSubscriptionProperties { */ SubscriptionList properties(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the name of the resource group. * diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionPropertiesList.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionPropertiesList.java index 2ad12d3124ef..8edd668a69ec 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionPropertiesList.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptionPropertiesList.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,13 +15,13 @@ import java.util.List; /** - * The MonitoredSubscriptionPropertiesList model. + * Paged collection of MonitoredSubscriptionProperties items. */ @Fluent public final class MonitoredSubscriptionPropertiesList implements JsonSerializable { /* - * The value property. + * The MonitoredSubscriptionProperties items on this page */ private List value; @@ -36,7 +37,7 @@ public MonitoredSubscriptionPropertiesList() { } /** - * Get the value property: The value property. + * Get the value property: The MonitoredSubscriptionProperties items on this page. * * @return the value value. */ @@ -45,7 +46,7 @@ public List value() { } /** - * Set the value property: The value property. + * Set the value property: The MonitoredSubscriptionProperties items on this page. * * @param value the value value to set. * @return the MonitoredSubscriptionPropertiesList object itself. @@ -81,11 +82,17 @@ public MonitoredSubscriptionPropertiesList withNextLink(String nextLink) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model MonitoredSubscriptionPropertiesList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(MonitoredSubscriptionPropertiesList.class); + /** * {@inheritDoc} */ @@ -103,6 +110,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of MonitoredSubscriptionPropertiesList if the JsonReader was pointing to an instance of it, * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the MonitoredSubscriptionPropertiesList. */ public static MonitoredSubscriptionPropertiesList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptions.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptions.java index ca59ee5b8b01..75ab3fabcc80 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptions.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredSubscriptions.java @@ -13,19 +13,24 @@ */ public interface MonitoredSubscriptions { /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return paged collection of MonitoredSubscriptionProperties items as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String monitorName); /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * List MonitoredSubscriptionProperties resources by NewRelicMonitorResource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -33,12 +38,15 @@ public interface MonitoredSubscriptions { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return paged collection of MonitoredSubscriptionProperties items as paginated response with + * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String monitorName, Context context); /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -47,14 +55,15 @@ public interface MonitoredSubscriptions { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response}. + * @return a MonitoredSubscriptionProperties along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String monitorName, ConfigurationName configurationName, Context context); /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -62,13 +71,16 @@ Response getWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @return a MonitoredSubscriptionProperties. */ MonitoredSubscriptionProperties get(String resourceGroupName, String monitorName, ConfigurationName configurationName); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -80,7 +92,10 @@ MonitoredSubscriptionProperties get(String resourceGroupName, String monitorName void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -93,32 +108,37 @@ MonitoredSubscriptionProperties get(String resourceGroupName, String monitorName void delete(String resourceGroupName, String monitorName, ConfigurationName configurationName, Context context); /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @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 the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response}. + * @return a MonitoredSubscriptionProperties along with {@link Response}. */ MonitoredSubscriptionProperties getById(String id); /** - * List the subscriptions currently being monitored by the NewRelic monitor resource. + * Lists all the subscriptions currently being monitored by the NewRelic monitor resource. + * + * Get a MonitoredSubscriptionProperties. * * @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 the request to update subscriptions needed to be monitored by the NewRelic monitor resource along with - * {@link Response}. + * @return a MonitoredSubscriptionProperties along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -128,7 +148,10 @@ MonitoredSubscriptionProperties get(String resourceGroupName, String monitorName void deleteById(String id); /** - * Updates the subscriptions that are being monitored by the NewRelic monitor resource. + * Delete subscriptions being monitored by the New Relic monitor resource, removing their observability and + * monitoring capabilities + * + * Delete a MonitoredSubscriptionProperties. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java index 726947bd0e70..9c973718cd8e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java @@ -13,7 +13,7 @@ */ public interface Monitors { /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -23,7 +23,7 @@ public interface Monitors { PagedIterable list(); /** - * List NewRelicMonitorResource resources by subscription ID. + * Lists all New Relic monitor resources either within a specific subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -35,7 +35,7 @@ public interface Monitors { PagedIterable list(Context context); /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -47,7 +47,7 @@ public interface Monitors { PagedIterable listByResourceGroup(String resourceGroupName); /** - * List NewRelicMonitorResource resources by resource group. + * Retrieves a list of all New Relic monitor resources either a specific resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. @@ -60,7 +60,8 @@ public interface Monitors { PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -68,50 +69,53 @@ public interface Monitors { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 NewRelicMonitorResource along with {@link Response}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String monitorName, Context context); /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a NewRelicMonitorResource. + * @return a Monitor Resource by NewRelic. */ NewRelicMonitorResource getByResourceGroup(String resourceGroupName, String monitorName); /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 userEmail, String monitorName); + void delete(String resourceGroupName, String monitorName, String userEmail); /** - * Delete a NewRelicMonitorResource. + * Deletes an existing New Relic monitor resource from your Azure subscription, removing the integration and + * stopping the observability of your Azure resources through New Relic. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param userEmail User Email. * @param monitorName Name of the Monitors resource. + * @param userEmail User Email. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 userEmail, String monitorName, Context context); + void delete(String resourceGroupName, String monitorName, String userEmail, Context context); /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -120,13 +124,13 @@ Response getByResourceGroupWithResponse(String 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 metric rules along with {@link Response}. + * @return set of rules for sending metrics for the Monitor resource along with {@link Response}. */ Response getMetricRulesWithResponse(String resourceGroupName, String monitorName, MetricsRequest request, Context context); /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -134,12 +138,12 @@ Response getMetricRulesWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules. + * @return set of rules for sending metrics for the Monitor resource. */ MetricRules getMetricRules(String resourceGroupName, String monitorName, MetricsRequest request); /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -148,13 +152,13 @@ Response getMetricRulesWithResponse(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status along with {@link Response}. + * @return response of get metrics status Operation along with {@link Response}. */ Response getMetricStatusWithResponse(String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context); /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -162,69 +166,97 @@ Response getMetricStatusWithResponse(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status. + * @return response of get metrics status Operation. */ MetricsStatusResponse getMetricStatus(String resourceGroupName, String monitorName, MetricsStatusRequest request); /** - * List the app service resources currently being monitored by the NewRelic resource. + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + * @return response of get latest linked SaaS resource operation along with {@link Response}. */ - PagedIterable listAppServices(String resourceGroupName, String monitorName, - AppServicesGetRequest request); + Response latestLinkedSaaSWithResponse(String resourceGroupName, String monitorName, + Context context); /** - * List the app service resources currently being monitored by the NewRelic resource. + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the app services get request. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + * @return response of get latest linked SaaS resource operation. */ - PagedIterable listAppServices(String resourceGroupName, String monitorName, - AppServicesGetRequest request, Context context); + LatestLinkedSaaSResponse latestLinkedSaaS(String resourceGroupName, String monitorName); /** - * Switches the billing for NewRelic monitor resource. + * Links a new SaaS to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. - * @param context The context to associate with this operation. + * @param body Link SaaS body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic. */ - Response switchBillingWithResponse(String resourceGroupName, String monitorName, - SwitchBillingRequest request, Context context); + NewRelicMonitorResource linkSaaS(String resourceGroupName, String monitorName, SaaSData body); /** - * Switches the billing for NewRelic monitor resource. + * Links a new SaaS to the newrelic organization of the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. - * @param request The details of the switch billing request. + * @param body Link SaaS body 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 a Monitor Resource by NewRelic. */ - NewRelicMonitorResource switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request); + NewRelicMonitorResource linkSaaS(String resourceGroupName, String monitorName, SaaSData body, Context context); /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request); + + /** + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the app services get request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listAppServices(String resourceGroupName, String monitorName, + AppServicesGetRequest request, Context context); + + /** + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -237,7 +269,8 @@ Response switchBillingWithResponse(String resourceGroup PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request); /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -252,7 +285,35 @@ PagedIterable listHosts(String resourceGroupName, String monitorName, Ho Context context); /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listLinkedResources(String resourceGroupName, String monitorName); + + /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listLinkedResources(String resourceGroupName, String monitorName, Context context); + + /** + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -265,7 +326,8 @@ PagedIterable listHosts(String resourceGroupName, String monitorName, Ho PagedIterable listMonitoredResources(String resourceGroupName, String monitorName); /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -280,32 +342,91 @@ PagedIterable listMonitoredResources(String resourceGroupName Context context); /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors 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 response of a list operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable listLinkedResources(String resourceGroupName, String monitorName); + Response refreshIngestionKeyWithResponse(String resourceGroupName, String monitorName, Context context); + + /** + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors 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. + */ + void refreshIngestionKey(String resourceGroupName, String monitorName); /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Monitor Resource by NewRelic. + */ + NewRelicMonitorResource resubscribe(String resourceGroupName, String monitorName); + + /** + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param body Resubscribe Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return a Monitor Resource by NewRelic. */ - PagedIterable listLinkedResources(String resourceGroupName, String monitorName, Context context); + NewRelicMonitorResource resubscribe(String resourceGroupName, String monitorName, ResubscribeProperties body, + Context context); + + /** + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the switch billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic along with {@link Response}. + */ + Response switchBillingWithResponse(String resourceGroupName, String monitorName, + SwitchBillingRequest request, Context context); + + /** + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param monitorName Name of the Monitors resource. + * @param request The details of the switch billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic. + */ + NewRelicMonitorResource switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request); /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -319,7 +440,8 @@ Response vmHostPayloadWithResponse(String resourceGroupName, Context context); /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -331,25 +453,27 @@ Response vmHostPayloadWithResponse(String resourceGroupName, VMExtensionPayload vmHostPayload(String resourceGroupName, String monitorName); /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @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 NewRelicMonitorResource along with {@link Response}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ NewRelicMonitorResource getById(String id); /** - * Get a NewRelicMonitorResource. + * Retrieves the properties and configuration details of a specific New Relic monitor resource, providing insight + * into its setup and status. * * @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 NewRelicMonitorResource along with {@link Response}. + * @return a Monitor Resource by NewRelic along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java deleted file mode 100644 index 3964b79e475d..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingHeaders.java +++ /dev/null @@ -1,61 +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.newrelicobservability.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The MonitorsSwitchBillingHeaders model. - */ -@Fluent -public final class MonitorsSwitchBillingHeaders { - /* - * The Retry-After property. - */ - private Integer retryAfter; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of MonitorsSwitchBillingHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public MonitorsSwitchBillingHeaders(HttpHeaders rawHeaders) { - String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); - if (retryAfter != null) { - this.retryAfter = Integer.parseInt(retryAfter); - } - } - - /** - * Get the retryAfter property: The Retry-After property. - * - * @return the retryAfter value. - */ - public Integer retryAfter() { - return this.retryAfter; - } - - /** - * Set the retryAfter property: The Retry-After property. - * - * @param retryAfter the retryAfter value to set. - * @return the MonitorsSwitchBillingHeaders object itself. - */ - public MonitorsSwitchBillingHeaders withRetryAfter(Integer retryAfter) { - this.retryAfter = retryAfter; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java deleted file mode 100644 index 90308e08d62f..000000000000 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitorsSwitchBillingResponse.java +++ /dev/null @@ -1,40 +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.newrelicobservability.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; - -/** - * Contains all response data for the switchBilling operation. - */ -public final class MonitorsSwitchBillingResponse - extends ResponseBase { - /** - * Creates an instance of MonitorsSwitchBillingResponse. - * - * @param request the request which resulted in this MonitorsSwitchBillingResponse. - * @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 MonitorsSwitchBillingResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, - NewRelicMonitorResourceInner value, MonitorsSwitchBillingHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public NewRelicMonitorResourceInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java index 2ee32c6ed8c6..c4e04bc1ede6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java @@ -114,6 +114,13 @@ public interface NewRelicMonitorResource { */ PlanData planData(); + /** + * Gets the saaSData property: SaaS details. + * + * @return the saaSData value. + */ + SaaSData saaSData(); + /** * Gets the liftrResourceCategory property: Liftr resource category. * @@ -241,7 +248,7 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithNewRelicAccountProperties, DefinitionStages.WithUserInfo, - DefinitionStages.WithPlanData, DefinitionStages.WithOrgCreationSource, + DefinitionStages.WithPlanData, DefinitionStages.WithSaaSData, DefinitionStages.WithOrgCreationSource, DefinitionStages.WithAccountCreationSource, DefinitionStages.WithSubscriptionState, DefinitionStages.WithSaaSAzureSubscriptionStatus { /** @@ -325,6 +332,19 @@ interface WithPlanData { WithCreate withPlanData(PlanData planData); } + /** + * The stage of the NewRelicMonitorResource definition allowing to specify saaSData. + */ + interface WithSaaSData { + /** + * Specifies the saaSData property: SaaS details. + * + * @param saaSData SaaS details. + * @return the next definition stage. + */ + WithCreate withSaaSData(SaaSData saaSData); + } + /** * The stage of the NewRelicMonitorResource definition allowing to specify orgCreationSource. */ @@ -392,7 +412,7 @@ interface WithSaaSAzureSubscriptionStatus { */ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithNewRelicAccountProperties, UpdateStages.WithUserInfo, UpdateStages.WithPlanData, - UpdateStages.WithOrgCreationSource, UpdateStages.WithAccountCreationSource { + UpdateStages.WithSaaSData, UpdateStages.WithOrgCreationSource, UpdateStages.WithAccountCreationSource { /** * Executes the update request. * @@ -478,6 +498,19 @@ interface WithPlanData { Update withPlanData(PlanData planData); } + /** + * The stage of the NewRelicMonitorResource update allowing to specify saaSData. + */ + interface WithSaaSData { + /** + * Specifies the saaSData property: SaaS details. + * + * @param saaSData SaaS details. + * @return the next definition stage. + */ + Update withSaaSData(SaaSData saaSData); + } + /** * The stage of the NewRelicMonitorResource update allowing to specify orgCreationSource. */ @@ -521,99 +554,122 @@ interface WithAccountCreationSource { NewRelicMonitorResource refresh(Context context); /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param request The details of the get metrics status request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules along with {@link Response}. + * @return set of rules for sending metrics for the Monitor resource along with {@link Response}. */ Response getMetricRulesWithResponse(MetricsRequest request, Context context); /** - * Get metric rules. + * Retrieves the metric rules that are configured in the New Relic monitor resource. * * @param request The details of the get metrics status request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric rules. + * @return set of rules for sending metrics for the Monitor resource. */ MetricRules getMetricRules(MetricsRequest request); /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param request The details of the get metrics status request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status along with {@link Response}. + * @return response of get metrics status Operation along with {@link Response}. */ Response getMetricStatusWithResponse(MetricsStatusRequest request, Context context); /** - * Get metric status. + * Retrieves the metric status that are configured in the New Relic monitor resource. * * @param request The details of the get metrics status request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metric status. + * @return response of get metrics status Operation. */ MetricsStatusResponse getMetricStatus(MetricsStatusRequest request); /** - * List the app service resources currently being monitored by the NewRelic resource. + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. * - * @param request The details of the app services get request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + * @return response of get latest linked SaaS resource operation along with {@link Response}. */ - PagedIterable listAppServices(AppServicesGetRequest request); + Response latestLinkedSaaSWithResponse(Context context); /** - * List the app service resources currently being monitored by the NewRelic resource. + * Returns the latest SaaS linked to the newrelic organization of the underlying monitor. * - * @param request The details of the app services get request. - * @param context The context to associate with this 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 response of get latest linked SaaS resource operation. + */ + LatestLinkedSaaSResponse latestLinkedSaaS(); + + /** + * Links a new SaaS to the newrelic organization of the underlying monitor. + * + * @param body Link SaaS body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + * @return a Monitor Resource by NewRelic. */ - PagedIterable listAppServices(AppServicesGetRequest request, Context context); + NewRelicMonitorResource linkSaaS(SaaSData body); /** - * Switches the billing for NewRelic monitor resource. + * Links a new SaaS to the newrelic organization of the underlying monitor. * - * @param request The details of the switch billing request. + * @param body Link SaaS body 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 a Monitor Resource by NewRelic. */ - Response switchBillingWithResponse(SwitchBillingRequest request, Context context); + NewRelicMonitorResource linkSaaS(SaaSData body, Context context); /** - * Switches the billing for NewRelic monitor resource. + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. * - * @param request The details of the switch billing request. + * @param request The details of the app services get request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic. + * @return response of a list app services Operation as paginated response with {@link PagedIterable}. */ - NewRelicMonitorResource switchBilling(SwitchBillingRequest request); + PagedIterable listAppServices(AppServicesGetRequest request); /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Lists the app service resources currently being monitored by the New Relic resource, helping you understand which + * app services are under monitoring. + * + * @param request The details of the app services get request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list app services Operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listAppServices(AppServicesGetRequest request, Context context); + + /** + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param request The details of the Hosts get request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -624,7 +680,8 @@ interface WithAccountCreationSource { PagedIterable listHosts(HostsGetRequest request); /** - * List the compute vm resources currently being monitored by the NewRelic resource. + * Lists all VM resources currently being monitored by the New Relic monitor resource, helping you manage + * observability. * * @param request The details of the Hosts get request. * @param context The context to associate with this operation. @@ -636,7 +693,30 @@ interface WithAccountCreationSource { PagedIterable listHosts(HostsGetRequest request, Context context); /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listLinkedResources(); + + /** + * Lists all Azure resources that are linked to the same New Relic organization as the specified monitor resource, + * helping you understand the scope of integration. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of a list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listLinkedResources(Context context); + + /** + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -646,7 +726,8 @@ interface WithAccountCreationSource { PagedIterable listMonitoredResources(); /** - * List the resources currently being monitored by the NewRelic monitor resource. + * Lists all Azure resources that are currently being monitored by the specified New Relic monitor resource, + * providing insight into the coverage of your observability setup. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -658,27 +739,75 @@ interface WithAccountCreationSource { PagedIterable listMonitoredResources(Context context); /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable listLinkedResources(); + Response refreshIngestionKeyWithResponse(Context context); + + /** + * Refreshes the ingestion key for all monitors linked to the same account associated to the underlying monitor. + * + * @throws com.azure.core.management.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 refreshIngestionKey(); /** - * List all Azure resources associated to the same NewRelic organization and account as the target resource. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. * + * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic. + */ + NewRelicMonitorResource resubscribe(); + + /** + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace + * + * A long-running resource action. + * + * @param body Resubscribe Properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return a Monitor Resource by NewRelic. */ - PagedIterable listLinkedResources(Context context); + NewRelicMonitorResource resubscribe(ResubscribeProperties body, Context context); + + /** + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. + * + * @param request The details of the switch billing request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic along with {@link Response}. + */ + Response switchBillingWithResponse(SwitchBillingRequest request, Context context); + + /** + * Switches the billing for the New Relic Monitor resource to be billed by Azure Marketplace. + * + * @param request The details of the switch billing request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Monitor Resource by NewRelic. + */ + NewRelicMonitorResource switchBilling(SwitchBillingRequest request); /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -689,7 +818,8 @@ interface WithAccountCreationSource { Response vmHostPayloadWithResponse(Context context); /** - * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. + * Returns the payload that needs to be passed in the request body for installing the New Relic agent on a VM, + * providing the necessary configuration details. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceUpdate.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceUpdate.java index cb2401c5c93b..2ca577e307a7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceUpdate.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceUpdate.java @@ -158,6 +158,29 @@ public NewRelicMonitorResourceUpdate withPlanData(PlanData planData) { return this; } + /** + * Get the saaSData property: SaaS details. + * + * @return the saaSData value. + */ + public SaaSData saaSData() { + return this.innerProperties() == null ? null : this.innerProperties().saaSData(); + } + + /** + * Set the saaSData property: SaaS details. + * + * @param saaSData the saaSData value to set. + * @return the NewRelicMonitorResourceUpdate object itself. + */ + public NewRelicMonitorResourceUpdate withSaaSData(SaaSData saaSData) { + if (this.innerProperties() == null) { + this.innerProperties = new NewRelicMonitorResourceUpdateProperties(); + } + this.innerProperties().withSaaSData(saaSData); + return this; + } + /** * Get the orgCreationSource property: Source of org creation. * diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Organizations.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Organizations.java index 691a8c4b7900..11528bf9848b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Organizations.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Organizations.java @@ -12,7 +12,8 @@ */ public interface Organizations { /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. @@ -24,7 +25,8 @@ public interface Organizations { PagedIterable list(String userEmail, String location); /** - * List all the existing organizations. + * Lists all the New Relic organizations linked to your email address, helping you understand the existing + * organizations that have been created. * * @param userEmail User Email. * @param location Location for NewRelic. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanData.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanData.java index f272e0357177..0c5e84025a0e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanData.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanData.java @@ -25,9 +25,9 @@ public final class PlanData implements JsonSerializable { private UsageType usageType; /* - * Different billing cycles like MONTHLY/WEEKLY. this could be enum + * Different billing cycles like Monthly/Weekly. */ - private BillingCycle billingCycle; + private String billingCycle; /* * plan id as published by NewRelic @@ -66,21 +66,21 @@ public PlanData withUsageType(UsageType usageType) { } /** - * Get the billingCycle property: Different billing cycles like MONTHLY/WEEKLY. this could be enum. + * Get the billingCycle property: Different billing cycles like Monthly/Weekly. * * @return the billingCycle value. */ - public BillingCycle billingCycle() { + public String billingCycle() { return this.billingCycle; } /** - * Set the billingCycle property: Different billing cycles like MONTHLY/WEEKLY. this could be enum. + * Set the billingCycle property: Different billing cycles like Monthly/Weekly. * * @param billingCycle the billingCycle value to set. * @return the PlanData object itself. */ - public PlanData withBillingCycle(BillingCycle billingCycle) { + public PlanData withBillingCycle(String billingCycle) { this.billingCycle = billingCycle; return this; } @@ -140,7 +140,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("usageType", this.usageType == null ? null : this.usageType.toString()); - jsonWriter.writeStringField("billingCycle", this.billingCycle == null ? null : this.billingCycle.toString()); + jsonWriter.writeStringField("billingCycle", this.billingCycle); jsonWriter.writeStringField("planDetails", this.planDetails); jsonWriter.writeStringField("effectiveDate", this.effectiveDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.effectiveDate)); @@ -165,7 +165,7 @@ public static PlanData fromJson(JsonReader jsonReader) throws IOException { if ("usageType".equals(fieldName)) { deserializedPlanData.usageType = UsageType.fromString(reader.getString()); } else if ("billingCycle".equals(fieldName)) { - deserializedPlanData.billingCycle = BillingCycle.fromString(reader.getString()); + deserializedPlanData.billingCycle = reader.getString(); } else if ("planDetails".equals(fieldName)) { deserializedPlanData.planDetails = reader.getString(); } else if ("effectiveDate".equals(fieldName)) { diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Plans.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Plans.java index bc1920e6e8c8..d423041be17c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Plans.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Plans.java @@ -12,7 +12,7 @@ */ public interface Plans { /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -21,7 +21,7 @@ public interface Plans { PagedIterable list(); /** - * List plans data. + * Lists the plans data linked to your organization, providing an overview of the available plans. * * @param accountId Account Id. * @param organizationId Organization Id. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ResubscribeProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ResubscribeProperties.java new file mode 100644 index 000000000000..ae5e979f8ade --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ResubscribeProperties.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resubscribe Properties. + */ +@Fluent +public final class ResubscribeProperties implements JsonSerializable { + /* + * Newly selected plan Id to create the new Marketplace subscription for Resubscribe + */ + private String planId; + + /* + * Newly selected term Id to create the new Marketplace subscription for Resubscribe + */ + private String termId; + + /* + * Newly selected Azure Subscription Id in which the new Marketplace subscription will be created for Resubscribe + */ + private String subscriptionId; + + /* + * Newly selected Azure resource group in which the new Marketplace subscription will be created for Resubscribe + */ + private String resourceGroup; + + /* + * Organization Id of the NewRelic Organization that needs to be resubscribed + */ + private String organizationId; + + /* + * Publisher Id of the NewRelic offer that needs to be resubscribed + */ + private String publisherId; + + /* + * Offer Id of the NewRelic offer that needs to be resubscribed + */ + private String offerId; + + /** + * Creates an instance of ResubscribeProperties class. + */ + public ResubscribeProperties() { + } + + /** + * Get the planId property: Newly selected plan Id to create the new Marketplace subscription for Resubscribe. + * + * @return the planId value. + */ + public String planId() { + return this.planId; + } + + /** + * Set the planId property: Newly selected plan Id to create the new Marketplace subscription for Resubscribe. + * + * @param planId the planId value to set. + * @return the ResubscribeProperties object itself. + */ + public ResubscribeProperties withPlanId(String planId) { + this.planId = planId; + return this; + } + + /** + * Get the termId property: Newly selected term Id to create the new Marketplace subscription for Resubscribe. + * + * @return the termId value. + */ + public String termId() { + return this.termId; + } + + /** + * Set the termId property: Newly selected term Id to create the new Marketplace subscription for Resubscribe. + * + * @param termId the termId value to set. + * @return the ResubscribeProperties object itself. + */ + public ResubscribeProperties withTermId(String termId) { + this.termId = termId; + return this; + } + + /** + * Get the subscriptionId property: Newly selected Azure Subscription Id in which the new Marketplace subscription + * will be created for Resubscribe. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Newly selected Azure Subscription Id in which the new Marketplace subscription + * will be created for Resubscribe. + * + * @param subscriptionId the subscriptionId value to set. + * @return the ResubscribeProperties object itself. + */ + public ResubscribeProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Get the resourceGroup property: Newly selected Azure resource group in which the new Marketplace subscription + * will be created for Resubscribe. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Newly selected Azure resource group in which the new Marketplace subscription + * will be created for Resubscribe. + * + * @param resourceGroup the resourceGroup value to set. + * @return the ResubscribeProperties object itself. + */ + public ResubscribeProperties withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the organizationId property: Organization Id of the NewRelic Organization that needs to be resubscribed. + * + * @return the organizationId value. + */ + public String organizationId() { + return this.organizationId; + } + + /** + * Set the organizationId property: Organization Id of the NewRelic Organization that needs to be resubscribed. + * + * @param organizationId the organizationId value to set. + * @return the ResubscribeProperties object itself. + */ + public ResubscribeProperties withOrganizationId(String organizationId) { + this.organizationId = organizationId; + return this; + } + + /** + * Get the publisherId property: Publisher Id of the NewRelic offer that needs to be resubscribed. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Set the publisherId property: Publisher Id of the NewRelic offer that needs to be resubscribed. + * + * @param publisherId the publisherId value to set. + * @return the ResubscribeProperties object itself. + */ + public ResubscribeProperties withPublisherId(String publisherId) { + this.publisherId = publisherId; + return this; + } + + /** + * Get the offerId property: Offer Id of the NewRelic offer that needs to be resubscribed. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Set the offerId property: Offer Id of the NewRelic offer that needs to be resubscribed. + * + * @param offerId the offerId value to set. + * @return the ResubscribeProperties object itself. + */ + public ResubscribeProperties withOfferId(String offerId) { + this.offerId = offerId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeStringField("termId", this.termId); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("resourceGroup", this.resourceGroup); + jsonWriter.writeStringField("organizationId", this.organizationId); + jsonWriter.writeStringField("publisherId", this.publisherId); + jsonWriter.writeStringField("offerId", this.offerId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResubscribeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResubscribeProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResubscribeProperties. + */ + public static ResubscribeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResubscribeProperties deserializedResubscribeProperties = new ResubscribeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("planId".equals(fieldName)) { + deserializedResubscribeProperties.planId = reader.getString(); + } else if ("termId".equals(fieldName)) { + deserializedResubscribeProperties.termId = reader.getString(); + } else if ("subscriptionId".equals(fieldName)) { + deserializedResubscribeProperties.subscriptionId = reader.getString(); + } else if ("resourceGroup".equals(fieldName)) { + deserializedResubscribeProperties.resourceGroup = reader.getString(); + } else if ("organizationId".equals(fieldName)) { + deserializedResubscribeProperties.organizationId = reader.getString(); + } else if ("publisherId".equals(fieldName)) { + deserializedResubscribeProperties.publisherId = reader.getString(); + } else if ("offerId".equals(fieldName)) { + deserializedResubscribeProperties.offerId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResubscribeProperties; + }); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaS.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaS.java new file mode 100644 index 000000000000..a09b67cba136 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaS.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SaaS. + */ +public interface SaaS { + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param request The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details along with {@link Response}. + */ + Response activateResourceWithResponse(ActivateSaaSParameterRequest request, + Context context); + + /** + * Resolve the token to get the SaaS resource ID and activate the SaaS resource. + * + * @param request The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return marketplace SaaS resource details. + */ + SaaSResourceDetailsResponse activateResource(ActivateSaaSParameterRequest request); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaSData.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaSData.java new file mode 100644 index 000000000000..39dd2aaa4af1 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaSData.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SaaS details. + */ +@Fluent +public final class SaaSData implements JsonSerializable { + /* + * SaaS resource id + */ + private String saaSResourceId; + + /** + * Creates an instance of SaaSData class. + */ + public SaaSData() { + } + + /** + * Get the saaSResourceId property: SaaS resource id. + * + * @return the saaSResourceId value. + */ + public String saaSResourceId() { + return this.saaSResourceId; + } + + /** + * Set the saaSResourceId property: SaaS resource id. + * + * @param saaSResourceId the saaSResourceId value to set. + * @return the SaaSData object itself. + */ + public SaaSData withSaaSResourceId(String saaSResourceId) { + this.saaSResourceId = saaSResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("saaSResourceId", this.saaSResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SaaSData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SaaSData if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SaaSData. + */ + public static SaaSData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SaaSData deserializedSaaSData = new SaaSData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saaSResourceId".equals(fieldName)) { + deserializedSaaSData.saaSResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSaaSData; + }); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaSResourceDetailsResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaSResourceDetailsResponse.java new file mode 100644 index 000000000000..6084bb92f365 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SaaSResourceDetailsResponse.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.newrelicobservability.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.SaaSResourceDetailsResponseInner; + +/** + * An immutable client-side representation of SaaSResourceDetailsResponse. + */ +public interface SaaSResourceDetailsResponse { + /** + * 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 saasId property: Id of the Marketplace SaaS Resource. + * + * @return the saasId value. + */ + String saasId(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.newrelicobservability.fluent.models.SaaSResourceDetailsResponseInner + * object. + * + * @return the inner object. + */ + SaaSResourceDetailsResponseInner innerModel(); +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SwitchBillingRequest.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SwitchBillingRequest.java index 32c61191bba2..189db1af2f85 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SwitchBillingRequest.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SwitchBillingRequest.java @@ -33,7 +33,7 @@ public final class SwitchBillingRequest implements JsonSerializable listByNewRelicMonitorResource(String resourceGroupName, String monitorName); /** - * List TagRule resources by NewRelicMonitorResource. + * Lists all tag rules associated with a specific New Relic monitor resource, helping you manage and audit the rules + * that control resource monitoring. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -38,7 +40,8 @@ public interface TagRules { PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName, Context context); /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -47,13 +50,14 @@ public interface TagRules { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 TagRule along with {@link Response}. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ Response getWithResponse(String resourceGroupName, String monitorName, String ruleSetName, Context context); /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -61,12 +65,13 @@ Response getWithResponse(String resourceGroupName, String monitorName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 TagRule. + * @return a tag rule belonging to NewRelic account. */ TagRule get(String resourceGroupName, String monitorName, String ruleSetName); /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -78,7 +83,8 @@ Response getWithResponse(String resourceGroupName, String monitorName, void delete(String resourceGroupName, String monitorName, String ruleSetName); /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -91,30 +97,33 @@ Response getWithResponse(String resourceGroupName, String monitorName, void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context); /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @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 TagRule along with {@link Response}. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ TagRule getById(String id); /** - * Get a TagRule. + * Retrieves the details of the tag rules for a specific New Relic monitor resource, providing insight into its + * setup and status. * * @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 TagRule along with {@link Response}. + * @return a tag rule belonging to NewRelic account along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +133,8 @@ Response getWithResponse(String resourceGroupName, String monitorName, void deleteById(String id); /** - * Delete a TagRule. + * Deletes a tag rule set for a given New Relic monitor resource, removing fine-grained control over observability + * based on resource tags. * * @param id the resource ID. * @param context The context to associate with this operation. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserInfo.java index 606178ef5cbb..cf1c61cdc38e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserInfo.java @@ -27,7 +27,7 @@ public final class UserInfo implements JsonSerializable { private String lastName; /* - * User Email + * Reusable representation of an email address */ private String emailAddress; @@ -88,7 +88,7 @@ public UserInfo withLastName(String lastName) { } /** - * Get the emailAddress property: User Email. + * Get the emailAddress property: Reusable representation of an email address. * * @return the emailAddress value. */ @@ -97,7 +97,7 @@ public String emailAddress() { } /** - * Set the emailAddress property: User Email. + * Set the emailAddress property: Reusable representation of an email address. * * @param emailAddress the emailAddress value to set. * @return the UserInfo object itself. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/proxy-config.json b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/proxy-config.json index a384731a470b..c481c718da74 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/proxy-config.json +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.newrelicobservability.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.newrelicobservability.implementation.BillingInfoesClientImpl$BillingInfoesService"],["com.azure.resourcemanager.newrelicobservability.implementation.ConnectedPartnerResourcesClientImpl$ConnectedPartnerResourcesService"],["com.azure.resourcemanager.newrelicobservability.implementation.MonitoredSubscriptionsClientImpl$MonitoredSubscriptionsService"],["com.azure.resourcemanager.newrelicobservability.implementation.MonitorsClientImpl$MonitorsService"],["com.azure.resourcemanager.newrelicobservability.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.newrelicobservability.implementation.OrganizationsClientImpl$OrganizationsService"],["com.azure.resourcemanager.newrelicobservability.implementation.PlansClientImpl$PlansService"],["com.azure.resourcemanager.newrelicobservability.implementation.TagRulesClientImpl$TagRulesService"]] \ No newline at end of file +[["com.azure.resourcemanager.newrelicobservability.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.newrelicobservability.implementation.BillingInfoesClientImpl$BillingInfoesService"],["com.azure.resourcemanager.newrelicobservability.implementation.ConnectedPartnerResourcesClientImpl$ConnectedPartnerResourcesService"],["com.azure.resourcemanager.newrelicobservability.implementation.MonitoredSubscriptionsClientImpl$MonitoredSubscriptionsService"],["com.azure.resourcemanager.newrelicobservability.implementation.MonitorsClientImpl$MonitorsService"],["com.azure.resourcemanager.newrelicobservability.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.newrelicobservability.implementation.OrganizationsClientImpl$OrganizationsService"],["com.azure.resourcemanager.newrelicobservability.implementation.PlansClientImpl$PlansService"],["com.azure.resourcemanager.newrelicobservability.implementation.SaaSClientImpl$SaaSService"],["com.azure.resourcemanager.newrelicobservability.implementation.TagRulesClientImpl$TagRulesService"]] \ No newline at end of file diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/azure-resourcemanager-newrelicobservability.properties b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/azure-resourcemanager-newrelicobservability.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/azure-resourcemanager-newrelicobservability.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java index 0fa7cfb503cf..dc2d89510ef7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListSamples.java @@ -9,7 +9,8 @@ */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Accounts_List_MinimumSet_Gen.json */ /** @@ -23,7 +24,8 @@ public static void accountsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Accounts_List_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoGetSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoGetSamples.java index e9162f8cee18..6fd2f3117bbe 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoGetSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoGetSamples.java @@ -10,7 +10,8 @@ public final class BillingInfoGetSamples { /* * x-ms-original-file: - * specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/BillingInfo_Get.json + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * BillingInfo_Get.json */ /** * Sample code: BillingInfo_Get. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListSamples.java index aabca36166aa..65d3eca142a0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListSamples.java @@ -9,7 +9,8 @@ */ public final class ConnectedPartnerResourcesListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * ConnectedPartnerResources_List.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateOrUpdateSamples.java similarity index 72% rename from sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateSamples.java rename to sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateOrUpdateSamples.java index f22bd2447d04..123280a7d738 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateOrUpdateSamples.java @@ -7,12 +7,13 @@ import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; /** - * Samples for MonitoredSubscriptions CreateorUpdate. + * Samples for MonitoredSubscriptions CreateOrUpdate. */ -public final class MonitoredSubscriptionsCreateorUpdateSamples { +public final class MonitoredSubscriptionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ - * MonitoredSubscriptions_CreateorUpdate.json + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * MonitoredSubscriptions_CreateOrUpdate.json */ /** * Sample code: Monitors_AddMonitoredSubscriptions. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsDeleteSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsDeleteSamples.java index dda1ebeffa06..eef4658ca554 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsDeleteSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsDeleteSamples.java @@ -11,7 +11,8 @@ */ public final class MonitoredSubscriptionsDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * MonitoredSubscriptions_Delete.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetSamples.java index d11b01e302af..b82dd96db6dc 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetSamples.java @@ -11,7 +11,8 @@ */ public final class MonitoredSubscriptionsGetSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * MonitoredSubscriptions_Get.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListSamples.java index b791d83fb4e8..860414389fa3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListSamples.java @@ -9,7 +9,8 @@ */ public final class MonitoredSubscriptionsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * MonitoredSubscriptions_List.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsUpdateSamples.java index e7943bd2125c..4c43bb39849a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsUpdateSamples.java @@ -12,7 +12,8 @@ */ public final class MonitoredSubscriptionsUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * MonitoredSubscriptions_Update.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java index f963a84b8a06..376cfe6e101f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsCreateOrUpdateSamples.java @@ -6,7 +6,6 @@ import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.AccountInfo; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; @@ -15,6 +14,7 @@ import com.azure.resourcemanager.newrelicobservability.models.OrganizationInfo; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; import com.azure.resourcemanager.newrelicobservability.models.SingleSignOnStates; import com.azure.resourcemanager.newrelicobservability.models.UsageType; import com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity; @@ -28,7 +28,8 @@ */ public final class MonitorsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_CreateOrUpdate_MaximumSet_Gen.json */ /** @@ -61,9 +62,11 @@ public static void monitorsCreateOrUpdateMaximumSetGen( .withPhoneNumber("krf") .withCountry("hslqnwdanrconqyekwbnttaetv")) .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) + .withBillingCycle("Yearly") .withPlanDetails("tbbiaga") .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withSaaSData(new SaaSData().withSaaSResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/Microsoft.SaaS/resources/abcd")) .withOrgCreationSource(OrgCreationSource.LIFTR) .withAccountCreationSource(AccountCreationSource.LIFTR) .withSubscriptionState("Suspended") diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java index e33d392f62b4..3d7577771f94 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteSamples.java @@ -9,7 +9,8 @@ */ public final class MonitorsDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_Delete_MinimumSet_Gen.json */ /** @@ -20,12 +21,13 @@ public final class MonitorsDeleteSamples { public static void monitorsDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { manager.monitors() - .delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + .delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "ruxvg@xqkmdhrnoo.hlmbpm", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_Delete_MaximumSet_Gen.json */ /** @@ -36,7 +38,7 @@ public static void monitorsDeleteMinimumSetGen( public static void monitorsDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { manager.monitors() - .delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + .delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "ruxvg@xqkmdhrnoo.hlmbpm", com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java index caf1a6615ccb..2eb017ef2ad4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class MonitorsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_Get_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java index 19ac552fbf44..2202db56a69d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesSamples.java @@ -11,7 +11,8 @@ */ public final class MonitorsGetMetricRulesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_GetMetricRules_MinimumSet_Gen.json */ /** @@ -27,7 +28,8 @@ public static void monitorsGetMetricRulesMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_GetMetricRules_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java index 3115d777c5d7..f134ab241e25 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java @@ -12,7 +12,8 @@ */ public final class MonitorsGetMetricStatusSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_GetMetricStatus_MinimumSet_Gen.json */ /** @@ -31,7 +32,8 @@ public static void monitorsGetMetricStatusMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_GetMetricStatus_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLatestLinkedSaaSSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLatestLinkedSaaSSamples.java new file mode 100644 index 000000000000..3a11f683e768 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLatestLinkedSaaSSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +/** + * Samples for Monitors LatestLinkedSaaS. + */ +public final class MonitorsLatestLinkedSaaSSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_LatestLinkedSaaS_MinimumSet_Gen.json + */ + /** + * Sample code: Monitors_LatestLinkedSaaS_MinimumSet_Gen. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsLatestLinkedSaaSMinimumSetGen( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors() + .latestLinkedSaaSWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_LatestLinkedSaaS_MaximumSet_Gen.json + */ + /** + * Sample code: Monitors_LatestLinkedSaaS_MaximumSet_Gen. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsLatestLinkedSaaSMaximumSetGen( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors() + .latestLinkedSaaSWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLinkSaaSSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLinkSaaSSamples.java new file mode 100644 index 000000000000..6d69642c3326 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLinkSaaSSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; + +/** + * Samples for Monitors LinkSaaS. + */ +public final class MonitorsLinkSaaSSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_LinkSaaS.json + */ + /** + * Sample code: Monitors_LinkSaaS. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void + monitorsLinkSaaS(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors() + .linkSaaS("myResourceGroup", "myMonitor", new SaaSData().withSaaSResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/Microsoft.SaaS/resources/abcd"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java index c2268bddffca..c1c7988adc2e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java @@ -12,7 +12,8 @@ */ public final class MonitorsListAppServicesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListAppServices_MaximumSet_Gen.json */ /** @@ -31,7 +32,8 @@ public static void monitorsListAppServicesMaximumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListAppServices_MinimumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java index f32f6675d047..e7c3e309061b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class MonitorsListByResourceGroupSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListByResourceGroup_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java index ae8c0bc0836c..0d241647f615 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java @@ -12,7 +12,8 @@ */ public final class MonitorsListHostsSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListHosts_MinimumSet_Gen.json */ /** @@ -30,7 +31,8 @@ public static void monitorsListHostsMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListHosts_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesSamples.java index 7010b26e26bd..c476b3ef5c05 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesSamples.java @@ -10,8 +10,8 @@ public final class MonitorsListLinkedResourcesSamples { /* * x-ms-original-file: - * specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/LinkedResources_List. - * json + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * LinkedResources_List.json */ /** * Sample code: Monitors_ListLinkedResources. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java index 85a54990ace6..85b87c5d1747 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java @@ -9,7 +9,8 @@ */ public final class MonitorsListMonitoredResourcesSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListMonitoredResources_MinimumSet_Gen.json */ /** @@ -24,7 +25,8 @@ public static void monitorsListMonitoredResourcesMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListMonitoredResources_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java index d4462aa2861c..127bfe544c8a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListSamples.java @@ -9,7 +9,8 @@ */ public final class MonitorsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_ListBySubscription_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsRefreshIngestionKeySamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsRefreshIngestionKeySamples.java new file mode 100644 index 000000000000..1da06ecbd8e8 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsRefreshIngestionKeySamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +/** + * Samples for Monitors RefreshIngestionKey. + */ +public final class MonitorsRefreshIngestionKeySamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_RefreshIngestionKey.json + */ + /** + * Sample code: Monitors_RefreshIngestionKey. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void monitorsRefreshIngestionKey( + com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors() + .refreshIngestionKeyWithResponse("myResourceGroup", "myMonitor", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsResubscribeSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsResubscribeSamples.java new file mode 100644 index 000000000000..34c43398165d --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsResubscribeSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +/** + * Samples for Monitors Resubscribe. + */ +public final class MonitorsResubscribeSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ + * Monitors_Resubscribe.json + */ + /** + * Sample code: Monitors_Resubscribe. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void + monitorsResubscribe(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.monitors().resubscribe("myResourceGroup", "myMonitor", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java index 4090f02b2adf..90586d80f071 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsSwitchBillingSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.newrelicobservability.generated; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; import com.azure.resourcemanager.newrelicobservability.models.UsageType; @@ -15,7 +14,8 @@ */ public final class MonitorsSwitchBillingSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_SwitchBilling_MinimumSet_Gen.json */ /** @@ -31,7 +31,8 @@ public static void monitorsSwitchBillingMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_SwitchBilling_MaximumSet_Gen.json */ /** @@ -47,7 +48,7 @@ public static void monitorsSwitchBillingMaximumSetGen( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") .withOrganizationId("k") .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) + .withBillingCycle("Yearly") .withPlanDetails("tbbiaga") .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java index 172bbc349a46..2330066d1739 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java @@ -6,7 +6,6 @@ import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.AccountInfo; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType; import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; @@ -29,7 +28,8 @@ */ public final class MonitorsUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_Update_MaximumSet_Gen.json */ /** @@ -62,7 +62,7 @@ public static void monitorsUpdateMaximumSetGen( .withPhoneNumber("krf") .withCountry("hslqnwdanrconqyekwbnttaetv")) .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.YEARLY) + .withBillingCycle("Yearly") .withPlanDetails("tbbiaga") .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) .withOrgCreationSource(OrgCreationSource.LIFTR) diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java index 0a8f98ffe524..4a582262607f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsVmHostPayloadSamples.java @@ -9,7 +9,8 @@ */ public final class MonitorsVmHostPayloadSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_VmHostPayload_MinimumSet_Gen.json */ /** @@ -24,7 +25,8 @@ public static void monitorsVmHostPayloadMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Monitors_VmHostPayload_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java index 1f94f848d7c1..8d5654e7dcb0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListSamples.java @@ -9,7 +9,8 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Operations_List_MinimumSet_Gen.json */ /** @@ -23,7 +24,8 @@ public static void operationsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Operations_List_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java index 99ba2b9bf7f6..8345345266c2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListSamples.java @@ -9,7 +9,8 @@ */ public final class OrganizationsListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Organizations_List_MinimumSet_Gen.json */ /** @@ -23,7 +24,8 @@ public static void organizationsListMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Organizations_List_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java index 4d834629fc24..50f79c2e6cb0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListSamples.java @@ -9,7 +9,8 @@ */ public final class PlansListSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Plans_List_MaximumSet_Gen.json */ /** @@ -23,7 +24,8 @@ public final class PlansListSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * Plans_List_MinimumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSActivateResourceSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSActivateResourceSamples.java new file mode 100644 index 000000000000..c68827d2fd73 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSActivateResourceSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.resourcemanager.newrelicobservability.models.ActivateSaaSParameterRequest; + +/** + * Samples for SaaS ActivateResource. + */ +public final class SaaSActivateResourceSamples { + /* + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ActivateSaaS. + * json + */ + /** + * Sample code: ActivateSaaS. + * + * @param manager Entry point to NewRelicObservabilityManager. + */ + public static void + activateSaaS(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { + manager.saaS() + .activateResourceWithResponse( + new ActivateSaaSParameterRequest().withSaasGuid("00000000-0000-0000-0000-000005430000") + .withPublisherId("publisherId"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java index 1b92c64f14a7..de552b583f01 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateSamples.java @@ -18,7 +18,8 @@ */ public final class TagRulesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_CreateOrUpdate_MaximumSet_Gen.json */ /** @@ -46,7 +47,8 @@ public static void tagRulesCreateOrUpdateMaximumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_CreateOrUpdate_MinimumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java index aad10088dbe7..de78b519240c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteSamples.java @@ -9,7 +9,8 @@ */ public final class TagRulesDeleteSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Delete_MinimumSet_Gen.json */ /** @@ -25,7 +26,8 @@ public static void tagRulesDeleteMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Delete_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java index 5017e02836c5..7d9a4d06c718 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetSamples.java @@ -9,7 +9,8 @@ */ public final class TagRulesGetSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Get_MinimumSet_Gen.json */ /** @@ -25,7 +26,8 @@ public final class TagRulesGetSamples { } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Get_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java index 23dbdf45b781..9211189ca6b2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceSamples.java @@ -9,7 +9,8 @@ */ public final class TagRulesListByNewRelicMonitorResourceSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json */ /** @@ -25,7 +26,8 @@ public static void tagRulesListByNewRelicMonitorResourceMinimumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java index 9249ac8a0748..aec8af3d8ac8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesUpdateSamples.java @@ -19,7 +19,8 @@ */ public final class TagRulesUpdateSamples { /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Update_MaximumSet_Gen.json */ /** @@ -49,7 +50,8 @@ public static void tagRulesUpdateMaximumSetGen( } /* - * x-ms-original-file: specification/newrelic/resource-manager/NewRelic.Observability/stable/2024-01-01/examples/ + * x-ms-original-file: + * specification/newrelic/resource-manager/NewRelic.Observability/preview/2025-05-01-preview/examples/ * TagRules_Update_MinimumSet_Gen.json */ /** diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java index ba1c02a87ee5..c8d594e5813a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AccountsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.AccountResource; @@ -22,21 +22,21 @@ public final class AccountsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"organizationId\":\"bnxknalaulppg\",\"accountId\":\"tpnapnyiropuhpig\",\"accountName\":\"gylgqgitxmedjvcs\",\"region\":\"n\"},\"id\":\"wncwzzhxgktrmg\",\"name\":\"cnapkteoell\",\"type\":\"pt\"}]}"; + = "{\"value\":[{\"properties\":{\"organizationId\":\"pigvpgylgqgitx\",\"accountId\":\"djvcsl\",\"accountName\":\"qwwncw\",\"region\":\"hxg\"},\"id\":\"rmgucnap\",\"name\":\"t\",\"type\":\"oellwp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.accounts().list("iidzyexzne", "ixhnrztf", com.azure.core.util.Context.NONE); + = manager.accounts().list("p", "gdtpnapnyiro", com.azure.core.util.Context.NONE); - Assertions.assertEquals("bnxknalaulppg", response.iterator().next().organizationId()); - Assertions.assertEquals("tpnapnyiropuhpig", response.iterator().next().accountId()); - Assertions.assertEquals("gylgqgitxmedjvcs", response.iterator().next().accountName()); - Assertions.assertEquals("n", response.iterator().next().region()); + Assertions.assertEquals("pigvpgylgqgitx", response.iterator().next().organizationId()); + Assertions.assertEquals("djvcsl", response.iterator().next().accountId()); + Assertions.assertEquals("qwwncw", response.iterator().next().accountName()); + Assertions.assertEquals("hxg", response.iterator().next().region()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ActivateSaaSParameterRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ActivateSaaSParameterRequestTests.java new file mode 100644 index 000000000000..e1ad8e3da2ff --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ActivateSaaSParameterRequestTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.models.ActivateSaaSParameterRequest; +import org.junit.jupiter.api.Assertions; + +public final class ActivateSaaSParameterRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ActivateSaaSParameterRequest model + = BinaryData.fromString("{\"saasGuid\":\"jozkrwfndiod\",\"publisherId\":\"pslwejdpvw\"}") + .toObject(ActivateSaaSParameterRequest.class); + Assertions.assertEquals("jozkrwfndiod", model.saasGuid()); + Assertions.assertEquals("pslwejdpvw", model.publisherId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ActivateSaaSParameterRequest model + = new ActivateSaaSParameterRequest().withSaasGuid("jozkrwfndiod").withPublisherId("pslwejdpvw"); + model = BinaryData.fromObject(model).toObject(ActivateSaaSParameterRequest.class); + Assertions.assertEquals("jozkrwfndiod", model.saasGuid()); + Assertions.assertEquals("pslwejdpvw", model.publisherId()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java index 631e32632295..bb35fc53b5f9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServiceInfoInnerTests.java @@ -11,22 +11,23 @@ public final class AppServiceInfoInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AppServiceInfoInner model = BinaryData.fromString( - "{\"azureResourceId\":\"zvddntwndeicbtwn\",\"agentVersion\":\"aoqvuh\",\"agentStatus\":\"cffcyddglmj\"}") + AppServiceInfoInner model = BinaryData + .fromString( + "{\"azureResourceId\":\"jbavorxzdm\",\"agentVersion\":\"ctbqvudwx\",\"agentStatus\":\"dnvowg\"}") .toObject(AppServiceInfoInner.class); - Assertions.assertEquals("zvddntwndeicbtwn", model.azureResourceId()); - Assertions.assertEquals("aoqvuh", model.agentVersion()); - Assertions.assertEquals("cffcyddglmj", model.agentStatus()); + Assertions.assertEquals("jbavorxzdm", model.azureResourceId()); + Assertions.assertEquals("ctbqvudwx", model.agentVersion()); + Assertions.assertEquals("dnvowg", model.agentStatus()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AppServiceInfoInner model = new AppServiceInfoInner().withAzureResourceId("zvddntwndeicbtwn") - .withAgentVersion("aoqvuh") - .withAgentStatus("cffcyddglmj"); + AppServiceInfoInner model = new AppServiceInfoInner().withAzureResourceId("jbavorxzdm") + .withAgentVersion("ctbqvudwx") + .withAgentStatus("dnvowg"); model = BinaryData.fromObject(model).toObject(AppServiceInfoInner.class); - Assertions.assertEquals("zvddntwndeicbtwn", model.azureResourceId()); - Assertions.assertEquals("aoqvuh", model.agentVersion()); - Assertions.assertEquals("cffcyddglmj", model.agentStatus()); + Assertions.assertEquals("jbavorxzdm", model.azureResourceId()); + Assertions.assertEquals("ctbqvudwx", model.agentVersion()); + Assertions.assertEquals("dnvowg", model.agentStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java index 7db997430b41..1392f1380a2f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesGetRequestTests.java @@ -12,20 +12,20 @@ public final class AppServicesGetRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AppServicesGetRequest model - = BinaryData.fromString("{\"azureResourceIds\":[\"sglumma\",\"tjaodxobnb\"],\"userEmail\":\"xkqpxo\"}") - .toObject(AppServicesGetRequest.class); - Assertions.assertEquals("sglumma", model.azureResourceIds().get(0)); - Assertions.assertEquals("xkqpxo", model.userEmail()); + AppServicesGetRequest model = BinaryData + .fromString("{\"azureResourceIds\":[\"dlwtgrhpdj\",\"jumasx\",\"zj\",\"qyeg\"],\"userEmail\":\"alhbx\"}") + .toObject(AppServicesGetRequest.class); + Assertions.assertEquals("dlwtgrhpdj", model.azureResourceIds().get(0)); + Assertions.assertEquals("alhbx", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AppServicesGetRequest model - = new AppServicesGetRequest().withAzureResourceIds(Arrays.asList("sglumma", "tjaodxobnb")) - .withUserEmail("xkqpxo"); + = new AppServicesGetRequest().withAzureResourceIds(Arrays.asList("dlwtgrhpdj", "jumasx", "zj", "qyeg")) + .withUserEmail("alhbx"); model = BinaryData.fromObject(model).toObject(AppServicesGetRequest.class); - Assertions.assertEquals("sglumma", model.azureResourceIds().get(0)); - Assertions.assertEquals("xkqpxo", model.userEmail()); + Assertions.assertEquals("dlwtgrhpdj", model.azureResourceIds().get(0)); + Assertions.assertEquals("alhbx", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java index 85fc634ed835..bcb6a17e7244 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/AppServicesListResponseTests.java @@ -14,32 +14,26 @@ public final class AppServicesListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AppServicesListResponse model = BinaryData.fromString( - "{\"value\":[{\"azureResourceId\":\"ionpimexg\",\"agentVersion\":\"xgcp\",\"agentStatus\":\"gmaajrm\"},{\"azureResourceId\":\"jwzrl\",\"agentVersion\":\"mcl\",\"agentStatus\":\"ijcoejctb\"},{\"azureResourceId\":\"qsqsy\",\"agentVersion\":\"kbfkg\",\"agentStatus\":\"dkexxppofm\"},{\"azureResourceId\":\"x\",\"agentVersion\":\"jpgd\",\"agentStatus\":\"ocjjxhvpmouexh\"}],\"nextLink\":\"xibqeojnx\"}") + "{\"value\":[{\"azureResourceId\":\"jj\",\"agentVersion\":\"v\",\"agentStatus\":\"dgwdslfhot\"},{\"azureResourceId\":\"cynpwlbjnp\",\"agentVersion\":\"cftadeh\",\"agentStatus\":\"ltyfsop\"}],\"nextLink\":\"suesnzw\"}") .toObject(AppServicesListResponse.class); - Assertions.assertEquals("ionpimexg", model.value().get(0).azureResourceId()); - Assertions.assertEquals("xgcp", model.value().get(0).agentVersion()); - Assertions.assertEquals("gmaajrm", model.value().get(0).agentStatus()); - Assertions.assertEquals("xibqeojnx", model.nextLink()); + Assertions.assertEquals("jj", model.value().get(0).azureResourceId()); + Assertions.assertEquals("v", model.value().get(0).agentVersion()); + Assertions.assertEquals("dgwdslfhot", model.value().get(0).agentStatus()); + Assertions.assertEquals("suesnzw", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AppServicesListResponse model = new AppServicesListResponse().withValue(Arrays.asList( - new AppServiceInfoInner().withAzureResourceId("ionpimexg") - .withAgentVersion("xgcp") - .withAgentStatus("gmaajrm"), - new AppServiceInfoInner().withAzureResourceId("jwzrl").withAgentVersion("mcl").withAgentStatus("ijcoejctb"), - new AppServiceInfoInner().withAzureResourceId("qsqsy") - .withAgentVersion("kbfkg") - .withAgentStatus("dkexxppofm"), - new AppServiceInfoInner().withAzureResourceId("x") - .withAgentVersion("jpgd") - .withAgentStatus("ocjjxhvpmouexh"))) - .withNextLink("xibqeojnx"); + new AppServiceInfoInner().withAzureResourceId("jj").withAgentVersion("v").withAgentStatus("dgwdslfhot"), + new AppServiceInfoInner().withAzureResourceId("cynpwlbjnp") + .withAgentVersion("cftadeh") + .withAgentStatus("ltyfsop"))) + .withNextLink("suesnzw"); model = BinaryData.fromObject(model).toObject(AppServicesListResponse.class); - Assertions.assertEquals("ionpimexg", model.value().get(0).azureResourceId()); - Assertions.assertEquals("xgcp", model.value().get(0).agentVersion()); - Assertions.assertEquals("gmaajrm", model.value().get(0).agentStatus()); - Assertions.assertEquals("xibqeojnx", model.nextLink()); + Assertions.assertEquals("jj", model.value().get(0).azureResourceId()); + Assertions.assertEquals("v", model.value().get(0).agentVersion()); + Assertions.assertEquals("dgwdslfhot", model.value().get(0).agentStatus()); + Assertions.assertEquals("suesnzw", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoResponseInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoResponseInnerTests.java index 252ab1418bef..c5a99421fa62 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoResponseInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoResponseInnerTests.java @@ -14,34 +14,39 @@ public final class BillingInfoResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BillingInfoResponseInner model = BinaryData.fromString( - "{\"marketplaceSaasInfo\":{\"marketplaceSubscriptionId\":\"eo\",\"marketplaceSubscriptionName\":\"okeyyienj\",\"marketplaceResourceId\":\"lwtgrhpdj\",\"marketplaceStatus\":\"umasxazjpq\",\"billedAzureSubscriptionId\":\"gual\"},\"partnerBillingEntity\":{\"organizationId\":\"xhejjzzvdud\",\"organizationName\":\"dslfhotwmcy\"}}") + "{\"marketplaceSaasInfo\":{\"marketplaceSubscriptionId\":\"qsycbkbfkgu\",\"marketplaceSubscriptionName\":\"kexxppof\",\"marketplaceResourceId\":\"axcfjpgddtocjjx\",\"marketplaceStatus\":\"pmouexhdz\",\"billedAzureSubscriptionId\":\"bqe\",\"publisherId\":\"nxqbzvddn\",\"offerId\":\"ndei\"},\"partnerBillingEntity\":{\"organizationId\":\"w\",\"organizationName\":\"zao\"}}") .toObject(BillingInfoResponseInner.class); - Assertions.assertEquals("eo", model.marketplaceSaasInfo().marketplaceSubscriptionId()); - Assertions.assertEquals("okeyyienj", model.marketplaceSaasInfo().marketplaceSubscriptionName()); - Assertions.assertEquals("lwtgrhpdj", model.marketplaceSaasInfo().marketplaceResourceId()); - Assertions.assertEquals("umasxazjpq", model.marketplaceSaasInfo().marketplaceStatus()); - Assertions.assertEquals("gual", model.marketplaceSaasInfo().billedAzureSubscriptionId()); - Assertions.assertEquals("xhejjzzvdud", model.partnerBillingEntity().organizationId()); - Assertions.assertEquals("dslfhotwmcy", model.partnerBillingEntity().organizationName()); + Assertions.assertEquals("qsycbkbfkgu", model.marketplaceSaasInfo().marketplaceSubscriptionId()); + Assertions.assertEquals("kexxppof", model.marketplaceSaasInfo().marketplaceSubscriptionName()); + Assertions.assertEquals("axcfjpgddtocjjx", model.marketplaceSaasInfo().marketplaceResourceId()); + Assertions.assertEquals("pmouexhdz", model.marketplaceSaasInfo().marketplaceStatus()); + Assertions.assertEquals("bqe", model.marketplaceSaasInfo().billedAzureSubscriptionId()); + Assertions.assertEquals("nxqbzvddn", model.marketplaceSaasInfo().publisherId()); + Assertions.assertEquals("ndei", model.marketplaceSaasInfo().offerId()); + Assertions.assertEquals("w", model.partnerBillingEntity().organizationId()); + Assertions.assertEquals("zao", model.partnerBillingEntity().organizationName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { BillingInfoResponseInner model = new BillingInfoResponseInner() - .withMarketplaceSaasInfo(new MarketplaceSaaSInfo().withMarketplaceSubscriptionId("eo") - .withMarketplaceSubscriptionName("okeyyienj") - .withMarketplaceResourceId("lwtgrhpdj") - .withMarketplaceStatus("umasxazjpq") - .withBilledAzureSubscriptionId("gual")) - .withPartnerBillingEntity( - new PartnerBillingEntity().withOrganizationId("xhejjzzvdud").withOrganizationName("dslfhotwmcy")); + .withMarketplaceSaasInfo(new MarketplaceSaaSInfo().withMarketplaceSubscriptionId("qsycbkbfkgu") + .withMarketplaceSubscriptionName("kexxppof") + .withMarketplaceResourceId("axcfjpgddtocjjx") + .withMarketplaceStatus("pmouexhdz") + .withBilledAzureSubscriptionId("bqe") + .withPublisherId("nxqbzvddn") + .withOfferId("ndei")) + .withPartnerBillingEntity(new PartnerBillingEntity().withOrganizationId("w").withOrganizationName("zao")); model = BinaryData.fromObject(model).toObject(BillingInfoResponseInner.class); - Assertions.assertEquals("eo", model.marketplaceSaasInfo().marketplaceSubscriptionId()); - Assertions.assertEquals("okeyyienj", model.marketplaceSaasInfo().marketplaceSubscriptionName()); - Assertions.assertEquals("lwtgrhpdj", model.marketplaceSaasInfo().marketplaceResourceId()); - Assertions.assertEquals("umasxazjpq", model.marketplaceSaasInfo().marketplaceStatus()); - Assertions.assertEquals("gual", model.marketplaceSaasInfo().billedAzureSubscriptionId()); - Assertions.assertEquals("xhejjzzvdud", model.partnerBillingEntity().organizationId()); - Assertions.assertEquals("dslfhotwmcy", model.partnerBillingEntity().organizationName()); + Assertions.assertEquals("qsycbkbfkgu", model.marketplaceSaasInfo().marketplaceSubscriptionId()); + Assertions.assertEquals("kexxppof", model.marketplaceSaasInfo().marketplaceSubscriptionName()); + Assertions.assertEquals("axcfjpgddtocjjx", model.marketplaceSaasInfo().marketplaceResourceId()); + Assertions.assertEquals("pmouexhdz", model.marketplaceSaasInfo().marketplaceStatus()); + Assertions.assertEquals("bqe", model.marketplaceSaasInfo().billedAzureSubscriptionId()); + Assertions.assertEquals("nxqbzvddn", model.marketplaceSaasInfo().publisherId()); + Assertions.assertEquals("ndei", model.marketplaceSaasInfo().offerId()); + Assertions.assertEquals("w", model.partnerBillingEntity().organizationId()); + Assertions.assertEquals("zao", model.partnerBillingEntity().organizationName()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoesGetWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoesGetWithResponseMockTests.java index 3ebe4e42b308..059ac191b71b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoesGetWithResponseMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/BillingInfoesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.BillingInfoResponse; @@ -21,25 +21,27 @@ public final class BillingInfoesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"marketplaceSaasInfo\":{\"marketplaceSubscriptionId\":\"mkcxozapvh\",\"marketplaceSubscriptionName\":\"xprglyatddc\",\"marketplaceResourceId\":\"bcuejrjxgci\",\"marketplaceStatus\":\"brh\",\"billedAzureSubscriptionId\":\"xsdqrhzoymibmrqy\"},\"partnerBillingEntity\":{\"organizationId\":\"hwflu\",\"organizationName\":\"dtmhrkwofyyvoqa\"}}"; + = "{\"marketplaceSaasInfo\":{\"marketplaceSubscriptionId\":\"kallatmel\",\"marketplaceSubscriptionName\":\"ipicc\",\"marketplaceResourceId\":\"kzivgvvcnayrh\",\"marketplaceStatus\":\"nxxmueedndrdv\",\"billedAzureSubscriptionId\":\"kwqqtchealmf\",\"publisherId\":\"d\",\"offerId\":\"ygdvwv\"},\"partnerBillingEntity\":{\"organizationId\":\"ohgwxrtfudxepxg\",\"organizationName\":\"agvrvmnpkuk\"}}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); BillingInfoResponse response = manager.billingInfoes() - .getWithResponse("gkopkwhojvpajqgx", "smocmbq", com.azure.core.util.Context.NONE) + .getWithResponse("oocrkvcikhnv", "amqgxqquezikyw", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mkcxozapvh", response.marketplaceSaasInfo().marketplaceSubscriptionId()); - Assertions.assertEquals("xprglyatddc", response.marketplaceSaasInfo().marketplaceSubscriptionName()); - Assertions.assertEquals("bcuejrjxgci", response.marketplaceSaasInfo().marketplaceResourceId()); - Assertions.assertEquals("brh", response.marketplaceSaasInfo().marketplaceStatus()); - Assertions.assertEquals("xsdqrhzoymibmrqy", response.marketplaceSaasInfo().billedAzureSubscriptionId()); - Assertions.assertEquals("hwflu", response.partnerBillingEntity().organizationId()); - Assertions.assertEquals("dtmhrkwofyyvoqa", response.partnerBillingEntity().organizationName()); + Assertions.assertEquals("kallatmel", response.marketplaceSaasInfo().marketplaceSubscriptionId()); + Assertions.assertEquals("ipicc", response.marketplaceSaasInfo().marketplaceSubscriptionName()); + Assertions.assertEquals("kzivgvvcnayrh", response.marketplaceSaasInfo().marketplaceResourceId()); + Assertions.assertEquals("nxxmueedndrdv", response.marketplaceSaasInfo().marketplaceStatus()); + Assertions.assertEquals("kwqqtchealmf", response.marketplaceSaasInfo().billedAzureSubscriptionId()); + Assertions.assertEquals("d", response.marketplaceSaasInfo().publisherId()); + Assertions.assertEquals("ygdvwv", response.marketplaceSaasInfo().offerId()); + Assertions.assertEquals("ohgwxrtfudxepxg", response.partnerBillingEntity().organizationId()); + Assertions.assertEquals("agvrvmnpkuk", response.partnerBillingEntity().organizationName()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcePropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcePropertiesTests.java index 78a5f626f134..2ec0c46766b0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcePropertiesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcePropertiesTests.java @@ -12,25 +12,24 @@ public final class ConnectedPartnerResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectedPartnerResourceProperties model = BinaryData.fromString( - "{\"accountName\":\"agfuaxbezyiu\",\"accountId\":\"ktwh\",\"azureResourceId\":\"xw\",\"location\":\"wqsmbsur\"}") + "{\"accountName\":\"czvyifq\",\"accountId\":\"kdvjsll\",\"azureResourceId\":\"vvdfwatkpnpul\",\"location\":\"xbczwtruwiqz\"}") .toObject(ConnectedPartnerResourceProperties.class); - Assertions.assertEquals("agfuaxbezyiu", model.accountName()); - Assertions.assertEquals("ktwh", model.accountId()); - Assertions.assertEquals("xw", model.azureResourceId()); - Assertions.assertEquals("wqsmbsur", model.location()); + Assertions.assertEquals("czvyifq", model.accountName()); + Assertions.assertEquals("kdvjsll", model.accountId()); + Assertions.assertEquals("vvdfwatkpnpul", model.azureResourceId()); + Assertions.assertEquals("xbczwtruwiqz", model.location()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConnectedPartnerResourceProperties model - = new ConnectedPartnerResourceProperties().withAccountName("agfuaxbezyiu") - .withAccountId("ktwh") - .withAzureResourceId("xw") - .withLocation("wqsmbsur"); + ConnectedPartnerResourceProperties model = new ConnectedPartnerResourceProperties().withAccountName("czvyifq") + .withAccountId("kdvjsll") + .withAzureResourceId("vvdfwatkpnpul") + .withLocation("xbczwtruwiqz"); model = BinaryData.fromObject(model).toObject(ConnectedPartnerResourceProperties.class); - Assertions.assertEquals("agfuaxbezyiu", model.accountName()); - Assertions.assertEquals("ktwh", model.accountId()); - Assertions.assertEquals("xw", model.azureResourceId()); - Assertions.assertEquals("wqsmbsur", model.location()); + Assertions.assertEquals("czvyifq", model.accountName()); + Assertions.assertEquals("kdvjsll", model.accountId()); + Assertions.assertEquals("vvdfwatkpnpul", model.azureResourceId()); + Assertions.assertEquals("xbczwtruwiqz", model.location()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListFormatInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListFormatInnerTests.java index 2098027dad22..01addb99f688 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListFormatInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListFormatInnerTests.java @@ -13,25 +13,25 @@ public final class ConnectedPartnerResourcesListFormatInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectedPartnerResourcesListFormatInner model = BinaryData.fromString( - "{\"properties\":{\"accountName\":\"eupfhyhltrpm\",\"accountId\":\"jmcmatuokthfu\",\"azureResourceId\":\"aodsfcpkv\",\"location\":\"dpuozmyz\"}}") + "{\"properties\":{\"accountName\":\"reximoryocfs\",\"accountId\":\"s\",\"azureResourceId\":\"ddystkiiuxhqy\",\"location\":\"xorrqnb\"}}") .toObject(ConnectedPartnerResourcesListFormatInner.class); - Assertions.assertEquals("eupfhyhltrpm", model.properties().accountName()); - Assertions.assertEquals("jmcmatuokthfu", model.properties().accountId()); - Assertions.assertEquals("aodsfcpkv", model.properties().azureResourceId()); - Assertions.assertEquals("dpuozmyz", model.properties().location()); + Assertions.assertEquals("reximoryocfs", model.properties().accountName()); + Assertions.assertEquals("s", model.properties().accountId()); + Assertions.assertEquals("ddystkiiuxhqy", model.properties().azureResourceId()); + Assertions.assertEquals("xorrqnb", model.properties().location()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConnectedPartnerResourcesListFormatInner model = new ConnectedPartnerResourcesListFormatInner() - .withProperties(new ConnectedPartnerResourceProperties().withAccountName("eupfhyhltrpm") - .withAccountId("jmcmatuokthfu") - .withAzureResourceId("aodsfcpkv") - .withLocation("dpuozmyz")); + .withProperties(new ConnectedPartnerResourceProperties().withAccountName("reximoryocfs") + .withAccountId("s") + .withAzureResourceId("ddystkiiuxhqy") + .withLocation("xorrqnb")); model = BinaryData.fromObject(model).toObject(ConnectedPartnerResourcesListFormatInner.class); - Assertions.assertEquals("eupfhyhltrpm", model.properties().accountName()); - Assertions.assertEquals("jmcmatuokthfu", model.properties().accountId()); - Assertions.assertEquals("aodsfcpkv", model.properties().azureResourceId()); - Assertions.assertEquals("dpuozmyz", model.properties().location()); + Assertions.assertEquals("reximoryocfs", model.properties().accountName()); + Assertions.assertEquals("s", model.properties().accountId()); + Assertions.assertEquals("ddystkiiuxhqy", model.properties().azureResourceId()); + Assertions.assertEquals("xorrqnb", model.properties().location()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListMockTests.java index 7a755063b322..b1b43e0a4fd2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListFormat; @@ -22,21 +22,21 @@ public final class ConnectedPartnerResourcesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"accountName\":\"nqxwbp\",\"accountId\":\"ulpiuj\",\"azureResourceId\":\"asipqiio\",\"location\":\"uqerpqlpqwc\"}}]}"; + = "{\"value\":[{\"properties\":{\"accountName\":\"zk\",\"accountId\":\"oqreyfkzikfjawn\",\"azureResourceId\":\"ivx\",\"location\":\"zel\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.connectedPartnerResources() - .list("piexpbtgiw", "wo", "nwashrtd", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.connectedPartnerResources().list("himdbl", "gwimfn", "hfjx", com.azure.core.util.Context.NONE); - Assertions.assertEquals("nqxwbp", response.iterator().next().properties().accountName()); - Assertions.assertEquals("ulpiuj", response.iterator().next().properties().accountId()); - Assertions.assertEquals("asipqiio", response.iterator().next().properties().azureResourceId()); - Assertions.assertEquals("uqerpqlpqwc", response.iterator().next().properties().location()); + Assertions.assertEquals("zk", response.iterator().next().properties().accountName()); + Assertions.assertEquals("oqreyfkzikfjawn", response.iterator().next().properties().accountId()); + Assertions.assertEquals("ivx", response.iterator().next().properties().azureResourceId()); + Assertions.assertEquals("zel", response.iterator().next().properties().location()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListResponseTests.java index 0050e646ca84..8dd9495863c5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ConnectedPartnerResourcesListResponseTests.java @@ -15,13 +15,13 @@ public final class ConnectedPartnerResourcesListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectedPartnerResourcesListResponse model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"accountName\":\"ggd\",\"accountId\":\"ixhbkuofqweykhm\",\"azureResourceId\":\"evfyexfwhybcib\",\"location\":\"vdcsitynn\"}},{\"properties\":{\"accountName\":\"dectehfiqsc\",\"accountId\":\"ypvhezrkg\",\"azureResourceId\":\"c\",\"location\":\"efovgmk\"}},{\"properties\":{\"accountName\":\"eyyvxyqjpkcat\",\"accountId\":\"ngj\",\"azureResourceId\":\"cczsq\",\"location\":\"hvmdajvnysounq\"}}],\"nextLink\":\"a\"}") + "{\"value\":[{\"properties\":{\"accountName\":\"gwdkcglhsl\",\"accountId\":\"jdyggdtji\",\"azureResourceId\":\"b\",\"location\":\"ofqweykhmenevfye\"}},{\"properties\":{\"accountName\":\"hybcibv\",\"accountId\":\"dcsi\",\"azureResourceId\":\"nnaamdectehfiqsc\",\"location\":\"ypvhezrkg\"}},{\"properties\":{\"accountName\":\"jrefovgmkqsle\",\"accountId\":\"vxyqjpkcattpngjc\",\"azureResourceId\":\"czsqpjhvm\",\"location\":\"jvnysounqe\"}},{\"properties\":{\"accountName\":\"oaeupfhyhltrpmo\",\"accountId\":\"mcmatuokthfuiu\",\"azureResourceId\":\"dsfcpkvxodpuoz\",\"location\":\"zydagfuaxbezyiuo\"}}],\"nextLink\":\"twhrdxwzywqsm\"}") .toObject(ConnectedPartnerResourcesListResponse.class); - Assertions.assertEquals("ggd", model.value().get(0).properties().accountName()); - Assertions.assertEquals("ixhbkuofqweykhm", model.value().get(0).properties().accountId()); - Assertions.assertEquals("evfyexfwhybcib", model.value().get(0).properties().azureResourceId()); - Assertions.assertEquals("vdcsitynn", model.value().get(0).properties().location()); - Assertions.assertEquals("a", model.nextLink()); + Assertions.assertEquals("gwdkcglhsl", model.value().get(0).properties().accountName()); + Assertions.assertEquals("jdyggdtji", model.value().get(0).properties().accountId()); + Assertions.assertEquals("b", model.value().get(0).properties().azureResourceId()); + Assertions.assertEquals("ofqweykhmenevfye", model.value().get(0).properties().location()); + Assertions.assertEquals("twhrdxwzywqsm", model.nextLink()); } @org.junit.jupiter.api.Test @@ -29,26 +29,31 @@ public void testSerialize() throws Exception { ConnectedPartnerResourcesListResponse model = new ConnectedPartnerResourcesListResponse().withValue(Arrays.asList( new ConnectedPartnerResourcesListFormatInner() - .withProperties(new ConnectedPartnerResourceProperties().withAccountName("ggd") - .withAccountId("ixhbkuofqweykhm") - .withAzureResourceId("evfyexfwhybcib") - .withLocation("vdcsitynn")), + .withProperties(new ConnectedPartnerResourceProperties().withAccountName("gwdkcglhsl") + .withAccountId("jdyggdtji") + .withAzureResourceId("b") + .withLocation("ofqweykhmenevfye")), new ConnectedPartnerResourcesListFormatInner() - .withProperties(new ConnectedPartnerResourceProperties().withAccountName("dectehfiqsc") - .withAccountId("ypvhezrkg") - .withAzureResourceId("c") - .withLocation("efovgmk")), + .withProperties(new ConnectedPartnerResourceProperties().withAccountName("hybcibv") + .withAccountId("dcsi") + .withAzureResourceId("nnaamdectehfiqsc") + .withLocation("ypvhezrkg")), new ConnectedPartnerResourcesListFormatInner() - .withProperties(new ConnectedPartnerResourceProperties().withAccountName("eyyvxyqjpkcat") - .withAccountId("ngj") - .withAzureResourceId("cczsq") - .withLocation("hvmdajvnysounq")))) - .withNextLink("a"); + .withProperties(new ConnectedPartnerResourceProperties().withAccountName("jrefovgmkqsle") + .withAccountId("vxyqjpkcattpngjc") + .withAzureResourceId("czsqpjhvm") + .withLocation("jvnysounqe")), + new ConnectedPartnerResourcesListFormatInner() + .withProperties(new ConnectedPartnerResourceProperties().withAccountName("oaeupfhyhltrpmo") + .withAccountId("mcmatuokthfuiu") + .withAzureResourceId("dsfcpkvxodpuoz") + .withLocation("zydagfuaxbezyiuo")))) + .withNextLink("twhrdxwzywqsm"); model = BinaryData.fromObject(model).toObject(ConnectedPartnerResourcesListResponse.class); - Assertions.assertEquals("ggd", model.value().get(0).properties().accountName()); - Assertions.assertEquals("ixhbkuofqweykhm", model.value().get(0).properties().accountId()); - Assertions.assertEquals("evfyexfwhybcib", model.value().get(0).properties().azureResourceId()); - Assertions.assertEquals("vdcsitynn", model.value().get(0).properties().location()); - Assertions.assertEquals("a", model.nextLink()); + Assertions.assertEquals("gwdkcglhsl", model.value().get(0).properties().accountName()); + Assertions.assertEquals("jdyggdtji", model.value().get(0).properties().accountId()); + Assertions.assertEquals("b", model.value().get(0).properties().azureResourceId()); + Assertions.assertEquals("ofqweykhmenevfye", model.value().get(0).properties().location()); + Assertions.assertEquals("twhrdxwzywqsm", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java index fb4a30587bf4..915dd5652e3e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/FilteringTagTests.java @@ -12,19 +12,22 @@ public final class FilteringTagTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FilteringTag model = BinaryData.fromString("{\"name\":\"ajzyul\",\"value\":\"u\",\"action\":\"Exclude\"}") + FilteringTag model = BinaryData + .fromString("{\"name\":\"xlzevgbmqjqabcy\",\"value\":\"ivkwlzuvccfwnfnb\",\"action\":\"Include\"}") .toObject(FilteringTag.class); - Assertions.assertEquals("ajzyul", model.name()); - Assertions.assertEquals("u", model.value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.action()); + Assertions.assertEquals("xlzevgbmqjqabcy", model.name()); + Assertions.assertEquals("ivkwlzuvccfwnfnb", model.value()); + Assertions.assertEquals(TagAction.INCLUDE, model.action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FilteringTag model = new FilteringTag().withName("ajzyul").withValue("u").withAction(TagAction.EXCLUDE); + FilteringTag model = new FilteringTag().withName("xlzevgbmqjqabcy") + .withValue("ivkwlzuvccfwnfnb") + .withAction(TagAction.INCLUDE); model = BinaryData.fromObject(model).toObject(FilteringTag.class); - Assertions.assertEquals("ajzyul", model.name()); - Assertions.assertEquals("u", model.value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.action()); + Assertions.assertEquals("xlzevgbmqjqabcy", model.name()); + Assertions.assertEquals("ivkwlzuvccfwnfnb", model.value()); + Assertions.assertEquals(TagAction.INCLUDE, model.action()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java index 2dc98d1789da..21ab3b528813 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/HostsGetRequestTests.java @@ -12,18 +12,17 @@ public final class HostsGetRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - HostsGetRequest model = BinaryData.fromString("{\"vmIds\":[\"uhrzayvvt\"],\"userEmail\":\"gvdfgiotkftutq\"}") + HostsGetRequest model = BinaryData.fromString("{\"vmIds\":[\"vsovmyokac\"],\"userEmail\":\"pkwlhz\"}") .toObject(HostsGetRequest.class); - Assertions.assertEquals("uhrzayvvt", model.vmIds().get(0)); - Assertions.assertEquals("gvdfgiotkftutq", model.userEmail()); + Assertions.assertEquals("vsovmyokac", model.vmIds().get(0)); + Assertions.assertEquals("pkwlhz", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - HostsGetRequest model - = new HostsGetRequest().withVmIds(Arrays.asList("uhrzayvvt")).withUserEmail("gvdfgiotkftutq"); + HostsGetRequest model = new HostsGetRequest().withVmIds(Arrays.asList("vsovmyokac")).withUserEmail("pkwlhz"); model = BinaryData.fromObject(model).toObject(HostsGetRequest.class); - Assertions.assertEquals("uhrzayvvt", model.vmIds().get(0)); - Assertions.assertEquals("gvdfgiotkftutq", model.userEmail()); + Assertions.assertEquals("vsovmyokac", model.vmIds().get(0)); + Assertions.assertEquals("pkwlhz", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LatestLinkedSaaSResponseInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LatestLinkedSaaSResponseInnerTests.java new file mode 100644 index 000000000000..570f0927999f --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LatestLinkedSaaSResponseInnerTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.LatestLinkedSaaSResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class LatestLinkedSaaSResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LatestLinkedSaaSResponseInner model + = BinaryData.fromString("{\"saaSResourceId\":\"lokeyy\",\"isHiddenSaaS\":false}") + .toObject(LatestLinkedSaaSResponseInner.class); + Assertions.assertEquals("lokeyy", model.saaSResourceId()); + Assertions.assertFalse(model.isHiddenSaaS()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LatestLinkedSaaSResponseInner model + = new LatestLinkedSaaSResponseInner().withSaaSResourceId("lokeyy").withIsHiddenSaaS(false); + model = BinaryData.fromObject(model).toObject(LatestLinkedSaaSResponseInner.class); + Assertions.assertEquals("lokeyy", model.saaSResourceId()); + Assertions.assertFalse(model.isHiddenSaaS()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceInnerTests.java index b66a3d9a7dfc..a6db944eaa3b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceInnerTests.java @@ -11,14 +11,14 @@ public final class LinkedResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LinkedResourceInner model = BinaryData.fromString("{\"id\":\"hkfpbs\"}").toObject(LinkedResourceInner.class); - Assertions.assertEquals("hkfpbs", model.id()); + LinkedResourceInner model = BinaryData.fromString("{\"id\":\"gygev\"}").toObject(LinkedResourceInner.class); + Assertions.assertEquals("gygev", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedResourceInner model = new LinkedResourceInner().withId("hkfpbs"); + LinkedResourceInner model = new LinkedResourceInner().withId("gygev"); model = BinaryData.fromObject(model).toObject(LinkedResourceInner.class); - Assertions.assertEquals("hkfpbs", model.id()); + Assertions.assertEquals("gygev", model.id()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceListResponseTests.java index 9f573a57da3f..6feb3e598b0e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LinkedResourceListResponseTests.java @@ -14,20 +14,20 @@ public final class LinkedResourceListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedResourceListResponse model = BinaryData.fromString( - "{\"value\":[{\"id\":\"ovawjvzunlu\"},{\"id\":\"nnprn\"},{\"id\":\"peilpjzuaejxdu\"},{\"id\":\"skzbb\"}],\"nextLink\":\"zumveekgpwo\"}") + "{\"value\":[{\"id\":\"rvjx\"},{\"id\":\"nspydptkoenkoukn\"},{\"id\":\"dwtiukbldngkp\"}],\"nextLink\":\"ipazyxoegukgjnpi\"}") .toObject(LinkedResourceListResponse.class); - Assertions.assertEquals("ovawjvzunlu", model.value().get(0).id()); - Assertions.assertEquals("zumveekgpwo", model.nextLink()); + Assertions.assertEquals("rvjx", model.value().get(0).id()); + Assertions.assertEquals("ipazyxoegukgjnpi", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedResourceListResponse model = new LinkedResourceListResponse().withValue( - Arrays.asList(new LinkedResourceInner().withId("ovawjvzunlu"), new LinkedResourceInner().withId("nnprn"), - new LinkedResourceInner().withId("peilpjzuaejxdu"), new LinkedResourceInner().withId("skzbb"))) - .withNextLink("zumveekgpwo"); + LinkedResourceListResponse model + = new LinkedResourceListResponse().withValue(Arrays.asList(new LinkedResourceInner().withId("rvjx"), + new LinkedResourceInner().withId("nspydptkoenkoukn"), + new LinkedResourceInner().withId("dwtiukbldngkp"))).withNextLink("ipazyxoegukgjnpi"); model = BinaryData.fromObject(model).toObject(LinkedResourceListResponse.class); - Assertions.assertEquals("ovawjvzunlu", model.value().get(0).id()); - Assertions.assertEquals("zumveekgpwo", model.nextLink()); + Assertions.assertEquals("rvjx", model.value().get(0).id()); + Assertions.assertEquals("ipazyxoegukgjnpi", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java index aa0ce282df42..e5cea768f784 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/LogRulesTests.java @@ -18,33 +18,29 @@ public final class LogRulesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogRules model = BinaryData.fromString( - "{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"cohoq\",\"value\":\"wvl\",\"action\":\"Exclude\"},{\"name\":\"w\",\"value\":\"eun\",\"action\":\"Exclude\"},{\"name\":\"gyxzk\",\"value\":\"ocukoklyax\",\"action\":\"Include\"},{\"name\":\"uqszfk\",\"value\":\"ypewrmjmwvvjekt\",\"action\":\"Include\"}]}") + "{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"lpvlopw\",\"value\":\"ighxpk\",\"action\":\"Include\"}]}") .toObject(LogRules.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.sendActivityLogs()); - Assertions.assertEquals("cohoq", model.filteringTags().get(0).name()); - Assertions.assertEquals("wvl", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); + Assertions.assertEquals("lpvlopw", model.filteringTags().get(0).name()); + Assertions.assertEquals("ighxpk", model.filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogRules model - = new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags(Arrays.asList( - new FilteringTag().withName("cohoq").withValue("wvl").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("w").withValue("eun").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("gyxzk").withValue("ocukoklyax").withAction(TagAction.INCLUDE), - new FilteringTag().withName("uqszfk").withValue("ypewrmjmwvvjekt").withAction(TagAction.INCLUDE))); + LogRules model = new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays + .asList(new FilteringTag().withName("lpvlopw").withValue("ighxpk").withAction(TagAction.INCLUDE))); model = BinaryData.fromObject(model).toObject(LogRules.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.sendActivityLogs()); - Assertions.assertEquals("cohoq", model.filteringTags().get(0).name()); - Assertions.assertEquals("wvl", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); + Assertions.assertEquals("lpvlopw", model.filteringTags().get(0).name()); + Assertions.assertEquals("ighxpk", model.filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java index 708b84daff54..3e92ec1ef2ce 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ManagedServiceIdentityTests.java @@ -16,18 +16,20 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"75fdddf1-34ed-403d-a999-eec88656d385\",\"tenantId\":\"cb80e5fd-eeda-441a-9d44-7f1c05d10843\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ouskcqvkocrc\":{\"principalId\":\"836ffa5f-e375-4881-a6a8-acd28aed400d\",\"clientId\":\"22362e8c-fd72-46b4-a17a-7f7f0bee706b\"},\"wtnhxbnjbiksqr\":{\"principalId\":\"a007c039-a4df-48d8-b027-7bd359606dab\",\"clientId\":\"5556f777-4590-42f3-bab6-93752d3cb33a\"}}}") + "{\"principalId\":\"93f5a8cc-607f-418d-b9d3-d6b74a1e9e73\",\"tenantId\":\"779a61d0-b64d-4d18-9d89-2a2fd778b8d2\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"gphuticndvka\":{\"principalId\":\"1b4edc35-09a9-450c-8383-7c3761688e9b\",\"clientId\":\"5d5b5b8f-3e98-420c-8168-5fb47fc496c2\"},\"yiftyhxhuro\":{\"principalId\":\"ceeedfe4-fe89-4430-bca0-e15a3eb303da\",\"clientId\":\"af4c9b5f-ffe1-4b62-85f1-aec755ec5778\"},\"yxolniwp\":{\"principalId\":\"0b9b587a-c902-4f10-a409-c929f06a1a8b\",\"clientId\":\"0557a3f5-756e-4a73-9eef-c8c28a27b010\"},\"kjfkg\":{\"principalId\":\"1e48b268-71d5-4994-a47e-f417be58e359\",\"clientId\":\"71fd3ead-42fb-4384-a54c-b40e46a59d35\"}}}") .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("ouskcqvkocrc", new UserAssignedIdentity(), "wtnhxbnjbiksqr", new UserAssignedIdentity())); + ManagedServiceIdentity model + = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("gphuticndvka", new UserAssignedIdentity(), "yiftyhxhuro", new UserAssignedIdentity(), + "yxolniwp", new UserAssignedIdentity(), "kjfkg", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); + Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); } // Use "Map.of" if available diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MarketplaceSaaSInfoTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MarketplaceSaaSInfoTests.java index df3fd2aa3011..b6abe976dacd 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MarketplaceSaaSInfoTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MarketplaceSaaSInfoTests.java @@ -12,27 +12,33 @@ public final class MarketplaceSaaSInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MarketplaceSaaSInfo model = BinaryData.fromString( - "{\"marketplaceSubscriptionId\":\"wlbjnpgacftade\",\"marketplaceSubscriptionName\":\"nltyfsoppusuesnz\",\"marketplaceResourceId\":\"ej\",\"marketplaceStatus\":\"vorxzdmohct\",\"billedAzureSubscriptionId\":\"vudwx\"}") + "{\"marketplaceSubscriptionId\":\"uhrhcffcyddgl\",\"marketplaceSubscriptionName\":\"t\",\"marketplaceResourceId\":\"qkwpyeicxmqc\",\"marketplaceStatus\":\"q\",\"billedAzureSubscriptionId\":\"khixuigdtopbo\",\"publisherId\":\"og\",\"offerId\":\"e\"}") .toObject(MarketplaceSaaSInfo.class); - Assertions.assertEquals("wlbjnpgacftade", model.marketplaceSubscriptionId()); - Assertions.assertEquals("nltyfsoppusuesnz", model.marketplaceSubscriptionName()); - Assertions.assertEquals("ej", model.marketplaceResourceId()); - Assertions.assertEquals("vorxzdmohct", model.marketplaceStatus()); - Assertions.assertEquals("vudwx", model.billedAzureSubscriptionId()); + Assertions.assertEquals("uhrhcffcyddgl", model.marketplaceSubscriptionId()); + Assertions.assertEquals("t", model.marketplaceSubscriptionName()); + Assertions.assertEquals("qkwpyeicxmqc", model.marketplaceResourceId()); + Assertions.assertEquals("q", model.marketplaceStatus()); + Assertions.assertEquals("khixuigdtopbo", model.billedAzureSubscriptionId()); + Assertions.assertEquals("og", model.publisherId()); + Assertions.assertEquals("e", model.offerId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MarketplaceSaaSInfo model = new MarketplaceSaaSInfo().withMarketplaceSubscriptionId("wlbjnpgacftade") - .withMarketplaceSubscriptionName("nltyfsoppusuesnz") - .withMarketplaceResourceId("ej") - .withMarketplaceStatus("vorxzdmohct") - .withBilledAzureSubscriptionId("vudwx"); + MarketplaceSaaSInfo model = new MarketplaceSaaSInfo().withMarketplaceSubscriptionId("uhrhcffcyddgl") + .withMarketplaceSubscriptionName("t") + .withMarketplaceResourceId("qkwpyeicxmqc") + .withMarketplaceStatus("q") + .withBilledAzureSubscriptionId("khixuigdtopbo") + .withPublisherId("og") + .withOfferId("e"); model = BinaryData.fromObject(model).toObject(MarketplaceSaaSInfo.class); - Assertions.assertEquals("wlbjnpgacftade", model.marketplaceSubscriptionId()); - Assertions.assertEquals("nltyfsoppusuesnz", model.marketplaceSubscriptionName()); - Assertions.assertEquals("ej", model.marketplaceResourceId()); - Assertions.assertEquals("vorxzdmohct", model.marketplaceStatus()); - Assertions.assertEquals("vudwx", model.billedAzureSubscriptionId()); + Assertions.assertEquals("uhrhcffcyddgl", model.marketplaceSubscriptionId()); + Assertions.assertEquals("t", model.marketplaceSubscriptionName()); + Assertions.assertEquals("qkwpyeicxmqc", model.marketplaceResourceId()); + Assertions.assertEquals("q", model.marketplaceStatus()); + Assertions.assertEquals("khixuigdtopbo", model.billedAzureSubscriptionId()); + Assertions.assertEquals("og", model.publisherId()); + Assertions.assertEquals("e", model.offerId()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java index afcb03cd0f1e..931bcdc9c605 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricRulesInnerTests.java @@ -16,28 +16,30 @@ public final class MetricRulesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricRulesInner model = BinaryData.fromString( - "{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"dsoifiyipj\",\"value\":\"qwpgrjbzn\",\"action\":\"Exclude\"},{\"name\":\"xv\",\"value\":\"byxqabn\",\"action\":\"Include\"},{\"name\":\"cyshurzafbljjgp\",\"value\":\"oq\",\"action\":\"Include\"}],\"userEmail\":\"ljavbqid\"}") + "{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"efgugnxk\",\"value\":\"dqmidtt\",\"action\":\"Include\"},{\"name\":\"qdrabhjybigehoqf\",\"value\":\"wska\",\"action\":\"Exclude\"},{\"name\":\"zlcuiywgqywgndrv\",\"value\":\"hzgpphrcgyncocpe\",\"action\":\"Include\"}],\"userEmail\":\"mcoo\"}") .toObject(MetricRulesInner.class); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.sendMetrics()); - Assertions.assertEquals("dsoifiyipj", model.filteringTags().get(0).name()); - Assertions.assertEquals("qwpgrjbzn", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); - Assertions.assertEquals("ljavbqid", model.userEmail()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.sendMetrics()); + Assertions.assertEquals("efgugnxk", model.filteringTags().get(0).name()); + Assertions.assertEquals("dqmidtt", model.filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); + Assertions.assertEquals("mcoo", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricRulesInner model = new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + MetricRulesInner model = new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) .withFilteringTags(Arrays.asList( - new FilteringTag().withName("dsoifiyipj").withValue("qwpgrjbzn").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("xv").withValue("byxqabn").withAction(TagAction.INCLUDE), - new FilteringTag().withName("cyshurzafbljjgp").withValue("oq").withAction(TagAction.INCLUDE))) - .withUserEmail("ljavbqid"); + new FilteringTag().withName("efgugnxk").withValue("dqmidtt").withAction(TagAction.INCLUDE), + new FilteringTag().withName("qdrabhjybigehoqf").withValue("wska").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("zlcuiywgqywgndrv") + .withValue("hzgpphrcgyncocpe") + .withAction(TagAction.INCLUDE))) + .withUserEmail("mcoo"); model = BinaryData.fromObject(model).toObject(MetricRulesInner.class); - Assertions.assertEquals(SendMetricsStatus.ENABLED, model.sendMetrics()); - Assertions.assertEquals("dsoifiyipj", model.filteringTags().get(0).name()); - Assertions.assertEquals("qwpgrjbzn", model.filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.filteringTags().get(0).action()); - Assertions.assertEquals("ljavbqid", model.userEmail()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.sendMetrics()); + Assertions.assertEquals("efgugnxk", model.filteringTags().get(0).name()); + Assertions.assertEquals("dqmidtt", model.filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.filteringTags().get(0).action()); + Assertions.assertEquals("mcoo", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java index 01a90ad8d6ed..2a18f02d2da7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsRequestTests.java @@ -12,14 +12,14 @@ public final class MetricsRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricsRequest model - = BinaryData.fromString("{\"userEmail\":\"rsoodqxhcrmnoh\"}").toObject(MetricsRequest.class); - Assertions.assertEquals("rsoodqxhcrmnoh", model.userEmail()); + = BinaryData.fromString("{\"userEmail\":\"gvdfgiotkftutq\"}").toObject(MetricsRequest.class); + Assertions.assertEquals("gvdfgiotkftutq", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricsRequest model = new MetricsRequest().withUserEmail("rsoodqxhcrmnoh"); + MetricsRequest model = new MetricsRequest().withUserEmail("gvdfgiotkftutq"); model = BinaryData.fromObject(model).toObject(MetricsRequest.class); - Assertions.assertEquals("rsoodqxhcrmnoh", model.userEmail()); + Assertions.assertEquals("gvdfgiotkftutq", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java index 736ace07e176..5af6ebb19117 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusRequestTests.java @@ -12,19 +12,20 @@ public final class MetricsStatusRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricsStatusRequest model - = BinaryData.fromString("{\"azureResourceIds\":[\"khbzhfepgzg\",\"e\"],\"userEmail\":\"zloc\"}") - .toObject(MetricsStatusRequest.class); - Assertions.assertEquals("khbzhfepgzg", model.azureResourceIds().get(0)); - Assertions.assertEquals("zloc", model.userEmail()); + MetricsStatusRequest model = BinaryData.fromString( + "{\"azureResourceIds\":[\"nlebxetqgtzxd\",\"nqbqqwxr\",\"feallnwsu\",\"isnjampmngnz\"],\"userEmail\":\"c\"}") + .toObject(MetricsStatusRequest.class); + Assertions.assertEquals("nlebxetqgtzxd", model.azureResourceIds().get(0)); + Assertions.assertEquals("c", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricsStatusRequest model - = new MetricsStatusRequest().withAzureResourceIds(Arrays.asList("khbzhfepgzg", "e")).withUserEmail("zloc"); + MetricsStatusRequest model = new MetricsStatusRequest() + .withAzureResourceIds(Arrays.asList("nlebxetqgtzxd", "nqbqqwxr", "feallnwsu", "isnjampmngnz")) + .withUserEmail("c"); model = BinaryData.fromObject(model).toObject(MetricsStatusRequest.class); - Assertions.assertEquals("khbzhfepgzg", model.azureResourceIds().get(0)); - Assertions.assertEquals("zloc", model.userEmail()); + Assertions.assertEquals("nlebxetqgtzxd", model.azureResourceIds().get(0)); + Assertions.assertEquals("c", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java index a70fc21e72ec..b6ae20155a92 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MetricsStatusResponseInnerTests.java @@ -13,15 +13,16 @@ public final class MetricsStatusResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MetricsStatusResponseInner model - = BinaryData.fromString("{\"azureResourceIds\":[\"paierh\"]}").toObject(MetricsStatusResponseInner.class); - Assertions.assertEquals("paierh", model.azureResourceIds().get(0)); + = BinaryData.fromString("{\"azureResourceIds\":[\"wooc\",\"cbonqvpk\",\"lrxnjeaseiphe\"]}") + .toObject(MetricsStatusResponseInner.class); + Assertions.assertEquals("wooc", model.azureResourceIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MetricsStatusResponseInner model - = new MetricsStatusResponseInner().withAzureResourceIds(Arrays.asList("paierh")); + = new MetricsStatusResponseInner().withAzureResourceIds(Arrays.asList("wooc", "cbonqvpk", "lrxnjeaseiphe")); model = BinaryData.fromObject(model).toObject(MetricsStatusResponseInner.class); - Assertions.assertEquals("paierh", model.azureResourceIds().get(0)); + Assertions.assertEquals("wooc", model.azureResourceIds().get(0)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java index b674772c4048..8061b9dfa77d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceInnerTests.java @@ -14,27 +14,27 @@ public final class MonitoredResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MonitoredResourceInner model = BinaryData.fromString( - "{\"id\":\"scxaq\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"hcbonqvpkvlr\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"ase\"}") + "{\"id\":\"mryw\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"qftiy\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"kcqvyxl\"}") .toObject(MonitoredResourceInner.class); - Assertions.assertEquals("scxaq", model.id()); + Assertions.assertEquals("mryw", model.id()); Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.sendingMetrics()); - Assertions.assertEquals("hcbonqvpkvlr", model.reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.ENABLED, model.sendingLogs()); - Assertions.assertEquals("ase", model.reasonForLogsStatus()); + Assertions.assertEquals("qftiy", model.reasonForMetricsStatus()); + Assertions.assertEquals(SendingLogsStatus.DISABLED, model.sendingLogs()); + Assertions.assertEquals("kcqvyxl", model.reasonForLogsStatus()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MonitoredResourceInner model = new MonitoredResourceInner().withId("scxaq") + MonitoredResourceInner model = new MonitoredResourceInner().withId("mryw") .withSendingMetrics(SendingMetricsStatus.DISABLED) - .withReasonForMetricsStatus("hcbonqvpkvlr") - .withSendingLogs(SendingLogsStatus.ENABLED) - .withReasonForLogsStatus("ase"); + .withReasonForMetricsStatus("qftiy") + .withSendingLogs(SendingLogsStatus.DISABLED) + .withReasonForLogsStatus("kcqvyxl"); model = BinaryData.fromObject(model).toObject(MonitoredResourceInner.class); - Assertions.assertEquals("scxaq", model.id()); + Assertions.assertEquals("mryw", model.id()); Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.sendingMetrics()); - Assertions.assertEquals("hcbonqvpkvlr", model.reasonForMetricsStatus()); - Assertions.assertEquals(SendingLogsStatus.ENABLED, model.sendingLogs()); - Assertions.assertEquals("ase", model.reasonForLogsStatus()); + Assertions.assertEquals("qftiy", model.reasonForMetricsStatus()); + Assertions.assertEquals(SendingLogsStatus.DISABLED, model.sendingLogs()); + Assertions.assertEquals("kcqvyxl", model.reasonForLogsStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java index 9624c2c18453..7da54f82515f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredResourceListResponseTests.java @@ -16,36 +16,36 @@ public final class MonitoredResourceListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MonitoredResourceListResponse model = BinaryData.fromString( - "{\"value\":[{\"id\":\"gyncocpecfvmmc\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"xlzevgbmqjqabcy\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"kwlzuvccfwnfn\"},{\"id\":\"cfionl\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"tqgtzxdpnqbqq\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"feallnwsu\"}],\"nextLink\":\"snjampmng\"}") + "{\"value\":[{\"id\":\"typmrbpizcdrqjsd\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"fyhxde\",\"sendingLogs\":\"Disabled\",\"reasonForLogsStatus\":\"icwifsjtt\"},{\"id\":\"fbishcbkha\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"eamdp\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"lpbuxwgipwhonowk\"}],\"nextLink\":\"hwankixzbinjepu\"}") .toObject(MonitoredResourceListResponse.class); - Assertions.assertEquals("gyncocpecfvmmc", model.value().get(0).id()); + Assertions.assertEquals("typmrbpizcdrqjsd", model.value().get(0).id()); Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.value().get(0).sendingMetrics()); - Assertions.assertEquals("xlzevgbmqjqabcy", model.value().get(0).reasonForMetricsStatus()); + Assertions.assertEquals("fyhxde", model.value().get(0).reasonForMetricsStatus()); Assertions.assertEquals(SendingLogsStatus.DISABLED, model.value().get(0).sendingLogs()); - Assertions.assertEquals("kwlzuvccfwnfn", model.value().get(0).reasonForLogsStatus()); - Assertions.assertEquals("snjampmng", model.nextLink()); + Assertions.assertEquals("icwifsjtt", model.value().get(0).reasonForLogsStatus()); + Assertions.assertEquals("hwankixzbinjepu", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MonitoredResourceListResponse model = new MonitoredResourceListResponse().withValue(Arrays.asList( - new MonitoredResourceInner().withId("gyncocpecfvmmc") + new MonitoredResourceInner().withId("typmrbpizcdrqjsd") .withSendingMetrics(SendingMetricsStatus.DISABLED) - .withReasonForMetricsStatus("xlzevgbmqjqabcy") + .withReasonForMetricsStatus("fyhxde") .withSendingLogs(SendingLogsStatus.DISABLED) - .withReasonForLogsStatus("kwlzuvccfwnfn"), - new MonitoredResourceInner().withId("cfionl") + .withReasonForLogsStatus("icwifsjtt"), + new MonitoredResourceInner().withId("fbishcbkha") .withSendingMetrics(SendingMetricsStatus.ENABLED) - .withReasonForMetricsStatus("tqgtzxdpnqbqq") - .withSendingLogs(SendingLogsStatus.DISABLED) - .withReasonForLogsStatus("feallnwsu"))) - .withNextLink("snjampmng"); + .withReasonForMetricsStatus("eamdp") + .withSendingLogs(SendingLogsStatus.ENABLED) + .withReasonForLogsStatus("lpbuxwgipwhonowk"))) + .withNextLink("hwankixzbinjepu"); model = BinaryData.fromObject(model).toObject(MonitoredResourceListResponse.class); - Assertions.assertEquals("gyncocpecfvmmc", model.value().get(0).id()); + Assertions.assertEquals("typmrbpizcdrqjsd", model.value().get(0).id()); Assertions.assertEquals(SendingMetricsStatus.DISABLED, model.value().get(0).sendingMetrics()); - Assertions.assertEquals("xlzevgbmqjqabcy", model.value().get(0).reasonForMetricsStatus()); + Assertions.assertEquals("fyhxde", model.value().get(0).reasonForMetricsStatus()); Assertions.assertEquals(SendingLogsStatus.DISABLED, model.value().get(0).sendingLogs()); - Assertions.assertEquals("kwlzuvccfwnfn", model.value().get(0).reasonForLogsStatus()); - Assertions.assertEquals("snjampmng", model.nextLink()); + Assertions.assertEquals("icwifsjtt", model.value().get(0).reasonForLogsStatus()); + Assertions.assertEquals("hwankixzbinjepu", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionInnerTests.java index 0418322d95f1..237d5895d12c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionInnerTests.java @@ -23,67 +23,59 @@ public final class MonitoredSubscriptionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MonitoredSubscriptionInner model = BinaryData.fromString( - "{\"subscriptionId\":\"jawgqwg\",\"status\":\"InProgress\",\"error\":\"skxfbk\",\"tagRules\":{\"provisioningState\":\"Accepted\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"uwhvylwzbtdhxujz\",\"value\":\"mpowuwpr\",\"action\":\"Include\"},{\"name\":\"eualupjmkhf\",\"value\":\"bbcswsrtjri\",\"action\":\"Exclude\"},{\"name\":\"pbewtghfgblcgwx\",\"value\":\"lvqhjkbegibtnmx\",\"action\":\"Include\"},{\"name\":\"waloayqcgwr\",\"value\":\"j\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"xongmtsavjcbpwxq\",\"value\":\"rknftguvriuhprwm\",\"action\":\"Exclude\"},{\"name\":\"qtayri\",\"value\":\"ro\",\"action\":\"Include\"},{\"name\":\"xrmcqibycnojvk\",\"value\":\"e\",\"action\":\"Exclude\"},{\"name\":\"zvahapjy\",\"value\":\"pvgqzcjrvxdjzlm\",\"action\":\"Exclude\"}],\"userEmail\":\"vu\"}}}") + "{\"subscriptionId\":\"buynhijggm\",\"status\":\"Failed\",\"error\":\"iarbutrcvpna\",\"tagRules\":{\"provisioningState\":\"Deleting\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"bh\",\"value\":\"nlankxmyskpb\",\"action\":\"Exclude\"},{\"name\":\"tkcxywnytnrsy\",\"value\":\"qidybyx\",\"action\":\"Exclude\"},{\"name\":\"lhaaxdbabp\",\"value\":\"wrqlfktsthsuco\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"bt\",\"value\":\"rq\",\"action\":\"Exclude\"}],\"userEmail\":\"ckzywbiexzfeyue\"}}}") .toObject(MonitoredSubscriptionInner.class); - Assertions.assertEquals("jawgqwg", model.subscriptionId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.status()); - Assertions.assertEquals("skxfbk", model.error()); + Assertions.assertEquals("buynhijggm", model.subscriptionId()); + Assertions.assertEquals(Status.FAILED, model.status()); + Assertions.assertEquals("iarbutrcvpna", model.error()); Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.tagRules().logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.tagRules().logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.tagRules().logRules().sendActivityLogs()); - Assertions.assertEquals("uwhvylwzbtdhxujz", model.tagRules().logRules().filteringTags().get(0).name()); - Assertions.assertEquals("mpowuwpr", model.tagRules().logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.tagRules().logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.tagRules().logRules().sendActivityLogs()); + Assertions.assertEquals("bh", model.tagRules().logRules().filteringTags().get(0).name()); + Assertions.assertEquals("nlankxmyskpb", model.tagRules().logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.tagRules().logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.ENABLED, model.tagRules().metricRules().sendMetrics()); - Assertions.assertEquals("xongmtsavjcbpwxq", model.tagRules().metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("rknftguvriuhprwm", model.tagRules().metricRules().filteringTags().get(0).value()); + Assertions.assertEquals("bt", model.tagRules().metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("rq", model.tagRules().metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, model.tagRules().metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("vu", model.tagRules().metricRules().userEmail()); + Assertions.assertEquals("ckzywbiexzfeyue", model.tagRules().metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MonitoredSubscriptionInner model = new MonitoredSubscriptionInner().withSubscriptionId("jawgqwg") - .withStatus(Status.IN_PROGRESS) - .withError("skxfbk") - .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules() - .withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList( - new FilteringTag().withName("uwhvylwzbtdhxujz").withValue("mpowuwpr").withAction(TagAction.INCLUDE), - new FilteringTag().withName("eualupjmkhf").withValue("bbcswsrtjri").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("pbewtghfgblcgwx") - .withValue("lvqhjkbegibtnmx") - .withAction(TagAction.INCLUDE), - new FilteringTag().withName("waloayqcgwr").withValue("j").withAction(TagAction.INCLUDE)))) - .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + MonitoredSubscriptionInner model = new MonitoredSubscriptionInner().withSubscriptionId("buynhijggm") + .withStatus(Status.FAILED) + .withError("iarbutrcvpna") + .withTagRules(new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList( - new FilteringTag().withName("xongmtsavjcbpwxq") - .withValue("rknftguvriuhprwm") - .withAction(TagAction.EXCLUDE), - new FilteringTag().withName("qtayri").withValue("ro").withAction(TagAction.INCLUDE), - new FilteringTag().withName("xrmcqibycnojvk").withValue("e").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("zvahapjy") - .withValue("pvgqzcjrvxdjzlm") - .withAction(TagAction.EXCLUDE))) - .withUserEmail("vu"))); + new FilteringTag().withName("bh").withValue("nlankxmyskpb").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("tkcxywnytnrsy").withValue("qidybyx").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("lhaaxdbabp") + .withValue("wrqlfktsthsuco") + .withAction(TagAction.EXCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + .withFilteringTags( + Arrays.asList(new FilteringTag().withName("bt").withValue("rq").withAction(TagAction.EXCLUDE))) + .withUserEmail("ckzywbiexzfeyue"))); model = BinaryData.fromObject(model).toObject(MonitoredSubscriptionInner.class); - Assertions.assertEquals("jawgqwg", model.subscriptionId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.status()); - Assertions.assertEquals("skxfbk", model.error()); + Assertions.assertEquals("buynhijggm", model.subscriptionId()); + Assertions.assertEquals(Status.FAILED, model.status()); + Assertions.assertEquals("iarbutrcvpna", model.error()); Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.tagRules().logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.tagRules().logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.tagRules().logRules().sendActivityLogs()); - Assertions.assertEquals("uwhvylwzbtdhxujz", model.tagRules().logRules().filteringTags().get(0).name()); - Assertions.assertEquals("mpowuwpr", model.tagRules().logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.tagRules().logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.tagRules().logRules().sendActivityLogs()); + Assertions.assertEquals("bh", model.tagRules().logRules().filteringTags().get(0).name()); + Assertions.assertEquals("nlankxmyskpb", model.tagRules().logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.tagRules().logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.ENABLED, model.tagRules().metricRules().sendMetrics()); - Assertions.assertEquals("xongmtsavjcbpwxq", model.tagRules().metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("rknftguvriuhprwm", model.tagRules().metricRules().filteringTags().get(0).value()); + Assertions.assertEquals("bt", model.tagRules().metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("rq", model.tagRules().metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, model.tagRules().metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("vu", model.tagRules().metricRules().userEmail()); + Assertions.assertEquals("ckzywbiexzfeyue", model.tagRules().metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesInnerTests.java index 8df93283648e..5f911d929ff2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesInnerTests.java @@ -25,69 +25,58 @@ public final class MonitoredSubscriptionPropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MonitoredSubscriptionPropertiesInner model = BinaryData.fromString( - "{\"properties\":{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"ywpmueefjzwfqkq\",\"status\":\"InProgress\",\"error\":\"suyonobglaocq\",\"tagRules\":{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{},{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{}],\"userEmail\":\"wfudwpzntxhdzhl\"}}},{\"subscriptionId\":\"jbhckfrlhr\",\"status\":\"Active\",\"error\":\"yvpycanuzbpzk\",\"tagRules\":{\"provisioningState\":\"Accepted\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{},{},{},{}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{},{},{}],\"userEmail\":\"jusrtslhspk\"}}}],\"provisioningState\":\"Updating\"},\"id\":\"maofmxagkv\",\"name\":\"melmqkrha\",\"type\":\"vljua\"}") + "{\"properties\":{\"patchOperation\":\"DeleteComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"etcktvfcivfsnk\",\"status\":\"Failed\",\"error\":\"tqhjfbebrjcx\",\"tagRules\":{\"provisioningState\":\"Succeeded\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{},{},{},{}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{},{},{}],\"userEmail\":\"xepcyvahfn\"}}}],\"provisioningState\":\"Deleted\"},\"id\":\"qxj\",\"name\":\"uujqgidokgjljyo\",\"type\":\"gvcl\"}") .toObject(MonitoredSubscriptionPropertiesInner.class); - Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.properties().patchOperation()); - Assertions.assertEquals("ywpmueefjzwfqkq", + Assertions.assertEquals(PatchOperation.DELETE_COMPLETE, model.properties().patchOperation()); + Assertions.assertEquals("etcktvfcivfsnk", model.properties().monitoredSubscriptionList().get(0).subscriptionId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.properties().monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("suyonobglaocq", model.properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(Status.FAILED, model.properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("tqhjfbebrjcx", model.properties().monitoredSubscriptionList().get(0).error()); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.properties().monitoredSubscriptionList().get(0).tagRules().metricRules().sendMetrics()); - Assertions.assertEquals("wfudwpzntxhdzhl", + Assertions.assertEquals("xepcyvahfn", model.properties().monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { MonitoredSubscriptionPropertiesInner model = new MonitoredSubscriptionPropertiesInner() - .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.ADD_COMPLETE) - .withMonitoredSubscriptionList(Arrays.asList( - new MonitoredSubscriptionInner().withSubscriptionId("ywpmueefjzwfqkq") - .withStatus(Status.IN_PROGRESS) - .withError("suyonobglaocq") + .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.DELETE_COMPLETE) + .withMonitoredSubscriptionList( + Arrays.asList(new MonitoredSubscriptionInner().withSubscriptionId("etcktvfcivfsnk") + .withStatus(Status.FAILED) + .withError("tqhjfbebrjcx") .withTagRules(new MonitoringTagRulesPropertiesInner() .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag()))) - .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags(Arrays.asList(new FilteringTag())) - .withUserEmail("wfudwpzntxhdzhl"))), - new MonitoredSubscriptionInner().withSubscriptionId("jbhckfrlhr") - .withStatus(Status.ACTIVE) - .withError("yvpycanuzbpzk") - .withTagRules(new MonitoringTagRulesPropertiesInner() - .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag(), new FilteringTag(), new FilteringTag()))) .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) .withFilteringTags( Arrays.asList(new FilteringTag(), new FilteringTag(), new FilteringTag())) - .withUserEmail("jusrtslhspk")))))); + .withUserEmail("xepcyvahfn")))))); model = BinaryData.fromObject(model).toObject(MonitoredSubscriptionPropertiesInner.class); - Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.properties().patchOperation()); - Assertions.assertEquals("ywpmueefjzwfqkq", + Assertions.assertEquals(PatchOperation.DELETE_COMPLETE, model.properties().patchOperation()); + Assertions.assertEquals("etcktvfcivfsnk", model.properties().monitoredSubscriptionList().get(0).subscriptionId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.properties().monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("suyonobglaocq", model.properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(Status.FAILED, model.properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("tqhjfbebrjcx", model.properties().monitoredSubscriptionList().get(0).error()); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.properties().monitoredSubscriptionList().get(0).tagRules().logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.properties().monitoredSubscriptionList().get(0).tagRules().metricRules().sendMetrics()); - Assertions.assertEquals("wfudwpzntxhdzhl", + Assertions.assertEquals("xepcyvahfn", model.properties().monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesListTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesListTests.java index 2d2fdf000276..3c96c34ce28d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesListTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionPropertiesListTests.java @@ -19,88 +19,41 @@ public final class MonitoredSubscriptionPropertiesListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MonitoredSubscriptionPropertiesList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"kx\",\"status\":\"Deleting\",\"error\":\"pbh\",\"tagRules\":{}},{\"subscriptionId\":\"tkcxywnytnrsy\",\"status\":\"Active\",\"error\":\"dybyxczfclhaa\",\"tagRules\":{}},{\"subscriptionId\":\"abphlw\",\"status\":\"Active\",\"error\":\"ktsthsucocmny\",\"tagRules\":{}},{\"subscriptionId\":\"t\",\"status\":\"Active\",\"error\":\"wrqpue\",\"tagRules\":{}}],\"provisioningState\":\"Succeeded\"},\"id\":\"ywbiexzfeyueax\",\"name\":\"bxu\",\"type\":\"wbhqwal\"},{\"properties\":{\"patchOperation\":\"DeleteComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"epdkzja\",\"status\":\"InProgress\",\"error\":\"rhdwbavxbniw\",\"tagRules\":{}},{\"subscriptionId\":\"wz\",\"status\":\"Failed\",\"error\":\"pgn\",\"tagRules\":{}},{\"subscriptionId\":\"x\",\"status\":\"Failed\",\"error\":\"bzpfzab\",\"tagRules\":{}},{\"subscriptionId\":\"uhxwtctyqiklbbov\",\"status\":\"Failed\",\"error\":\"bhvgy\",\"tagRules\":{}}],\"provisioningState\":\"Succeeded\"},\"id\":\"svmkfssxquk\",\"name\":\"fpl\",\"type\":\"mg\"},{\"properties\":{\"patchOperation\":\"Active\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"deslp\",\"status\":\"InProgress\",\"error\":\"wiyighxpkdw\",\"tagRules\":{}}],\"provisioningState\":\"Updating\"},\"id\":\"uebbaumnyqup\",\"name\":\"deoj\",\"type\":\"a\"},{\"properties\":{\"patchOperation\":\"Active\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"xpsiebtfhvpes\",\"status\":\"Failed\",\"error\":\"rdqmhjjdhtldwkyz\",\"tagRules\":{}},{\"subscriptionId\":\"tkncwsc\",\"status\":\"Deleting\",\"error\":\"xotogtwrupqsxv\",\"tagRules\":{}},{\"subscriptionId\":\"cykvceo\",\"status\":\"Active\",\"error\":\"ovnotyfjfcnjbkcn\",\"tagRules\":{}}],\"provisioningState\":\"Creating\"},\"id\":\"ttkphywpnvjtoqne\",\"name\":\"mclfplphoxuscr\",\"type\":\"abgy\"}],\"nextLink\":\"sbj\"}") + "{\"value\":[{\"properties\":{\"patchOperation\":\"DeleteBegin\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"hoqqnwvlr\",\"status\":\"Deleting\",\"error\":\"hheunmmqhgyx\",\"tagRules\":{}},{\"subscriptionId\":\"noc\",\"status\":\"Failed\",\"error\":\"lyaxuc\",\"tagRules\":{}}],\"provisioningState\":\"Failed\"},\"id\":\"zf\",\"name\":\"beypewrmjmw\",\"type\":\"vjektcxsenh\"}],\"nextLink\":\"rsffrzpwvlqdqgbi\"}") .toObject(MonitoredSubscriptionPropertiesList.class); - Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.value().get(0).properties().patchOperation()); - Assertions.assertEquals("kx", + Assertions.assertEquals(PatchOperation.DELETE_BEGIN, model.value().get(0).properties().patchOperation()); + Assertions.assertEquals("hoqqnwvlr", model.value().get(0).properties().monitoredSubscriptionList().get(0).subscriptionId()); Assertions.assertEquals(Status.DELETING, model.value().get(0).properties().monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("pbh", model.value().get(0).properties().monitoredSubscriptionList().get(0).error()); - Assertions.assertEquals("sbj", model.nextLink()); + Assertions.assertEquals("hheunmmqhgyx", + model.value().get(0).properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals("rsffrzpwvlqdqgbi", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MonitoredSubscriptionPropertiesList model = new MonitoredSubscriptionPropertiesList().withValue(Arrays.asList( - new MonitoredSubscriptionPropertiesInner() - .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.ADD_COMPLETE) + MonitoredSubscriptionPropertiesList model = new MonitoredSubscriptionPropertiesList() + .withValue(Arrays.asList(new MonitoredSubscriptionPropertiesInner() + .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.DELETE_BEGIN) .withMonitoredSubscriptionList(Arrays.asList( - new MonitoredSubscriptionInner().withSubscriptionId("kx") + new MonitoredSubscriptionInner().withSubscriptionId("hoqqnwvlr") .withStatus(Status.DELETING) - .withError("pbh") + .withError("hheunmmqhgyx") .withTagRules(new MonitoringTagRulesPropertiesInner()), - new MonitoredSubscriptionInner().withSubscriptionId("tkcxywnytnrsy") - .withStatus(Status.ACTIVE) - .withError("dybyxczfclhaa") - .withTagRules(new MonitoringTagRulesPropertiesInner()), - new MonitoredSubscriptionInner().withSubscriptionId("abphlw") - .withStatus(Status.ACTIVE) - .withError("ktsthsucocmny") - .withTagRules(new MonitoringTagRulesPropertiesInner()), - new MonitoredSubscriptionInner().withSubscriptionId("t") - .withStatus(Status.ACTIVE) - .withError("wrqpue") - .withTagRules(new MonitoringTagRulesPropertiesInner())))), - new MonitoredSubscriptionPropertiesInner() - .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.DELETE_COMPLETE) - .withMonitoredSubscriptionList(Arrays.asList( - new MonitoredSubscriptionInner().withSubscriptionId("epdkzja") - .withStatus(Status.IN_PROGRESS) - .withError("rhdwbavxbniw") - .withTagRules(new MonitoringTagRulesPropertiesInner()), - new MonitoredSubscriptionInner().withSubscriptionId("wz") + new MonitoredSubscriptionInner().withSubscriptionId("noc") .withStatus(Status.FAILED) - .withError("pgn") - .withTagRules(new MonitoringTagRulesPropertiesInner()), - new MonitoredSubscriptionInner().withSubscriptionId("x") - .withStatus(Status.FAILED) - .withError("bzpfzab") - .withTagRules(new MonitoringTagRulesPropertiesInner()), - new MonitoredSubscriptionInner().withSubscriptionId("uhxwtctyqiklbbov") - .withStatus(Status.FAILED) - .withError("bhvgy") - .withTagRules(new MonitoringTagRulesPropertiesInner())))), - new MonitoredSubscriptionPropertiesInner() - .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.ACTIVE) - .withMonitoredSubscriptionList( - Arrays.asList(new MonitoredSubscriptionInner().withSubscriptionId("deslp") - .withStatus(Status.IN_PROGRESS) - .withError("wiyighxpkdw") - .withTagRules(new MonitoringTagRulesPropertiesInner())))), - new MonitoredSubscriptionPropertiesInner() - .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.ACTIVE) - .withMonitoredSubscriptionList(Arrays.asList( - new MonitoredSubscriptionInner().withSubscriptionId("xpsiebtfhvpes") - .withStatus(Status.FAILED) - .withError("rdqmhjjdhtldwkyz") - .withTagRules(new MonitoringTagRulesPropertiesInner()), - new MonitoredSubscriptionInner().withSubscriptionId("tkncwsc") - .withStatus(Status.DELETING) - .withError("xotogtwrupqsxv") - .withTagRules(new MonitoringTagRulesPropertiesInner()), - new MonitoredSubscriptionInner().withSubscriptionId("cykvceo") - .withStatus(Status.ACTIVE) - .withError("ovnotyfjfcnjbkcn") + .withError("lyaxuc") .withTagRules(new MonitoringTagRulesPropertiesInner())))))) - .withNextLink("sbj"); + .withNextLink("rsffrzpwvlqdqgbi"); model = BinaryData.fromObject(model).toObject(MonitoredSubscriptionPropertiesList.class); - Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.value().get(0).properties().patchOperation()); - Assertions.assertEquals("kx", + Assertions.assertEquals(PatchOperation.DELETE_BEGIN, model.value().get(0).properties().patchOperation()); + Assertions.assertEquals("hoqqnwvlr", model.value().get(0).properties().monitoredSubscriptionList().get(0).subscriptionId()); Assertions.assertEquals(Status.DELETING, model.value().get(0).properties().monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("pbh", model.value().get(0).properties().monitoredSubscriptionList().get(0).error()); - Assertions.assertEquals("sbj", model.nextLink()); + Assertions.assertEquals("hheunmmqhgyx", + model.value().get(0).properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals("rsffrzpwvlqdqgbi", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateOrUpdateMockTests.java similarity index 59% rename from sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateMockTests.java rename to sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateOrUpdateMockTests.java index cae666317e6a..6fa2c81fbd87 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateOrUpdateMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; @@ -26,49 +26,45 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class MonitoredSubscriptionsCreateorUpdateMockTests { +public final class MonitoredSubscriptionsCreateOrUpdateMockTests { @Test - public void testCreateorUpdate() throws Exception { + public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"patchOperation\":\"Active\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"zkoj\",\"status\":\"InProgress\",\"error\":\"zfoqouicybxar\",\"tagRules\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"Succeeded\"},\"id\":\"ciqopidoa\",\"name\":\"ciodhkhaz\",\"type\":\"khnzbonlw\"}"; + = "{\"properties\":{\"patchOperation\":\"DeleteComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"ujhemmsbvdkcrodt\",\"status\":\"Deleting\",\"error\":\"wj\",\"tagRules\":{\"provisioningState\":\"Failed\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"jvefkdlfoakggkfp\",\"status\":\"InProgress\",\"error\":\"wpu\",\"tagRules\":{\"provisioningState\":\"Failed\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"s\",\"status\":\"InProgress\",\"error\":\"jnsjervtiagxsd\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"bzkfzbeyvpn\",\"status\":\"Deleting\",\"error\":\"invkjjxdxrbuu\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"Succeeded\"},\"id\":\"lw\",\"name\":\"aztz\",\"type\":\"ofncckwyfzqwhxxb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MonitoredSubscriptionProperties response = manager.monitoredSubscriptions() .define(ConfigurationName.DEFAULT) - .withExistingMonitor("pfuvglsbjjca", "vxb") - .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.DELETE_COMPLETE) + .withExistingMonitor("byxbaaabjy", "ayffim") + .withProperties(new SubscriptionList().withPatchOperation(PatchOperation.ADD_BEGIN) .withMonitoredSubscriptionList(Arrays.asList( - new MonitoredSubscriptionInner().withSubscriptionId("cormr") - .withStatus(Status.DELETING) - .withError("vcofudfl") - .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules()) - .withMetricRules(new MetricRulesInner())), - new MonitoredSubscriptionInner().withSubscriptionId("dknnqvsazn") + new MonitoredSubscriptionInner().withSubscriptionId("gsexne") .withStatus(Status.IN_PROGRESS) - .withError("rudsg") + .withError("wnwmewzs") .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules()) .withMetricRules(new MetricRulesInner())), - new MonitoredSubscriptionInner().withSubscriptionId("grauwjuetaebur") - .withStatus(Status.ACTIVE) - .withError("ovsm") + new MonitoredSubscriptionInner().withSubscriptionId("oibjudpfrxtrthz") + .withStatus(Status.IN_PROGRESS) + .withError("dwkqbrq") .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules()) .withMetricRules(new MetricRulesInner())), - new MonitoredSubscriptionInner().withSubscriptionId("q") - .withStatus(Status.ACTIVE) - .withError("ifrvtpu") + new MonitoredSubscriptionInner().withSubscriptionId("xiilivpdtiirqt") + .withStatus(Status.FAILED) + .withError("xoruzfgsquyfxrx") .withTagRules(new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules()) .withMetricRules(new MetricRulesInner()))))) .create(); - Assertions.assertEquals(PatchOperation.ACTIVE, response.properties().patchOperation()); - Assertions.assertEquals("zkoj", response.properties().monitoredSubscriptionList().get(0).subscriptionId()); - Assertions.assertEquals(Status.IN_PROGRESS, response.properties().monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("zfoqouicybxar", response.properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(PatchOperation.DELETE_COMPLETE, response.properties().patchOperation()); + Assertions.assertEquals("ujhemmsbvdkcrodt", + response.properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.DELETING, response.properties().monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("wj", response.properties().monitoredSubscriptionList().get(0).error()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetWithResponseMockTests.java index efdd10afc509..1b1c3d3d21e1 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetWithResponseMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; @@ -24,23 +24,23 @@ public final class MonitoredSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"kfpagao\",\"status\":\"Deleting\",\"error\":\"pqblylsyxkqjnsj\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"xsdszuempsb\",\"status\":\"InProgress\",\"error\":\"beyvpnqicvinvkjj\",\"tagRules\":{\"provisioningState\":\"Canceled\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"kzclewyh\",\"status\":\"InProgress\",\"error\":\"aztz\",\"tagRules\":{\"provisioningState\":\"Creating\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"wyfzqwhxxbuyqa\",\"status\":\"Failed\",\"error\":\"qztpp\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"NotSpecified\"},\"id\":\"altol\",\"name\":\"ncwsob\",\"type\":\"wcsdbnwdcfhucq\"}"; + = "{\"properties\":{\"patchOperation\":\"DeleteComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"ygaeqidbqfatpxl\",\"status\":\"Deleting\",\"error\":\"yjmoadsu\",\"tagRules\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"mjsjqb\",\"status\":\"Deleting\",\"error\":\"x\",\"tagRules\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"duhpk\",\"status\":\"Active\",\"error\":\"mareqnajxqugj\",\"tagRules\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"Failed\"},\"id\":\"gssofwq\",\"name\":\"zqalkrmnjijpx\",\"type\":\"cqqudf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MonitoredSubscriptionProperties response = manager.monitoredSubscriptions() - .getWithResponse("vdkcrodtj", "nfwjlfltkacjvefk", ConfigurationName.DEFAULT, - com.azure.core.util.Context.NONE) + .getWithResponse("zikhl", "fjhdg", ConfigurationName.DEFAULT, com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(PatchOperation.ADD_COMPLETE, response.properties().patchOperation()); - Assertions.assertEquals("kfpagao", response.properties().monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(PatchOperation.DELETE_COMPLETE, response.properties().patchOperation()); + Assertions.assertEquals("ygaeqidbqfatpxl", + response.properties().monitoredSubscriptionList().get(0).subscriptionId()); Assertions.assertEquals(Status.DELETING, response.properties().monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("pqblylsyxkqjnsj", response.properties().monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals("yjmoadsu", response.properties().monitoredSubscriptionList().get(0).error()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListMockTests.java index ef1dbc9f1644..7a357f4e2460 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; @@ -24,24 +24,24 @@ public final class MonitoredSubscriptionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"q\",\"status\":\"Failed\",\"error\":\"axoruzfgsquy\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"ptramxj\",\"status\":\"Failed\",\"error\":\"wnwxuqlcvyd\",\"tagRules\":{\"provisioningState\":\"Deleting\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"Deleted\"},\"id\":\"ojknio\",\"name\":\"kooebwnu\",\"type\":\"hemms\"}]}"; + = "{\"value\":[{\"properties\":{\"patchOperation\":\"AddBegin\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"nwabfatkldd\",\"status\":\"Failed\",\"error\":\"wuaanoz\",\"tagRules\":{\"provisioningState\":\"Updating\",\"logRules\":{},\"metricRules\":{}}},{\"subscriptionId\":\"ulpjr\",\"status\":\"InProgress\",\"error\":\"l\",\"tagRules\":{\"provisioningState\":\"Failed\",\"logRules\":{},\"metricRules\":{}}}],\"provisioningState\":\"Succeeded\"},\"id\":\"tx\",\"name\":\"tcs\",\"type\":\"fcktqumiekke\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.monitoredSubscriptions().list("ytdw", "qbrqubpaxhexiili", com.azure.core.util.Context.NONE); + = manager.monitoredSubscriptions().list("c", "r", com.azure.core.util.Context.NONE); - Assertions.assertEquals(PatchOperation.ADD_COMPLETE, response.iterator().next().properties().patchOperation()); - Assertions.assertEquals("q", + Assertions.assertEquals(PatchOperation.ADD_BEGIN, response.iterator().next().properties().patchOperation()); + Assertions.assertEquals("nwabfatkldd", response.iterator().next().properties().monitoredSubscriptionList().get(0).subscriptionId()); Assertions.assertEquals(Status.FAILED, response.iterator().next().properties().monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("axoruzfgsquy", + Assertions.assertEquals("wuaanoz", response.iterator().next().properties().monitoredSubscriptionList().get(0).error()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java index 064a06377dca..ed6f967a5b1a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoringTagRulesPropertiesInnerTests.java @@ -21,48 +21,47 @@ public final class MonitoringTagRulesPropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MonitoringTagRulesPropertiesInner model = BinaryData.fromString( - "{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"kpoc\",\"value\":\"azyxoegukg\",\"action\":\"Include\"},{\"name\":\"ucgygevqz\",\"value\":\"yp\",\"action\":\"Exclude\"},{\"name\":\"izcdrqjsd\",\"value\":\"dnfyhxdeoejzicwi\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"ishc\",\"value\":\"hajdeyeamdpha\",\"action\":\"Exclude\"},{\"name\":\"buxwgip\",\"value\":\"onowk\",\"action\":\"Exclude\"},{\"name\":\"ankixzbinjeput\",\"value\":\"rywn\",\"action\":\"Exclude\"}],\"userEmail\":\"ftiyqzrnkcq\"}}") + "{\"provisioningState\":\"NotSpecified\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"lmuzy\",\"value\":\"aepdkzjanc\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"xbniwdjs\",\"value\":\"tsdbpgn\",\"action\":\"Include\"},{\"name\":\"hpzxbzpfzab\",\"value\":\"cuh\",\"action\":\"Include\"},{\"name\":\"tyq\",\"value\":\"lbbovplw\",\"action\":\"Exclude\"},{\"name\":\"gy\",\"value\":\"uosvmkfssxqukk\",\"action\":\"Include\"}],\"userEmail\":\"mg\"}}") .toObject(MonitoringTagRulesPropertiesInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("kpoc", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("azyxoegukg", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("lmuzy", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("aepdkzjanc", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("ishc", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("hajdeyeamdpha", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ftiyqzrnkcq", model.metricRules().userEmail()); + Assertions.assertEquals("xbniwdjs", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("tsdbpgn", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("mg", model.metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MonitoringTagRulesPropertiesInner model = new MonitoringTagRulesPropertiesInner().withLogRules(new LogRules() - .withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList( - new FilteringTag().withName("kpoc").withValue("azyxoegukg").withAction(TagAction.INCLUDE), - new FilteringTag().withName("ucgygevqz").withValue("yp").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("izcdrqjsd").withValue("dnfyhxdeoejzicwi").withAction(TagAction.INCLUDE)))) + MonitoringTagRulesPropertiesInner model = new MonitoringTagRulesPropertiesInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("lmuzy").withValue("aepdkzjanc").withAction(TagAction.EXCLUDE)))) .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) .withFilteringTags(Arrays.asList( - new FilteringTag().withName("ishc").withValue("hajdeyeamdpha").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("buxwgip").withValue("onowk").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("ankixzbinjeput").withValue("rywn").withAction(TagAction.EXCLUDE))) - .withUserEmail("ftiyqzrnkcq")); + new FilteringTag().withName("xbniwdjs").withValue("tsdbpgn").withAction(TagAction.INCLUDE), + new FilteringTag().withName("hpzxbzpfzab").withValue("cuh").withAction(TagAction.INCLUDE), + new FilteringTag().withName("tyq").withValue("lbbovplw").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("gy").withValue("uosvmkfssxqukk").withAction(TagAction.INCLUDE))) + .withUserEmail("mg")); model = BinaryData.fromObject(model).toObject(MonitoringTagRulesPropertiesInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("kpoc", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("azyxoegukg", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("lmuzy", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("aepdkzjanc", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("ishc", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("hajdeyeamdpha", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ftiyqzrnkcq", model.metricRules().userEmail()); + Assertions.assertEquals("xbniwdjs", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("tsdbpgn", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("mg", model.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java index 964e6e7d380f..cac56f83e233 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.monitors().delete("lmpewwwfbkr", "rn", "vshqjohxcr", com.azure.core.util.Context.NONE); + manager.monitors().delete("nfqqnvwp", "qtaruoujmkcjhwq", "tjrybnwjewgdr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java index 7d345a39a31e..80a15444eed3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricRulesWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.MetricRules; @@ -24,24 +24,24 @@ public final class MonitorsGetMetricRulesWithResponseMockTests { @Test public void testGetMetricRulesWithResponse() throws Exception { String responseStr - = "{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"bsrfbj\",\"value\":\"twss\",\"action\":\"Exclude\"},{\"name\":\"pvjzbe\",\"value\":\"l\",\"action\":\"Include\"},{\"name\":\"qqnvwpmq\",\"value\":\"ruoujmk\",\"action\":\"Include\"}],\"userEmail\":\"qytjrybnwjewgd\"}"; + = "{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"qig\",\"value\":\"duhavhqlkt\",\"action\":\"Exclude\"},{\"name\":\"qolbgyc\",\"value\":\"iertgccymvaolp\",\"action\":\"Include\"},{\"name\":\"lfmmdnbbglzpswi\",\"value\":\"mcwyhzdxssadb\",\"action\":\"Exclude\"}],\"userEmail\":\"dfznudaodv\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); MetricRules response = manager.monitors() - .getMetricRulesWithResponse("bfovasrruvwbhsq", "sub", new MetricsRequest().withUserEmail("gjb"), + .getMetricRulesWithResponse("ervnaenqpehi", "doy", new MetricsRequest().withUserEmail("mifthnzdnd"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(SendMetricsStatus.ENABLED, response.sendMetrics()); - Assertions.assertEquals("bsrfbj", response.filteringTags().get(0).name()); - Assertions.assertEquals("twss", response.filteringTags().get(0).value()); + Assertions.assertEquals(SendMetricsStatus.DISABLED, response.sendMetrics()); + Assertions.assertEquals("qig", response.filteringTags().get(0).name()); + Assertions.assertEquals("duhavhqlkt", response.filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, response.filteringTags().get(0).action()); - Assertions.assertEquals("qytjrybnwjewgd", response.userEmail()); + Assertions.assertEquals("dfznudaodv", response.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java index 8a97fd034cdb..9a7fac4b90ad 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; @@ -22,23 +22,23 @@ public final class MonitorsGetMetricStatusWithResponseMockTests { @Test public void testGetMetricStatusWithResponse() throws Exception { - String responseStr = "{\"azureResourceIds\":[\"duhavhqlkt\",\"umaq\",\"lbg\",\"cdui\"]}"; + String responseStr = "{\"azureResourceIds\":[\"iwubmwmbesldnk\",\"wtppjflcxogaoko\"]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - MetricsStatusResponse response - = manager.monitors() - .getMetricStatusWithResponse("jervnaenqpehi", "doy", - new MetricsStatusRequest().withAzureResourceIds(Arrays.asList("fthnzdn", "sl")) - .withUserEmail("nayqi"), - com.azure.core.util.Context.NONE) - .getValue(); + MetricsStatusResponse response = manager.monitors() + .getMetricStatusWithResponse("zbn", "blylpstdbh", + new MetricsStatusRequest() + .withAzureResourceIds(Arrays.asList("rzdzucerscdnt", "evfiwjmygt", "sslswtmweriof", "pyqs")) + .withUserEmail("mwabnetshhszhedp"), + com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("duhavhqlkt", response.azureResourceIds().get(0)); + Assertions.assertEquals("iwubmwmbesldnk", response.azureResourceIds().get(0)); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLatestLinkedSaaSWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLatestLinkedSaaSWithResponseMockTests.java new file mode 100644 index 000000000000..8eca7d178e7a --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsLatestLinkedSaaSWithResponseMockTests.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.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import com.azure.resourcemanager.newrelicobservability.models.LatestLinkedSaaSResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MonitorsLatestLinkedSaaSWithResponseMockTests { + @Test + public void testLatestLinkedSaaSWithResponse() throws Exception { + String responseStr = "{\"saaSResourceId\":\"zxmhhvhgu\",\"isHiddenSaaS\":false}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + LatestLinkedSaaSResponse response = manager.monitors() + .latestLinkedSaaSWithResponse("z", "nsikvmkqzeqqkdl", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("zxmhhvhgu", response.saaSResourceId()); + Assertions.assertFalse(response.isHiddenSaaS()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java index 979849a70da4..924635411d51 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.AppServiceInfo; @@ -24,23 +24,24 @@ public final class MonitorsListAppServicesMockTests { @Test public void testListAppServices() throws Exception { String responseStr - = "{\"value\":[{\"azureResourceId\":\"dvxzbncblylpst\",\"agentVersion\":\"hh\",\"agentStatus\":\"rzdzucerscdnt\"}]}"; + = "{\"value\":[{\"azureResourceId\":\"vithh\",\"agentVersion\":\"o\",\"agentStatus\":\"sg\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.monitors() - .listAppServices("r", "gccymvaolpssl", - new AppServicesGetRequest().withAzureResourceIds(Arrays.asList("mmdnbbglzps", "iydmcwyhzdxs")) - .withUserEmail("adbzmnvdfznud"), + .listAppServices("pbttdum", "rp", + new AppServicesGetRequest() + .withAzureResourceIds(Arrays.asList("bmnzbtbhjpgl", "fgohdneuelfphs", "yhtozfikdowwqu", "v")) + .withUserEmail("zx"), com.azure.core.util.Context.NONE); - Assertions.assertEquals("dvxzbncblylpst", response.iterator().next().azureResourceId()); - Assertions.assertEquals("hh", response.iterator().next().agentVersion()); - Assertions.assertEquals("rzdzucerscdnt", response.iterator().next().agentStatus()); + Assertions.assertEquals("vithh", response.iterator().next().azureResourceId()); + Assertions.assertEquals("o", response.iterator().next().agentVersion()); + Assertions.assertEquals("sg", response.iterator().next().agentStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java index 24794359d7d1..95d10e905d57 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; @@ -24,24 +24,21 @@ public final class MonitorsListHostsMockTests { @Test public void testListHosts() throws Exception { String responseStr - = "{\"value\":[{\"vmId\":\"koievseo\",\"agentVersion\":\"q\",\"agentStatus\":\"ltmuwlauwzizx\"}]}"; + = "{\"value\":[{\"vmId\":\"fuflrwdmhdlx\",\"agentVersion\":\"rxsagafcnihgwqa\",\"agentStatus\":\"edgfbcvkcvq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.monitors() - .listHosts("ur", "odkwobd", - new HostsGetRequest() - .withVmIds(Arrays.asList("tibqdxbxwakb", "gqxndlkzgxhuripl", "podxunkb", "bxmubyynt")) - .withUserEmail("lrb"), - com.azure.core.util.Context.NONE); + .listHosts("b", "c", new HostsGetRequest().withVmIds(Arrays.asList("wdsjnkalju", "iiswacffgdkzze")) + .withUserEmail("kfvhqcrailvpn"), com.azure.core.util.Context.NONE); - Assertions.assertEquals("koievseo", response.iterator().next().vmId()); - Assertions.assertEquals("q", response.iterator().next().agentVersion()); - Assertions.assertEquals("ltmuwlauwzizx", response.iterator().next().agentStatus()); + Assertions.assertEquals("fuflrwdmhdlx", response.iterator().next().vmId()); + Assertions.assertEquals("rxsagafcnihgwqa", response.iterator().next().agentVersion()); + Assertions.assertEquals("edgfbcvkcvq", response.iterator().next().agentStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesMockTests.java index d25911a89f2c..177bc74df9e6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListLinkedResourcesMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.LinkedResource; @@ -21,18 +21,18 @@ public final class MonitorsListLinkedResourcesMockTests { @Test public void testListLinkedResources() throws Exception { - String responseStr = "{\"value\":[{\"id\":\"xzxcl\"}]}"; + String responseStr = "{\"value\":[{\"id\":\"opcjwvnhd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.monitors().listLinkedResources("phsdyhto", "fikdowwqu", com.azure.core.util.Context.NONE); + = manager.monitors().listLinkedResources("pkeqdcvdrhvoo", "sotbob", com.azure.core.util.Context.NONE); - Assertions.assertEquals("xzxcl", response.iterator().next().id()); + Assertions.assertEquals("opcjwvnhd", response.iterator().next().id()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java index 66f20f28a294..d017e144e8b4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.MonitoredResource; @@ -24,22 +24,22 @@ public final class MonitorsListMonitoredResourcesMockTests { @Test public void testListMonitoredResources() throws Exception { String responseStr - = "{\"value\":[{\"id\":\"orppxebmnzbtb\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"lkfg\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"euel\"}]}"; + = "{\"value\":[{\"id\":\"wuoegrpk\",\"sendingMetrics\":\"Disabled\",\"reasonForMetricsStatus\":\"iyq\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"cpdggkzzlvmbmp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.monitors().listMonitoredResources("mpgcjefuzmuvpbt", "d", com.azure.core.util.Context.NONE); + = manager.monitors().listMonitoredResources("d", "mgxcxrslpm", com.azure.core.util.Context.NONE); - Assertions.assertEquals("orppxebmnzbtb", response.iterator().next().id()); - Assertions.assertEquals(SendingMetricsStatus.ENABLED, response.iterator().next().sendingMetrics()); - Assertions.assertEquals("lkfg", response.iterator().next().reasonForMetricsStatus()); + Assertions.assertEquals("wuoegrpk", response.iterator().next().id()); + Assertions.assertEquals(SendingMetricsStatus.DISABLED, response.iterator().next().sendingMetrics()); + Assertions.assertEquals("iyq", response.iterator().next().reasonForMetricsStatus()); Assertions.assertEquals(SendingLogsStatus.ENABLED, response.iterator().next().sendingLogs()); - Assertions.assertEquals("euel", response.iterator().next().reasonForLogsStatus()); + Assertions.assertEquals("cpdggkzzlvmbmp", response.iterator().next().reasonForLogsStatus()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsRefreshIngestionKeyWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsRefreshIngestionKeyWithResponseMockTests.java new file mode 100644 index 000000000000..0032a40b15d5 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsRefreshIngestionKeyWithResponseMockTests.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.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class MonitorsRefreshIngestionKeyWithResponseMockTests { + @Test + public void testRefreshIngestionKeyWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.monitors().refreshIngestionKeyWithResponse("xmodf", "uefywsbpfvmwy", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java index 186893bcc448..198e0c067ad9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/NewRelicSingleSignOnPropertiesTests.java @@ -14,25 +14,25 @@ public final class NewRelicSingleSignOnPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NewRelicSingleSignOnProperties model = BinaryData.fromString( - "{\"singleSignOnState\":\"Enable\",\"enterpriseAppId\":\"o\",\"singleSignOnUrl\":\"si\",\"provisioningState\":\"Deleting\"}") + "{\"singleSignOnState\":\"Initial\",\"enterpriseAppId\":\"cjdkwtnhxbnjbi\",\"singleSignOnUrl\":\"qrglssainqpjwn\",\"provisioningState\":\"Canceled\"}") .toObject(NewRelicSingleSignOnProperties.class); - Assertions.assertEquals(SingleSignOnStates.ENABLE, model.singleSignOnState()); - Assertions.assertEquals("o", model.enterpriseAppId()); - Assertions.assertEquals("si", model.singleSignOnUrl()); - Assertions.assertEquals(ProvisioningState.DELETING, model.provisioningState()); + Assertions.assertEquals(SingleSignOnStates.INITIAL, model.singleSignOnState()); + Assertions.assertEquals("cjdkwtnhxbnjbi", model.enterpriseAppId()); + Assertions.assertEquals("qrglssainqpjwn", model.singleSignOnUrl()); + Assertions.assertEquals(ProvisioningState.CANCELED, model.provisioningState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NewRelicSingleSignOnProperties model - = new NewRelicSingleSignOnProperties().withSingleSignOnState(SingleSignOnStates.ENABLE) - .withEnterpriseAppId("o") - .withSingleSignOnUrl("si") - .withProvisioningState(ProvisioningState.DELETING); + = new NewRelicSingleSignOnProperties().withSingleSignOnState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("cjdkwtnhxbnjbi") + .withSingleSignOnUrl("qrglssainqpjwn") + .withProvisioningState(ProvisioningState.CANCELED); model = BinaryData.fromObject(model).toObject(NewRelicSingleSignOnProperties.class); - Assertions.assertEquals(SingleSignOnStates.ENABLE, model.singleSignOnState()); - Assertions.assertEquals("o", model.enterpriseAppId()); - Assertions.assertEquals("si", model.singleSignOnUrl()); - Assertions.assertEquals(ProvisioningState.DELETING, model.provisioningState()); + Assertions.assertEquals(SingleSignOnStates.INITIAL, model.singleSignOnState()); + Assertions.assertEquals("cjdkwtnhxbnjbi", model.enterpriseAppId()); + Assertions.assertEquals("qrglssainqpjwn", model.singleSignOnUrl()); + Assertions.assertEquals(ProvisioningState.CANCELED, model.provisioningState()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java index f75d7a1206fc..95577f69a32a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OperationsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"uusdttouwa\",\"isDataAction\":false,\"display\":{\"provider\":\"v\",\"resource\":\"lns\",\"operation\":\"bxwyjsflhhcaa\",\"description\":\"jixisxyawjoyaqcs\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"vbxwyjsflhh\",\"isDataAction\":false,\"display\":{\"provider\":\"jixisxyawjoyaqcs\",\"resource\":\"jpkiidzyexznelix\",\"operation\":\"rzt\",\"description\":\"lhbnxkna\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java index 15c572cc37d1..1006704ac61f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationInfoTests.java @@ -12,14 +12,14 @@ public final class OrganizationInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OrganizationInfo model - = BinaryData.fromString("{\"organizationId\":\"amiheognarxz\"}").toObject(OrganizationInfo.class); - Assertions.assertEquals("amiheognarxz", model.organizationId()); + = BinaryData.fromString("{\"organizationId\":\"rljdouskcqv\"}").toObject(OrganizationInfo.class); + Assertions.assertEquals("rljdouskcqv", model.organizationId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OrganizationInfo model = new OrganizationInfo().withOrganizationId("amiheognarxz"); + OrganizationInfo model = new OrganizationInfo().withOrganizationId("rljdouskcqv"); model = BinaryData.fromObject(model).toObject(OrganizationInfo.class); - Assertions.assertEquals("amiheognarxz", model.organizationId()); + Assertions.assertEquals("rljdouskcqv", model.organizationId()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java index 078ad0d538f4..343e17ef5b0e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationPropertiesTests.java @@ -12,22 +12,22 @@ public final class OrganizationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OrganizationProperties model = BinaryData.fromString( - "{\"organizationId\":\"utduqktapspwgcu\",\"organizationName\":\"tumkdosvqwhbm\",\"billingSource\":\"NEWRELIC\"}") + OrganizationProperties model = BinaryData + .fromString("{\"organizationId\":\"q\",\"organizationName\":\"ol\",\"billingSource\":\"NEWRELIC\"}") .toObject(OrganizationProperties.class); - Assertions.assertEquals("utduqktapspwgcu", model.organizationId()); - Assertions.assertEquals("tumkdosvqwhbm", model.organizationName()); + Assertions.assertEquals("q", model.organizationId()); + Assertions.assertEquals("ol", model.organizationName()); Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OrganizationProperties model = new OrganizationProperties().withOrganizationId("utduqktapspwgcu") - .withOrganizationName("tumkdosvqwhbm") + OrganizationProperties model = new OrganizationProperties().withOrganizationId("q") + .withOrganizationName("ol") .withBillingSource(BillingSource.NEWRELIC); model = BinaryData.fromObject(model).toObject(OrganizationProperties.class); - Assertions.assertEquals("utduqktapspwgcu", model.organizationId()); - Assertions.assertEquals("tumkdosvqwhbm", model.organizationName()); + Assertions.assertEquals("q", model.organizationId()); + Assertions.assertEquals("ol", model.organizationName()); Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java index 07d30c4b7482..984522485267 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationResourceInnerTests.java @@ -13,21 +13,21 @@ public final class OrganizationResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OrganizationResourceInner model = BinaryData.fromString( - "{\"properties\":{\"organizationId\":\"kgfg\",\"organizationName\":\"madgakeqsrxyb\",\"billingSource\":\"NEWRELIC\"},\"id\":\"dqytbciqfouflmm\",\"name\":\"kzsmodm\",\"type\":\"lougpbkw\"}") + "{\"properties\":{\"organizationId\":\"gcue\",\"organizationName\":\"umkdosvqwhbmd\",\"billingSource\":\"AZURE\"},\"id\":\"f\",\"name\":\"dgmb\",\"type\":\"bexppb\"}") .toObject(OrganizationResourceInner.class); - Assertions.assertEquals("kgfg", model.organizationId()); - Assertions.assertEquals("madgakeqsrxyb", model.organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); + Assertions.assertEquals("gcue", model.organizationId()); + Assertions.assertEquals("umkdosvqwhbmd", model.organizationName()); + Assertions.assertEquals(BillingSource.AZURE, model.billingSource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OrganizationResourceInner model = new OrganizationResourceInner().withOrganizationId("kgfg") - .withOrganizationName("madgakeqsrxyb") - .withBillingSource(BillingSource.NEWRELIC); + OrganizationResourceInner model = new OrganizationResourceInner().withOrganizationId("gcue") + .withOrganizationName("umkdosvqwhbmd") + .withBillingSource(BillingSource.AZURE); model = BinaryData.fromObject(model).toObject(OrganizationResourceInner.class); - Assertions.assertEquals("kgfg", model.organizationId()); - Assertions.assertEquals("madgakeqsrxyb", model.organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, model.billingSource()); + Assertions.assertEquals("gcue", model.organizationId()); + Assertions.assertEquals("umkdosvqwhbmd", model.organizationName()); + Assertions.assertEquals(BillingSource.AZURE, model.billingSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java index bdd1bb744e71..c1167dc567d8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.BillingSource; @@ -23,20 +23,20 @@ public final class OrganizationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"organizationId\":\"cjwvn\",\"organizationName\":\"ld\",\"billingSource\":\"AZURE\"},\"id\":\"cxrslpmutwuoe\",\"name\":\"rpkhjwn\",\"type\":\"yqsluic\"}]}"; + = "{\"value\":[{\"properties\":{\"organizationId\":\"orzihle\",\"organizationName\":\"jswsrmslyz\",\"billingSource\":\"NEWRELIC\"},\"id\":\"c\",\"name\":\"ckqqzqioxiysui\",\"type\":\"zynkedya\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.organizations().list("rhvoods", "tbobz", com.azure.core.util.Context.NONE); + = manager.organizations().list("saknynfsyn", "jphuopxodlqi", com.azure.core.util.Context.NONE); - Assertions.assertEquals("cjwvn", response.iterator().next().organizationId()); - Assertions.assertEquals("ld", response.iterator().next().organizationName()); - Assertions.assertEquals(BillingSource.AZURE, response.iterator().next().billingSource()); + Assertions.assertEquals("orzihle", response.iterator().next().organizationId()); + Assertions.assertEquals("jswsrmslyz", response.iterator().next().organizationName()); + Assertions.assertEquals(BillingSource.NEWRELIC, response.iterator().next().billingSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java index 3f0dbb07152a..943312c0b8ad 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/OrganizationsListResponseTests.java @@ -15,31 +15,28 @@ public final class OrganizationsListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OrganizationsListResponse model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"organizationId\":\"nqpjwnzlljfmpp\",\"organizationName\":\"bvmgxsabkyqduuji\",\"billingSource\":\"NEWRELIC\"},\"id\":\"zdzevndh\",\"name\":\"rwpdappdsbdkvwrw\",\"type\":\"feusnhut\"},{\"properties\":{\"organizationId\":\"tmrldhugjzzdatq\",\"organizationName\":\"oc\",\"billingSource\":\"AZURE\"},\"id\":\"blgphuticn\",\"name\":\"vkaozwyiftyhxhur\",\"type\":\"k\"},{\"properties\":{\"organizationId\":\"xolniwpwcukjfk\",\"organizationName\":\"awxklr\",\"billingSource\":\"NEWRELIC\"},\"id\":\"ckbasyypndd\",\"name\":\"sgcbac\",\"type\":\"hejkotynqgou\"}],\"nextLink\":\"ndlik\"}") + "{\"value\":[{\"properties\":{\"organizationId\":\"ryplwckbasyypn\",\"organizationName\":\"hsgcbacphejkot\",\"billingSource\":\"AZURE\"},\"id\":\"oulzndlikwyq\",\"name\":\"gfgibm\",\"type\":\"dgak\"},{\"properties\":{\"organizationId\":\"rxybz\",\"organizationName\":\"e\",\"billingSource\":\"AZURE\"},\"id\":\"bciqfouflm\",\"name\":\"nkzsmodmglou\",\"type\":\"pbkwtmu\"}],\"nextLink\":\"uqktap\"}") .toObject(OrganizationsListResponse.class); - Assertions.assertEquals("nqpjwnzlljfmpp", model.value().get(0).organizationId()); - Assertions.assertEquals("bvmgxsabkyqduuji", model.value().get(0).organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, model.value().get(0).billingSource()); - Assertions.assertEquals("ndlik", model.nextLink()); + Assertions.assertEquals("ryplwckbasyypn", model.value().get(0).organizationId()); + Assertions.assertEquals("hsgcbacphejkot", model.value().get(0).organizationName()); + Assertions.assertEquals(BillingSource.AZURE, model.value().get(0).billingSource()); + Assertions.assertEquals("uqktap", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { OrganizationsListResponse model = new OrganizationsListResponse().withValue(Arrays.asList( - new OrganizationResourceInner().withOrganizationId("nqpjwnzlljfmpp") - .withOrganizationName("bvmgxsabkyqduuji") - .withBillingSource(BillingSource.NEWRELIC), - new OrganizationResourceInner().withOrganizationId("tmrldhugjzzdatq") - .withOrganizationName("oc") + new OrganizationResourceInner().withOrganizationId("ryplwckbasyypn") + .withOrganizationName("hsgcbacphejkot") .withBillingSource(BillingSource.AZURE), - new OrganizationResourceInner().withOrganizationId("xolniwpwcukjfk") - .withOrganizationName("awxklr") - .withBillingSource(BillingSource.NEWRELIC))) - .withNextLink("ndlik"); + new OrganizationResourceInner().withOrganizationId("rxybz") + .withOrganizationName("e") + .withBillingSource(BillingSource.AZURE))) + .withNextLink("uqktap"); model = BinaryData.fromObject(model).toObject(OrganizationsListResponse.class); - Assertions.assertEquals("nqpjwnzlljfmpp", model.value().get(0).organizationId()); - Assertions.assertEquals("bvmgxsabkyqduuji", model.value().get(0).organizationName()); - Assertions.assertEquals(BillingSource.NEWRELIC, model.value().get(0).billingSource()); - Assertions.assertEquals("ndlik", model.nextLink()); + Assertions.assertEquals("ryplwckbasyypn", model.value().get(0).organizationId()); + Assertions.assertEquals("hsgcbacphejkot", model.value().get(0).organizationName()); + Assertions.assertEquals(BillingSource.AZURE, model.value().get(0).billingSource()); + Assertions.assertEquals("uqktap", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PartnerBillingEntityTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PartnerBillingEntityTests.java index ef9070a10cbc..ad6af2990bab 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PartnerBillingEntityTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PartnerBillingEntityTests.java @@ -12,18 +12,18 @@ public final class PartnerBillingEntityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PartnerBillingEntity model - = BinaryData.fromString("{\"organizationId\":\"dnvowg\",\"organizationName\":\"jugwdkcglhsl\"}") + = BinaryData.fromString("{\"organizationId\":\"a\",\"organizationName\":\"uhrzayvvt\"}") .toObject(PartnerBillingEntity.class); - Assertions.assertEquals("dnvowg", model.organizationId()); - Assertions.assertEquals("jugwdkcglhsl", model.organizationName()); + Assertions.assertEquals("a", model.organizationId()); + Assertions.assertEquals("uhrzayvvt", model.organizationName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PartnerBillingEntity model - = new PartnerBillingEntity().withOrganizationId("dnvowg").withOrganizationName("jugwdkcglhsl"); + = new PartnerBillingEntity().withOrganizationId("a").withOrganizationName("uhrzayvvt"); model = BinaryData.fromObject(model).toObject(PartnerBillingEntity.class); - Assertions.assertEquals("dnvowg", model.organizationId()); - Assertions.assertEquals("jugwdkcglhsl", model.organizationName()); + Assertions.assertEquals("a", model.organizationId()); + Assertions.assertEquals("uhrzayvvt", model.organizationName()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java index 87e038e497f3..d46f1c637198 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataListResponseTests.java @@ -7,7 +7,6 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.PlanDataListResponse; @@ -20,35 +19,53 @@ public final class PlanDataListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PlanDataListResponse model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"mbe\",\"effectiveDate\":\"2021-10-01T04:14:33Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"rolfpfp\",\"name\":\"algbquxigjyjg\",\"type\":\"jaoyfhrtx\"}],\"nextLink\":\"n\"}") + "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"qux\",\"planDetails\":\"jyj\",\"effectiveDate\":\"2021-06-25T17:47:27Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"},\"id\":\"rtxilner\",\"name\":\"ujysvle\",\"type\":\"uvfqawrlyxwj\"},{\"properties\":{\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"wbxgjvt\",\"planDetails\":\"p\",\"effectiveDate\":\"2021-04-27T05:48:18Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"jq\",\"name\":\"uhmuouqfprwzwbn\",\"type\":\"uitnwuiz\"},{\"properties\":{\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"izuckyfihrfidfvz\",\"planDetails\":\"zuhtymwisdkfthwx\",\"effectiveDate\":\"2021-12-09T20:21:41Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"pvkmijcmmxdcuf\",\"name\":\"fsrpymzidnse\",\"type\":\"cxtbzsg\"}],\"nextLink\":\"c\"}") .toObject(PlanDataListResponse.class); Assertions.assertEquals(UsageType.PAYG, model.value().get(0).planData().usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, model.value().get(0).planData().billingCycle()); - Assertions.assertEquals("mbe", model.value().get(0).planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T04:14:33Z"), + Assertions.assertEquals("qux", model.value().get(0).planData().billingCycle()); + Assertions.assertEquals("jyj", model.value().get(0).planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T17:47:27Z"), model.value().get(0).planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("n", model.nextLink()); + Assertions.assertEquals(OrgCreationSource.LIFTR, model.value().get(0).orgCreationSource()); + Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); + Assertions.assertEquals("c", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PlanDataListResponse model = new PlanDataListResponse().withValue(Arrays.asList(new PlanDataResourceInner() - .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.WEEKLY) - .withPlanDetails("mbe") - .withEffectiveDate(OffsetDateTime.parse("2021-10-01T04:14:33Z"))) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) - .withAccountCreationSource(AccountCreationSource.LIFTR))).withNextLink("n"); + PlanDataListResponse model + = new PlanDataListResponse() + .withValue(Arrays.asList( + new PlanDataResourceInner() + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle("qux") + .withPlanDetails("jyj") + .withEffectiveDate(OffsetDateTime.parse("2021-06-25T17:47:27Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR) + .withAccountCreationSource(AccountCreationSource.NEWRELIC), + new PlanDataResourceInner() + .withPlanData(new PlanData().withUsageType(UsageType.COMMITTED) + .withBillingCycle("wbxgjvt") + .withPlanDetails("p") + .withEffectiveDate(OffsetDateTime.parse("2021-04-27T05:48:18Z"))) + .withOrgCreationSource(OrgCreationSource.NEWRELIC) + .withAccountCreationSource(AccountCreationSource.LIFTR), + new PlanDataResourceInner() + .withPlanData(new PlanData().withUsageType(UsageType.COMMITTED) + .withBillingCycle("izuckyfihrfidfvz") + .withPlanDetails("zuhtymwisdkfthwx") + .withEffectiveDate(OffsetDateTime.parse("2021-12-09T20:21:41Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR) + .withAccountCreationSource(AccountCreationSource.LIFTR))) + .withNextLink("c"); model = BinaryData.fromObject(model).toObject(PlanDataListResponse.class); Assertions.assertEquals(UsageType.PAYG, model.value().get(0).planData().usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, model.value().get(0).planData().billingCycle()); - Assertions.assertEquals("mbe", model.value().get(0).planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T04:14:33Z"), + Assertions.assertEquals("qux", model.value().get(0).planData().billingCycle()); + Assertions.assertEquals("jyj", model.value().get(0).planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T17:47:27Z"), model.value().get(0).planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.value().get(0).orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.value().get(0).accountCreationSource()); - Assertions.assertEquals("n", model.nextLink()); + Assertions.assertEquals(OrgCreationSource.LIFTR, model.value().get(0).orgCreationSource()); + Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.value().get(0).accountCreationSource()); + Assertions.assertEquals("c", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java index 1a24aa4aca48..1fe69866befd 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataPropertiesTests.java @@ -7,7 +7,6 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataProperties; import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.UsageType; @@ -18,31 +17,31 @@ public final class PlanDataPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PlanDataProperties model = BinaryData.fromString( - "{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"rwzwbng\",\"effectiveDate\":\"2021-01-28T09:21:30Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"LIFTR\"}") + "{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"jtckwhdso\",\"planDetails\":\"iy\",\"effectiveDate\":\"2021-01-18T03:53:41Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"NEWRELIC\"}") .toObject(PlanDataProperties.class); Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, model.planData().billingCycle()); - Assertions.assertEquals("rwzwbng", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-28T09:21:30Z"), model.planData().effectiveDate()); + Assertions.assertEquals("jtckwhdso", model.planData().billingCycle()); + Assertions.assertEquals("iy", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-18T03:53:41Z"), model.planData().effectiveDate()); Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); + Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PlanDataProperties model = new PlanDataProperties() .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.WEEKLY) - .withPlanDetails("rwzwbng") - .withEffectiveDate(OffsetDateTime.parse("2021-01-28T09:21:30Z"))) + .withBillingCycle("jtckwhdso") + .withPlanDetails("iy") + .withEffectiveDate(OffsetDateTime.parse("2021-01-18T03:53:41Z"))) .withOrgCreationSource(OrgCreationSource.LIFTR) - .withAccountCreationSource(AccountCreationSource.LIFTR); + .withAccountCreationSource(AccountCreationSource.NEWRELIC); model = BinaryData.fromObject(model).toObject(PlanDataProperties.class); Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, model.planData().billingCycle()); - Assertions.assertEquals("rwzwbng", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-28T09:21:30Z"), model.planData().effectiveDate()); + Assertions.assertEquals("jtckwhdso", model.planData().billingCycle()); + Assertions.assertEquals("iy", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-18T03:53:41Z"), model.planData().effectiveDate()); Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); + Assertions.assertEquals(AccountCreationSource.NEWRELIC, model.accountCreationSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java index cc403280df95..0f28c7dd2efb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataResourceInnerTests.java @@ -7,7 +7,6 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.UsageType; @@ -18,31 +17,31 @@ public final class PlanDataResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PlanDataResourceInner model = BinaryData.fromString( - "{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"l\",\"effectiveDate\":\"2020-12-23T01:20:43Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"rlyxwjkcprbnw\",\"name\":\"xgjvtbv\",\"type\":\"ysszdnrujqguh\"}") + "{\"properties\":{\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"dwzjeiach\",\"planDetails\":\"osfln\",\"effectiveDate\":\"2021-02-05T00:34:52Z\"},\"orgCreationSource\":\"LIFTR\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"ehzzvypyqrim\",\"name\":\"inpvswjdkirsoodq\",\"type\":\"hc\"}") .toObject(PlanDataResourceInner.class); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("l", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T01:20:43Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); + Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); + Assertions.assertEquals("dwzjeiach", model.planData().billingCycle()); + Assertions.assertEquals("osfln", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-05T00:34:52Z"), model.planData().effectiveDate()); + Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PlanDataResourceInner model = new PlanDataResourceInner() - .withPlanData(new PlanData().withUsageType(UsageType.PAYG) - .withBillingCycle(BillingCycle.MONTHLY) - .withPlanDetails("l") - .withEffectiveDate(OffsetDateTime.parse("2020-12-23T01:20:43Z"))) - .withOrgCreationSource(OrgCreationSource.NEWRELIC) + .withPlanData(new PlanData().withUsageType(UsageType.COMMITTED) + .withBillingCycle("dwzjeiach") + .withPlanDetails("osfln") + .withEffectiveDate(OffsetDateTime.parse("2021-02-05T00:34:52Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR) .withAccountCreationSource(AccountCreationSource.LIFTR); model = BinaryData.fromObject(model).toObject(PlanDataResourceInner.class); - Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, model.planData().billingCycle()); - Assertions.assertEquals("l", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-23T01:20:43Z"), model.planData().effectiveDate()); - Assertions.assertEquals(OrgCreationSource.NEWRELIC, model.orgCreationSource()); + Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); + Assertions.assertEquals("dwzjeiach", model.planData().billingCycle()); + Assertions.assertEquals("osfln", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-05T00:34:52Z"), model.planData().effectiveDate()); + Assertions.assertEquals(OrgCreationSource.LIFTR, model.orgCreationSource()); Assertions.assertEquals(AccountCreationSource.LIFTR, model.accountCreationSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java index f7427e96d244..e2c4ca9555eb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlanDataTests.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.UsageType; import java.time.OffsetDateTime; @@ -15,24 +14,24 @@ public final class PlanDataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PlanData model = BinaryData.fromString( - "{\"usageType\":\"COMMITTED\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"gsntnbybkzgcwr\",\"effectiveDate\":\"2021-09-26T22:03:54Z\"}") + "{\"usageType\":\"COMMITTED\",\"billingCycle\":\"vwrwj\",\"planDetails\":\"usnhutje\",\"effectiveDate\":\"2021-05-06T12:31:07Z\"}") .toObject(PlanData.class); Assertions.assertEquals(UsageType.COMMITTED, model.usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, model.billingCycle()); - Assertions.assertEquals("gsntnbybkzgcwr", model.planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T22:03:54Z"), model.effectiveDate()); + Assertions.assertEquals("vwrwj", model.billingCycle()); + Assertions.assertEquals("usnhutje", model.planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T12:31:07Z"), model.effectiveDate()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PlanData model = new PlanData().withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.WEEKLY) - .withPlanDetails("gsntnbybkzgcwr") - .withEffectiveDate(OffsetDateTime.parse("2021-09-26T22:03:54Z")); + .withBillingCycle("vwrwj") + .withPlanDetails("usnhutje") + .withEffectiveDate(OffsetDateTime.parse("2021-05-06T12:31:07Z")); model = BinaryData.fromObject(model).toObject(PlanData.class); Assertions.assertEquals(UsageType.COMMITTED, model.usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, model.billingCycle()); - Assertions.assertEquals("gsntnbybkzgcwr", model.planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T22:03:54Z"), model.effectiveDate()); + Assertions.assertEquals("vwrwj", model.billingCycle()); + Assertions.assertEquals("usnhutje", model.planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-06T12:31:07Z"), model.effectiveDate()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java index a3a931ee7706..064d5a58e07d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/PlansListMockTests.java @@ -7,12 +7,11 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanDataResource; import com.azure.resourcemanager.newrelicobservability.models.UsageType; @@ -26,24 +25,24 @@ public final class PlansListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"ft\",\"effectiveDate\":\"2021-05-16T02:46:56Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"id\":\"zvqtmnubexkp\",\"name\":\"ksmond\",\"type\":\"mquxvypo\"}]}"; + = "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"mnzgmwznmabi\",\"planDetails\":\"sorgj\",\"effectiveDate\":\"2021-10-23T19:23:01Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"LIFTR\"},\"id\":\"wrlkdmtn\",\"name\":\"vokotllxdyh\",\"type\":\"syocogjltdtbnnha\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.plans().list("dggkzzlvmbmpa", "modfvuefywsbpfvm", com.azure.core.util.Context.NONE); + = manager.plans().list("rwyhqmibzyhwitsm", "pyy", com.azure.core.util.Context.NONE); Assertions.assertEquals(UsageType.PAYG, response.iterator().next().planData().usageType()); - Assertions.assertEquals(BillingCycle.MONTHLY, response.iterator().next().planData().billingCycle()); - Assertions.assertEquals("ft", response.iterator().next().planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-16T02:46:56Z"), + Assertions.assertEquals("mnzgmwznmabi", response.iterator().next().planData().billingCycle()); + Assertions.assertEquals("sorgj", response.iterator().next().planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T19:23:01Z"), response.iterator().next().planData().effectiveDate()); Assertions.assertEquals(OrgCreationSource.NEWRELIC, response.iterator().next().orgCreationSource()); - Assertions.assertEquals(AccountCreationSource.NEWRELIC, response.iterator().next().accountCreationSource()); + Assertions.assertEquals(AccountCreationSource.LIFTR, response.iterator().next().accountCreationSource()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ResubscribePropertiesTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ResubscribePropertiesTests.java new file mode 100644 index 000000000000..702815d3a7b0 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/ResubscribePropertiesTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.models.ResubscribeProperties; +import org.junit.jupiter.api.Assertions; + +public final class ResubscribePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResubscribeProperties model = BinaryData.fromString( + "{\"planId\":\"aiuebbaumnyqu\",\"termId\":\"deoj\",\"subscriptionId\":\"bckhsmtxpsi\",\"resourceGroup\":\"tfhvpesapskrdqmh\",\"organizationId\":\"dhtldwkyz\",\"publisherId\":\"utknc\",\"offerId\":\"cwsvlxotog\"}") + .toObject(ResubscribeProperties.class); + Assertions.assertEquals("aiuebbaumnyqu", model.planId()); + Assertions.assertEquals("deoj", model.termId()); + Assertions.assertEquals("bckhsmtxpsi", model.subscriptionId()); + Assertions.assertEquals("tfhvpesapskrdqmh", model.resourceGroup()); + Assertions.assertEquals("dhtldwkyz", model.organizationId()); + Assertions.assertEquals("utknc", model.publisherId()); + Assertions.assertEquals("cwsvlxotog", model.offerId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResubscribeProperties model = new ResubscribeProperties().withPlanId("aiuebbaumnyqu") + .withTermId("deoj") + .withSubscriptionId("bckhsmtxpsi") + .withResourceGroup("tfhvpesapskrdqmh") + .withOrganizationId("dhtldwkyz") + .withPublisherId("utknc") + .withOfferId("cwsvlxotog"); + model = BinaryData.fromObject(model).toObject(ResubscribeProperties.class); + Assertions.assertEquals("aiuebbaumnyqu", model.planId()); + Assertions.assertEquals("deoj", model.termId()); + Assertions.assertEquals("bckhsmtxpsi", model.subscriptionId()); + Assertions.assertEquals("tfhvpesapskrdqmh", model.resourceGroup()); + Assertions.assertEquals("dhtldwkyz", model.organizationId()); + Assertions.assertEquals("utknc", model.publisherId()); + Assertions.assertEquals("cwsvlxotog", model.offerId()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSActivateResourceWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSActivateResourceWithResponseMockTests.java new file mode 100644 index 000000000000..3599752bd48e --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSActivateResourceWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; +import com.azure.resourcemanager.newrelicobservability.models.ActivateSaaSParameterRequest; +import com.azure.resourcemanager.newrelicobservability.models.SaaSResourceDetailsResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SaaSActivateResourceWithResponseMockTests { + @Test + public void testActivateResourceWithResponse() throws Exception { + String responseStr + = "{\"saasId\":\"pppcqeqxo\",\"id\":\"dahzxctobg\",\"name\":\"kdmoi\",\"type\":\"postmgrcfbunrm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SaaSResourceDetailsResponse response = manager.saaS() + .activateResourceWithResponse( + new ActivateSaaSParameterRequest().withSaasGuid("fdygpfqbuaceopz").withPublisherId("qrhhu"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("pppcqeqxo", response.saasId()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSDataTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSDataTests.java new file mode 100644 index 000000000000..e9f9a9b0fecf --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSDataTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.models.SaaSData; +import org.junit.jupiter.api.Assertions; + +public final class SaaSDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SaaSData model = BinaryData.fromString("{\"saaSResourceId\":\"ldhugjzzdatqxh\"}").toObject(SaaSData.class); + Assertions.assertEquals("ldhugjzzdatqxh", model.saaSResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SaaSData model = new SaaSData().withSaaSResourceId("ldhugjzzdatqxh"); + model = BinaryData.fromObject(model).toObject(SaaSData.class); + Assertions.assertEquals("ldhugjzzdatqxh", model.saaSResourceId()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSResourceDetailsResponseInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSResourceDetailsResponseInnerTests.java new file mode 100644 index 000000000000..89054e62fd63 --- /dev/null +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SaaSResourceDetailsResponseInnerTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.newrelicobservability.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.newrelicobservability.fluent.models.SaaSResourceDetailsResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class SaaSResourceDetailsResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SaaSResourceDetailsResponseInner model + = BinaryData.fromString("{\"saasId\":\"oqpsoa\",\"id\":\"tazak\",\"name\":\"j\",\"type\":\"ahbc\"}") + .toObject(SaaSResourceDetailsResponseInner.class); + Assertions.assertEquals("oqpsoa", model.saasId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SaaSResourceDetailsResponseInner model = new SaaSResourceDetailsResponseInner().withSaasId("oqpsoa"); + model = BinaryData.fromObject(model).toObject(SaaSResourceDetailsResponseInner.class); + Assertions.assertEquals("oqpsoa", model.saasId()); + } +} diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SubscriptionListTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SubscriptionListTests.java index 2f3f8b7af179..7a1e3af4d58d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SubscriptionListTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SubscriptionListTests.java @@ -24,81 +24,69 @@ public final class SubscriptionListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SubscriptionList model = BinaryData.fromString( - "{\"patchOperation\":\"DeleteComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"dhmdua\",\"status\":\"InProgress\",\"error\":\"qpv\",\"tagRules\":{\"provisioningState\":\"Creating\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{},{},{},{}],\"userEmail\":\"fmisg\"}}},{\"subscriptionId\":\"nbbelda\",\"status\":\"Failed\",\"error\":\"ali\",\"tagRules\":{\"provisioningState\":\"Deleting\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{},{},{},{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{}],\"userEmail\":\"owzxcu\"}}},{\"subscriptionId\":\"cjooxdjebwpucwwf\",\"status\":\"Active\",\"error\":\"vmeueci\",\"tagRules\":{\"provisioningState\":\"Deleted\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{},{}],\"userEmail\":\"wmcdytdxwi\"}}}],\"provisioningState\":\"Deleting\"}") + "{\"patchOperation\":\"AddComplete\",\"monitoredSubscriptionList\":[{\"subscriptionId\":\"ghkjeszzhbi\",\"status\":\"Active\",\"error\":\"fvgxbfsmxneh\",\"tagRules\":{\"provisioningState\":\"Canceled\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{},{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{},{}],\"userEmail\":\"ukgri\"}}},{\"subscriptionId\":\"lzlfbxzpuz\",\"status\":\"Deleting\",\"error\":\"pnq\",\"tagRules\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{},{},{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{},{},{}],\"userEmail\":\"kpikadrgvt\"}}}],\"provisioningState\":\"Deleted\"}") .toObject(SubscriptionList.class); - Assertions.assertEquals(PatchOperation.DELETE_COMPLETE, model.patchOperation()); - Assertions.assertEquals("dhmdua", model.monitoredSubscriptionList().get(0).subscriptionId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("qpv", model.monitoredSubscriptionList().get(0).error()); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, + Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.patchOperation()); + Assertions.assertEquals("ghkjeszzhbi", model.monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.ACTIVE, model.monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("fvgxbfsmxneh", model.monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.monitoredSubscriptionList().get(0).tagRules().logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.monitoredSubscriptionList().get(0).tagRules().logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.monitoredSubscriptionList().get(0).tagRules().logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.monitoredSubscriptionList().get(0).tagRules().metricRules().sendMetrics()); - Assertions.assertEquals("fmisg", model.monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); + Assertions.assertEquals("ukgri", model.monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SubscriptionList model - = new SubscriptionList().withPatchOperation(PatchOperation.DELETE_COMPLETE) + = new SubscriptionList().withPatchOperation(PatchOperation.ADD_COMPLETE) .withMonitoredSubscriptionList( Arrays .asList( - new MonitoredSubscriptionInner().withSubscriptionId("dhmdua") - .withStatus(Status.IN_PROGRESS) - .withError("qpv") + new MonitoredSubscriptionInner().withSubscriptionId("ghkjeszzhbi") + .withStatus(Status.ACTIVE) + .withError("fvgxbfsmxneh") .withTagRules(new MonitoringTagRulesPropertiesInner() - .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags(Arrays.asList(new FilteringTag()))) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag()))) .withMetricRules( - new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) - .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag(), - new FilteringTag(), new FilteringTag())) - .withUserEmail("fmisg"))), - new MonitoredSubscriptionInner().withSubscriptionId("nbbelda") - .withStatus(Status.FAILED) - .withError("ali") - .withTagRules( - new MonitoringTagRulesPropertiesInner() - .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag(), - new FilteringTag(), new FilteringTag()))) - .withMetricRules( - new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags(Arrays.asList(new FilteringTag())) - .withUserEmail("owzxcu"))), - new MonitoredSubscriptionInner().withSubscriptionId("cjooxdjebwpucwwf") - .withStatus(Status.ACTIVE) - .withError("vmeueci") + new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag())) + .withUserEmail("ukgri"))), + new MonitoredSubscriptionInner().withSubscriptionId("lzlfbxzpuz") + .withStatus(Status.DELETING) + .withError("pnq") .withTagRules(new MonitoringTagRulesPropertiesInner() - .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) - .withFilteringTags(Arrays.asList(new FilteringTag()))) + .withLogRules( + new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag(), + new FilteringTag()))) .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag())) - .withUserEmail("wmcdytdxwi"))))); + .withFilteringTags( + Arrays.asList(new FilteringTag(), new FilteringTag(), new FilteringTag())) + .withUserEmail("kpikadrgvt"))))); model = BinaryData.fromObject(model).toObject(SubscriptionList.class); - Assertions.assertEquals(PatchOperation.DELETE_COMPLETE, model.patchOperation()); - Assertions.assertEquals("dhmdua", model.monitoredSubscriptionList().get(0).subscriptionId()); - Assertions.assertEquals(Status.IN_PROGRESS, model.monitoredSubscriptionList().get(0).status()); - Assertions.assertEquals("qpv", model.monitoredSubscriptionList().get(0).error()); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, + Assertions.assertEquals(PatchOperation.ADD_COMPLETE, model.patchOperation()); + Assertions.assertEquals("ghkjeszzhbi", model.monitoredSubscriptionList().get(0).subscriptionId()); + Assertions.assertEquals(Status.ACTIVE, model.monitoredSubscriptionList().get(0).status()); + Assertions.assertEquals("fvgxbfsmxneh", model.monitoredSubscriptionList().get(0).error()); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.monitoredSubscriptionList().get(0).tagRules().logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.monitoredSubscriptionList().get(0).tagRules().logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.monitoredSubscriptionList().get(0).tagRules().logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.ENABLED, + Assertions.assertEquals(SendMetricsStatus.DISABLED, model.monitoredSubscriptionList().get(0).tagRules().metricRules().sendMetrics()); - Assertions.assertEquals("fmisg", model.monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); + Assertions.assertEquals("ukgri", model.monitoredSubscriptionList().get(0).tagRules().metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java index d3319906b60f..e8b34ff3fd76 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/SwitchBillingRequestTests.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.newrelicobservability.models.BillingCycle; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest; import com.azure.resourcemanager.newrelicobservability.models.UsageType; @@ -16,33 +15,33 @@ public final class SwitchBillingRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SwitchBillingRequest model = BinaryData.fromString( - "{\"azureResourceId\":\"jqkwpyeicx\",\"organizationId\":\"ciwqvhk\",\"planData\":{\"usageType\":\"COMMITTED\",\"billingCycle\":\"WEEKLY\",\"planDetails\":\"topbobjogh\",\"effectiveDate\":\"2021-04-17T11:58:30Z\"},\"userEmail\":\"u\"}") + "{\"azureResourceId\":\"rupqsxvnmicy\",\"organizationId\":\"ceoveilovno\",\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"cnjbkcnxdhbt\",\"planDetails\":\"phywpnvj\",\"effectiveDate\":\"2021-06-01T03:51:12Z\"},\"userEmail\":\"nermcl\"}") .toObject(SwitchBillingRequest.class); - Assertions.assertEquals("jqkwpyeicx", model.azureResourceId()); - Assertions.assertEquals("ciwqvhk", model.organizationId()); - Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, model.planData().billingCycle()); - Assertions.assertEquals("topbobjogh", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T11:58:30Z"), model.planData().effectiveDate()); - Assertions.assertEquals("u", model.userEmail()); + Assertions.assertEquals("rupqsxvnmicy", model.azureResourceId()); + Assertions.assertEquals("ceoveilovno", model.organizationId()); + Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); + Assertions.assertEquals("cnjbkcnxdhbt", model.planData().billingCycle()); + Assertions.assertEquals("phywpnvj", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-01T03:51:12Z"), model.planData().effectiveDate()); + Assertions.assertEquals("nermcl", model.userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SwitchBillingRequest model = new SwitchBillingRequest().withAzureResourceId("jqkwpyeicx") - .withOrganizationId("ciwqvhk") - .withPlanData(new PlanData().withUsageType(UsageType.COMMITTED) - .withBillingCycle(BillingCycle.WEEKLY) - .withPlanDetails("topbobjogh") - .withEffectiveDate(OffsetDateTime.parse("2021-04-17T11:58:30Z"))) - .withUserEmail("u"); + SwitchBillingRequest model = new SwitchBillingRequest().withAzureResourceId("rupqsxvnmicy") + .withOrganizationId("ceoveilovno") + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle("cnjbkcnxdhbt") + .withPlanDetails("phywpnvj") + .withEffectiveDate(OffsetDateTime.parse("2021-06-01T03:51:12Z"))) + .withUserEmail("nermcl"); model = BinaryData.fromObject(model).toObject(SwitchBillingRequest.class); - Assertions.assertEquals("jqkwpyeicx", model.azureResourceId()); - Assertions.assertEquals("ciwqvhk", model.organizationId()); - Assertions.assertEquals(UsageType.COMMITTED, model.planData().usageType()); - Assertions.assertEquals(BillingCycle.WEEKLY, model.planData().billingCycle()); - Assertions.assertEquals("topbobjogh", model.planData().planDetails()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T11:58:30Z"), model.planData().effectiveDate()); - Assertions.assertEquals("u", model.userEmail()); + Assertions.assertEquals("rupqsxvnmicy", model.azureResourceId()); + Assertions.assertEquals("ceoveilovno", model.organizationId()); + Assertions.assertEquals(UsageType.PAYG, model.planData().usageType()); + Assertions.assertEquals("cnjbkcnxdhbt", model.planData().billingCycle()); + Assertions.assertEquals("phywpnvj", model.planData().planDetails()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-01T03:51:12Z"), model.planData().effectiveDate()); + Assertions.assertEquals("nermcl", model.userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java index 407da58ba8e2..97b563c2d75d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleInnerTests.java @@ -21,48 +21,49 @@ public final class TagRuleInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TagRuleInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Deleting\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"yokacspkw\",\"value\":\"zdobpxjmflbvvnch\",\"action\":\"Include\"},{\"name\":\"iwwzjuqk\",\"value\":\"sa\",\"action\":\"Exclude\"},{\"name\":\"uo\",\"value\":\"skghsauuimj\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"idyjrrfbyaosvexc\",\"value\":\"npc\",\"action\":\"Exclude\"},{\"name\":\"ohslkevlegg\",\"value\":\"buhfmvfaxkffeiit\",\"action\":\"Include\"}],\"userEmail\":\"ez\"}},\"id\":\"shxmzsbbzoggigrx\",\"name\":\"burvjxxjnspy\",\"type\":\"ptkoenkoukn\"}") + "{\"properties\":{\"provisioningState\":\"Creating\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"yvjusrtslhsp\",\"value\":\"eemaofmxagkvtme\",\"action\":\"Exclude\"},{\"name\":\"rhahvljuahaquhcd\",\"value\":\"duala\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"ws\",\"value\":\"r\",\"action\":\"Include\"},{\"name\":\"vgomz\",\"value\":\"misgwbnb\",\"action\":\"Exclude\"},{\"name\":\"awkz\",\"value\":\"liourqhak\",\"action\":\"Exclude\"},{\"name\":\"shsfwxosowzxcu\",\"value\":\"cjooxdjebwpucwwf\",\"action\":\"Include\"}],\"userEmail\":\"vmeueci\"}},\"id\":\"hzceuojgjrwjue\",\"name\":\"otwmcdyt\",\"type\":\"x\"}") .toObject(TagRuleInner.class); Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("yokacspkw", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("zdobpxjmflbvvnch", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("idyjrrfbyaosvexc", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("npc", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ez", model.metricRules().userEmail()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("yvjusrtslhsp", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("eemaofmxagkvtme", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("ws", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("r", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("vmeueci", model.metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TagRuleInner model = new TagRuleInner().withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList( - new FilteringTag().withName("yokacspkw").withValue("zdobpxjmflbvvnch").withAction(TagAction.INCLUDE), - new FilteringTag().withName("iwwzjuqk").withValue("sa").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("uo").withValue("skghsauuimj").withAction(TagAction.EXCLUDE)))) - .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags(Arrays.asList( - new FilteringTag().withName("idyjrrfbyaosvexc").withValue("npc").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("ohslkevlegg") - .withValue("buhfmvfaxkffeiit") - .withAction(TagAction.INCLUDE))) - .withUserEmail("ez")); + new FilteringTag().withName("yvjusrtslhsp").withValue("eemaofmxagkvtme").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("rhahvljuahaquhcd").withValue("duala").withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + .withFilteringTags( + Arrays.asList(new FilteringTag().withName("ws").withValue("r").withAction(TagAction.INCLUDE), + new FilteringTag().withName("vgomz").withValue("misgwbnb").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("awkz").withValue("liourqhak").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("shsfwxosowzxcu") + .withValue("cjooxdjebwpucwwf") + .withAction(TagAction.INCLUDE))) + .withUserEmail("vmeueci")); model = BinaryData.fromObject(model).toObject(TagRuleInner.class); Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("yokacspkw", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("zdobpxjmflbvvnch", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("idyjrrfbyaosvexc", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("npc", model.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ez", model.metricRules().userEmail()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("yvjusrtslhsp", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("eemaofmxagkvtme", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("ws", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("r", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("vmeueci", model.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java index c17779ba63ad..4d403d67f861 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleListResultTests.java @@ -21,36 +21,45 @@ public final class TagRuleListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TagRuleListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"NotSpecified\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{},{}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{},{},{},{}],\"userEmail\":\"stkiiuxhqyud\"}},\"id\":\"rrqnbpoczvyifqrv\",\"name\":\"dvjsllrmvvdf\",\"type\":\"atkpnp\"}],\"nextLink\":\"exxbczwtr\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{},{}],\"userEmail\":\"bjtazqugxywpmu\"}},\"id\":\"fjz\",\"name\":\"fqkquj\",\"type\":\"dsuyonobgla\"},{\"properties\":{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{},{},{},{}],\"userEmail\":\"yrxvwfudwpznt\"}},\"id\":\"dzhlrq\",\"name\":\"bh\",\"type\":\"kfrlhrxsbky\"}],\"nextLink\":\"ycanuzbpzkafku\"}") .toObject(TagRuleListResult.class); Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.value().get(0).logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.value().get(0).logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.value().get(0).logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.value().get(0).metricRules().sendMetrics()); - Assertions.assertEquals("stkiiuxhqyud", model.value().get(0).metricRules().userEmail()); - Assertions.assertEquals("exxbczwtr", model.nextLink()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.value().get(0).metricRules().sendMetrics()); + Assertions.assertEquals("bjtazqugxywpmu", model.value().get(0).metricRules().userEmail()); + Assertions.assertEquals("ycanuzbpzkafku", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagRuleListResult model = new TagRuleListResult().withValue(Arrays.asList(new TagRuleInner() - .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag()))) - .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags( - Arrays.asList(new FilteringTag(), new FilteringTag(), new FilteringTag(), new FilteringTag())) - .withUserEmail("stkiiuxhqyud")))) - .withNextLink("exxbczwtr"); + TagRuleListResult model = new TagRuleListResult().withValue(Arrays.asList( + new TagRuleInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag()))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + .withFilteringTags(Arrays.asList(new FilteringTag(), new FilteringTag())) + .withUserEmail("bjtazqugxywpmu")), + new TagRuleInner() + .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags(Arrays.asList(new FilteringTag()))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + .withFilteringTags( + Arrays.asList(new FilteringTag(), new FilteringTag(), new FilteringTag(), new FilteringTag())) + .withUserEmail("yrxvwfudwpznt")))) + .withNextLink("ycanuzbpzkafku"); model = BinaryData.fromObject(model).toObject(TagRuleListResult.class); Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.value().get(0).logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.value().get(0).logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.value().get(0).logRules().sendActivityLogs()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.value().get(0).metricRules().sendMetrics()); - Assertions.assertEquals("stkiiuxhqyud", model.value().get(0).metricRules().userEmail()); - Assertions.assertEquals("exxbczwtr", model.nextLink()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.value().get(0).metricRules().sendMetrics()); + Assertions.assertEquals("bjtazqugxywpmu", model.value().get(0).metricRules().userEmail()); + Assertions.assertEquals("ycanuzbpzkafku", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java index 27c37b9679eb..5d0ecd6dfd50 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdateInnerTests.java @@ -21,48 +21,51 @@ public final class TagRuleUpdateInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TagRuleUpdateInner model = BinaryData.fromString( - "{\"properties\":{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"pwvlqdq\",\"value\":\"iqylihkaetck\",\"action\":\"Exclude\"},{\"name\":\"ivfsnk\",\"value\":\"uctqhjfbe\",\"action\":\"Exclude\"},{\"name\":\"xerf\",\"value\":\"utttxfvjrbirp\",\"action\":\"Exclude\"},{\"name\":\"c\",\"value\":\"ahfn\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"ujqgidok\",\"value\":\"ljyoxgvcltb\",\"action\":\"Include\"},{\"name\":\"ghkjeszzhbi\",\"value\":\"txfvgx\",\"action\":\"Include\"}],\"userEmail\":\"xnehmpvec\"}}}") + "{\"properties\":{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"gxhnisk\",\"value\":\"bkpyc\",\"action\":\"Include\"},{\"name\":\"ndnhj\",\"value\":\"uwhvylwzbtdhxujz\",\"action\":\"Include\"},{\"name\":\"ow\",\"value\":\"przqlveu\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"xobbcswsrt\",\"value\":\"iplrbpbewtghfgb\",\"action\":\"Include\"},{\"name\":\"xzvlvqhjkbegib\",\"value\":\"mxiebw\",\"action\":\"Include\"},{\"name\":\"ayqcgw\",\"value\":\"zjuzgwyz\",\"action\":\"Include\"},{\"name\":\"ongmtsa\",\"value\":\"cbpwxqpsrknft\",\"action\":\"Exclude\"}],\"userEmail\":\"iuhprwmdyvxqta\"}}}") .toObject(TagRuleUpdateInner.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("pwvlqdq", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("iqylihkaetck", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("ujqgidok", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("ljyoxgvcltb", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("gxhnisk", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("bkpyc", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("xobbcswsrt", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("iplrbpbewtghfgb", model.metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("xnehmpvec", model.metricRules().userEmail()); + Assertions.assertEquals("iuhprwmdyvxqta", model.metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TagRuleUpdateInner model = new TagRuleUpdateInner() .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) - .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList( - new FilteringTag().withName("pwvlqdq").withValue("iqylihkaetck").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("ivfsnk").withValue("uctqhjfbe").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("xerf").withValue("utttxfvjrbirp").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("c").withValue("ahfn").withAction(TagAction.EXCLUDE)))) - .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) + new FilteringTag().withName("gxhnisk").withValue("bkpyc").withAction(TagAction.INCLUDE), + new FilteringTag().withName("ndnhj").withValue("uwhvylwzbtdhxujz").withAction(TagAction.INCLUDE), + new FilteringTag().withName("ow").withValue("przqlveu").withAction(TagAction.INCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) .withFilteringTags(Arrays.asList( - new FilteringTag().withName("ujqgidok").withValue("ljyoxgvcltb").withAction(TagAction.INCLUDE), - new FilteringTag().withName("ghkjeszzhbi").withValue("txfvgx").withAction(TagAction.INCLUDE))) - .withUserEmail("xnehmpvec")); + new FilteringTag().withName("xobbcswsrt") + .withValue("iplrbpbewtghfgb") + .withAction(TagAction.INCLUDE), + new FilteringTag().withName("xzvlvqhjkbegib").withValue("mxiebw").withAction(TagAction.INCLUDE), + new FilteringTag().withName("ayqcgw").withValue("zjuzgwyz").withAction(TagAction.INCLUDE), + new FilteringTag().withName("ongmtsa").withValue("cbpwxqpsrknft").withAction(TagAction.EXCLUDE))) + .withUserEmail("iuhprwmdyvxqta")); model = BinaryData.fromObject(model).toObject(TagRuleUpdateInner.class); Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("pwvlqdq", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("iqylihkaetck", model.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("ujqgidok", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("ljyoxgvcltb", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("gxhnisk", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("bkpyc", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, model.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("xobbcswsrt", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("iplrbpbewtghfgb", model.metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("xnehmpvec", model.metricRules().userEmail()); + Assertions.assertEquals("iuhprwmdyvxqta", model.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java index b1b26ba8c490..e316919534b7 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRuleUpdatePropertiesInnerTests.java @@ -21,48 +21,48 @@ public final class TagRuleUpdatePropertiesInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TagRuleUpdatePropertiesInner model = BinaryData.fromString( - "{\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"bmpukgriwflz\",\"value\":\"bxzpuzycisp\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"rp\",\"value\":\"dhibnuq\",\"action\":\"Include\"},{\"name\":\"kadrgvt\",\"value\":\"gnbuy\",\"action\":\"Exclude\"},{\"name\":\"gg\",\"value\":\"bfs\",\"action\":\"Include\"},{\"name\":\"utrc\",\"value\":\"na\",\"action\":\"Exclude\"}],\"userEmail\":\"jrunmpxtt\"}}") + "{\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"xrmcqibycnojvk\",\"value\":\"e\",\"action\":\"Exclude\"},{\"name\":\"zvahapjy\",\"value\":\"pvgqzcjrvxdjzlm\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"zovawjvz\",\"value\":\"luthn\",\"action\":\"Include\"},{\"name\":\"xipeilpjzuaejx\",\"value\":\"ltskzbbtd\",\"action\":\"Include\"},{\"name\":\"e\",\"value\":\"gpw\",\"action\":\"Include\"},{\"name\":\"kfpbs\",\"value\":\"ofd\",\"action\":\"Exclude\"}],\"userEmail\":\"sd\"}}") .toObject(TagRuleUpdatePropertiesInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("bmpukgriwflz", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("bxzpuzycisp", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("xrmcqibycnojvk", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("e", model.logRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("rp", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("dhibnuq", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("zovawjvz", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("luthn", model.metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("jrunmpxtt", model.metricRules().userEmail()); + Assertions.assertEquals("sd", model.metricRules().userEmail()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagRuleUpdatePropertiesInner model = new TagRuleUpdatePropertiesInner() - .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) - .withSendActivityLogs(SendActivityLogsStatus.ENABLED) - .withFilteringTags(Arrays.asList(new FilteringTag().withName("bmpukgriwflz") - .withValue("bxzpuzycisp") - .withAction(TagAction.EXCLUDE)))) - .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags( - Arrays.asList(new FilteringTag().withName("rp").withValue("dhibnuq").withAction(TagAction.INCLUDE), - new FilteringTag().withName("kadrgvt").withValue("gnbuy").withAction(TagAction.EXCLUDE), - new FilteringTag().withName("gg").withValue("bfs").withAction(TagAction.INCLUDE), - new FilteringTag().withName("utrc").withValue("na").withAction(TagAction.EXCLUDE))) - .withUserEmail("jrunmpxtt")); + TagRuleUpdatePropertiesInner model = new TagRuleUpdatePropertiesInner().withLogRules(new LogRules() + .withSendAadLogs(SendAadLogsStatus.ENABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) + .withSendActivityLogs(SendActivityLogsStatus.DISABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("xrmcqibycnojvk").withValue("e").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("zvahapjy").withValue("pvgqzcjrvxdjzlm").withAction(TagAction.EXCLUDE)))) + .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.ENABLED) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("zovawjvz").withValue("luthn").withAction(TagAction.INCLUDE), + new FilteringTag().withName("xipeilpjzuaejx").withValue("ltskzbbtd").withAction(TagAction.INCLUDE), + new FilteringTag().withName("e").withValue("gpw").withAction(TagAction.INCLUDE), + new FilteringTag().withName("kfpbs").withValue("ofd").withAction(TagAction.EXCLUDE))) + .withUserEmail("sd")); model = BinaryData.fromObject(model).toObject(TagRuleUpdatePropertiesInner.class); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, model.logRules().sendAadLogs()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, model.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, model.logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.ENABLED, model.logRules().sendActivityLogs()); - Assertions.assertEquals("bmpukgriwflz", model.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("bxzpuzycisp", model.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(SendActivityLogsStatus.DISABLED, model.logRules().sendActivityLogs()); + Assertions.assertEquals("xrmcqibycnojvk", model.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("e", model.logRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, model.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, model.metricRules().sendMetrics()); - Assertions.assertEquals("rp", model.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("dhibnuq", model.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, model.metricRules().sendMetrics()); + Assertions.assertEquals("zovawjvz", model.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("luthn", model.metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.INCLUDE, model.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("jrunmpxtt", model.metricRules().userEmail()); + Assertions.assertEquals("sd", model.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java index 2459b19c945c..e5eb4095ee6d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesCreateOrUpdateMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; @@ -30,44 +30,46 @@ public final class TagRulesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"jmoadsuv\",\"value\":\"m\",\"action\":\"Include\"},{\"name\":\"jsjqbjhhyx\",\"value\":\"wlycoduhpkxkg\",\"action\":\"Include\"},{\"name\":\"eqnajxqugjhkycu\",\"value\":\"ddg\",\"action\":\"Include\"},{\"name\":\"wqm\",\"value\":\"alkrmn\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"udfnbyxba\",\"value\":\"bjyvay\",\"action\":\"Exclude\"}],\"userEmail\":\"rzrtuzqogsex\"}},\"id\":\"vfdnwnwmewzsyyce\",\"name\":\"zsoibjudpfrxtr\",\"type\":\"hzv\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"acstwityk\",\"value\":\"vxccedcp\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"xltjcvnhltiu\",\"value\":\"xnavvwxq\",\"action\":\"Include\"},{\"name\":\"unyowxwl\",\"value\":\"jrkvfgbvfvpdbo\",\"action\":\"Exclude\"}],\"userEmail\":\"zsjqlh\"}},\"id\":\"r\",\"name\":\"bdeibqipqk\",\"type\":\"hvxndzwmkrefajpj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); TagRule response = manager.tagRules() - .define("hfjx") - .withExistingMonitor("himdbl", "gwimfn") + .define("enuuzkopbm") + .withExistingMonitor("zr", "rdgrtw") .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.DISABLED) - .withSendSubscriptionLogs(SendSubscriptionLogsStatus.DISABLED) + .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList( - new FilteringTag().withName("kzikfjawneaivxwc") - .withValue("lpcirelsf") - .withAction(TagAction.EXCLUDE), - new FilteringTag().withName("wabfatkl") - .withValue("xbjhwuaanozjosph") - .withAction(TagAction.INCLUDE)))) + new FilteringTag().withName("u").withValue("fozbhdmsmlmzqhof").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("equi").withValue("xicslfao").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("yylhalnswhccsp") + .withValue("aivwitqscywu") + .withAction(TagAction.EXCLUDE)))) .withMetricRules(new MetricRulesInner().withSendMetrics(SendMetricsStatus.DISABLED) - .withFilteringTags( - Arrays.asList(new FilteringTag().withName("ag").withValue("vimjwos").withAction(TagAction.INCLUDE))) - .withUserEmail("tcs")) + .withFilteringTags(Arrays.asList( + new FilteringTag().withName("bwemhairs").withValue("gzd").withAction(TagAction.INCLUDE), + new FilteringTag().withName("eypqwdxggicccn").withValue("huexmk").withAction(TagAction.EXCLUDE), + new FilteringTag().withName("tvlz").withValue("emhzrncsdtc").withAction(TagAction.INCLUDE), + new FilteringTag().withName("ypbsfgytguslfead").withValue("gq").withAction(TagAction.EXCLUDE))) + .withUserEmail("ejhzisxg")) .create(); - Assertions.assertEquals(SendAadLogsStatus.ENABLED, response.logRules().sendAadLogs()); + Assertions.assertEquals(SendAadLogsStatus.DISABLED, response.logRules().sendAadLogs()); Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, response.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, response.logRules().sendActivityLogs()); - Assertions.assertEquals("jmoadsuv", response.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("m", response.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, response.logRules().filteringTags().get(0).action()); + Assertions.assertEquals("acstwityk", response.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("vxccedcp", response.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, response.logRules().filteringTags().get(0).action()); Assertions.assertEquals(SendMetricsStatus.DISABLED, response.metricRules().sendMetrics()); - Assertions.assertEquals("udfnbyxba", response.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("bjyvay", response.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, response.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("rzrtuzqogsex", response.metricRules().userEmail()); + Assertions.assertEquals("xltjcvnhltiu", response.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("xnavvwxq", response.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, response.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("zsjqlh", response.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java index 43af27ef8aec..3d201d0bafed 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.tagRules().delete("g", "xrtfudxep", "gyqagvrvmnpkuk", com.azure.core.util.Context.NONE); + manager.tagRules().delete("ewpusdsttwvogvb", "ejdcngqqmoakuf", "m", com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java index 94300f4e0caf..dbe6cda2c213 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; @@ -26,29 +26,29 @@ public final class TagRulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Canceled\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"zqioxiysuii\",\"value\":\"nkedyatrwyhqmib\",\"action\":\"Include\"},{\"name\":\"itsmypyyn\",\"value\":\"dpumnzgmw\",\"action\":\"Exclude\"},{\"name\":\"biknsorgjhxbld\",\"value\":\"wwrlkdmtncv\",\"action\":\"Exclude\"},{\"name\":\"llxdyhgs\",\"value\":\"cogjltdtbn\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"vcikhnvpamqgx\",\"value\":\"u\",\"action\":\"Include\"},{\"name\":\"ywggx\",\"value\":\"lla\",\"action\":\"Include\"},{\"name\":\"wuipiccjzkzivg\",\"value\":\"c\",\"action\":\"Include\"}],\"userEmail\":\"hyrnxxmu\"}},\"id\":\"dndrdvstkwqqtche\",\"name\":\"lmfmtdaay\",\"type\":\"dvwvgpio\"}"; + = "{\"properties\":{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Enabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"vexztvbtqgs\",\"value\":\"aoyzkoow\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"q\",\"value\":\"dsyuuximerqfob\",\"action\":\"Exclude\"}],\"userEmail\":\"kby\"}},\"id\":\"t\",\"name\":\"pfhpagmhrskdsnfd\",\"type\":\"doakgtdlmkkzevdl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); TagRule response = manager.tagRules() - .getWithResponse("synljphuopxodl", "iyntorzihle", "sjswsrms", com.azure.core.util.Context.NONE) + .getWithResponse("haz", "khnzbonlw", "toego", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(SendAadLogsStatus.DISABLED, response.logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, response.logRules().sendSubscriptionLogs()); + Assertions.assertEquals(SendAadLogsStatus.ENABLED, response.logRules().sendAadLogs()); + Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, response.logRules().sendSubscriptionLogs()); Assertions.assertEquals(SendActivityLogsStatus.DISABLED, response.logRules().sendActivityLogs()); - Assertions.assertEquals("zqioxiysuii", response.logRules().filteringTags().get(0).name()); - Assertions.assertEquals("nkedyatrwyhqmib", response.logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, response.logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, response.metricRules().sendMetrics()); - Assertions.assertEquals("vcikhnvpamqgx", response.metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("u", response.metricRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.INCLUDE, response.metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("hyrnxxmu", response.metricRules().userEmail()); + Assertions.assertEquals("vexztvbtqgs", response.logRules().filteringTags().get(0).name()); + Assertions.assertEquals("aoyzkoow", response.logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, response.logRules().filteringTags().get(0).action()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, response.metricRules().sendMetrics()); + Assertions.assertEquals("q", response.metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("dsyuuximerqfob", response.metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.EXCLUDE, response.metricRules().filteringTags().get(0).action()); + Assertions.assertEquals("kby", response.metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java index 0c942c71e49f..ab71547b4755 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/TagRulesListByNewRelicMonitorResourceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; @@ -27,33 +27,32 @@ public final class TagRulesListByNewRelicMonitorResourceMockTests { @Test public void testListByNewRelicMonitorResource() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Disabled\",\"sendActivityLogs\":\"Enabled\",\"filteringTags\":[{\"name\":\"lpichk\",\"value\":\"mkcdyhbpkkpwdre\",\"action\":\"Exclude\"}]},\"metricRules\":{\"sendMetrics\":\"Disabled\",\"filteringTags\":[{\"name\":\"ljxywsu\",\"value\":\"yrs\",\"action\":\"Exclude\"},{\"name\":\"tgadgvraeaen\",\"value\":\"nzar\",\"action\":\"Exclude\"},{\"name\":\"uu\",\"value\":\"fqka\",\"action\":\"Include\"}],\"userEmail\":\"ipfpubji\"}},\"id\":\"wifto\",\"name\":\"qkvpuvksgplsakn\",\"type\":\"n\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"logRules\":{\"sendAadLogs\":\"Disabled\",\"sendSubscriptionLogs\":\"Enabled\",\"sendActivityLogs\":\"Disabled\",\"filteringTags\":[{\"name\":\"altol\",\"value\":\"cwsobqwcs\",\"action\":\"Include\"},{\"name\":\"dcfhucqdpf\",\"value\":\"glsbjjc\",\"action\":\"Include\"},{\"name\":\"bvtvudutncormr\",\"value\":\"qtvcofudflvkgj\",\"action\":\"Include\"}]},\"metricRules\":{\"sendMetrics\":\"Enabled\",\"filteringTags\":[{\"name\":\"saznqntoruds\",\"value\":\"a\",\"action\":\"Exclude\"},{\"name\":\"c\",\"value\":\"auwjuetaebu\",\"action\":\"Exclude\"},{\"name\":\"movsmzlxwabmqoe\",\"value\":\"ifrvtpu\",\"action\":\"Include\"},{\"name\":\"qlgkfbtn\",\"value\":\"aongbj\",\"action\":\"Exclude\"}],\"userEmail\":\"jitcjedftwwaez\"}},\"id\":\"jvdcpzfoqouic\",\"name\":\"bxarzgszufoxci\",\"type\":\"opidoamciodh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NewRelicObservabilityManager manager = NewRelicObservabilityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.tagRules() - .listByNewRelicMonitorResource("iuqgbdbutauv", "btkuwhh", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.tagRules().listByNewRelicMonitorResource("yq", "xzfe", com.azure.core.util.Context.NONE); Assertions.assertEquals(SendAadLogsStatus.DISABLED, response.iterator().next().logRules().sendAadLogs()); - Assertions.assertEquals(SendSubscriptionLogsStatus.DISABLED, + Assertions.assertEquals(SendSubscriptionLogsStatus.ENABLED, response.iterator().next().logRules().sendSubscriptionLogs()); - Assertions.assertEquals(SendActivityLogsStatus.ENABLED, + Assertions.assertEquals(SendActivityLogsStatus.DISABLED, response.iterator().next().logRules().sendActivityLogs()); - Assertions.assertEquals("lpichk", response.iterator().next().logRules().filteringTags().get(0).name()); - Assertions.assertEquals("mkcdyhbpkkpwdre", - response.iterator().next().logRules().filteringTags().get(0).value()); - Assertions.assertEquals(TagAction.EXCLUDE, + Assertions.assertEquals("altol", response.iterator().next().logRules().filteringTags().get(0).name()); + Assertions.assertEquals("cwsobqwcs", response.iterator().next().logRules().filteringTags().get(0).value()); + Assertions.assertEquals(TagAction.INCLUDE, response.iterator().next().logRules().filteringTags().get(0).action()); - Assertions.assertEquals(SendMetricsStatus.DISABLED, response.iterator().next().metricRules().sendMetrics()); - Assertions.assertEquals("ljxywsu", response.iterator().next().metricRules().filteringTags().get(0).name()); - Assertions.assertEquals("yrs", response.iterator().next().metricRules().filteringTags().get(0).value()); + Assertions.assertEquals(SendMetricsStatus.ENABLED, response.iterator().next().metricRules().sendMetrics()); + Assertions.assertEquals("saznqntoruds", response.iterator().next().metricRules().filteringTags().get(0).name()); + Assertions.assertEquals("a", response.iterator().next().metricRules().filteringTags().get(0).value()); Assertions.assertEquals(TagAction.EXCLUDE, response.iterator().next().metricRules().filteringTags().get(0).action()); - Assertions.assertEquals("ipfpubji", response.iterator().next().metricRules().userEmail()); + Assertions.assertEquals("jitcjedftwwaez", response.iterator().next().metricRules().userEmail()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java index c341cdf7e5df..1e1ad0b7eb3d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserAssignedIdentityTests.java @@ -11,7 +11,7 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"2afaa392-448a-47a3-891b-b41604fbc1f0\",\"clientId\":\"594a5240-c392-4d0f-93ac-15a1f61c66fe\"}") + "{\"principalId\":\"edcffb2c-aa7e-4b24-aaad-76cf51b330ff\",\"clientId\":\"184e0ef7-4f79-45d1-9a49-b8c521ecb2f0\"}") .toObject(UserAssignedIdentity.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java index 0e4b3ba1775c..e02ddde6013f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/UserInfoTests.java @@ -12,27 +12,27 @@ public final class UserInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UserInfo model = BinaryData.fromString( - "{\"firstName\":\"cciqihnhungbwjz\",\"lastName\":\"fygxgispemvtzfk\",\"emailAddress\":\"ubljofxqe\",\"phoneNumber\":\"jaeq\",\"country\":\"qjbasvms\"}") + "{\"firstName\":\"fmppe\",\"lastName\":\"vmgxsab\",\"emailAddress\":\"qduujitcjczdz\",\"phoneNumber\":\"ndhkrw\",\"country\":\"appd\"}") .toObject(UserInfo.class); - Assertions.assertEquals("cciqihnhungbwjz", model.firstName()); - Assertions.assertEquals("fygxgispemvtzfk", model.lastName()); - Assertions.assertEquals("ubljofxqe", model.emailAddress()); - Assertions.assertEquals("jaeq", model.phoneNumber()); - Assertions.assertEquals("qjbasvms", model.country()); + Assertions.assertEquals("fmppe", model.firstName()); + Assertions.assertEquals("vmgxsab", model.lastName()); + Assertions.assertEquals("qduujitcjczdz", model.emailAddress()); + Assertions.assertEquals("ndhkrw", model.phoneNumber()); + Assertions.assertEquals("appd", model.country()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserInfo model = new UserInfo().withFirstName("cciqihnhungbwjz") - .withLastName("fygxgispemvtzfk") - .withEmailAddress("ubljofxqe") - .withPhoneNumber("jaeq") - .withCountry("qjbasvms"); + UserInfo model = new UserInfo().withFirstName("fmppe") + .withLastName("vmgxsab") + .withEmailAddress("qduujitcjczdz") + .withPhoneNumber("ndhkrw") + .withCountry("appd"); model = BinaryData.fromObject(model).toObject(UserInfo.class); - Assertions.assertEquals("cciqihnhungbwjz", model.firstName()); - Assertions.assertEquals("fygxgispemvtzfk", model.lastName()); - Assertions.assertEquals("ubljofxqe", model.emailAddress()); - Assertions.assertEquals("jaeq", model.phoneNumber()); - Assertions.assertEquals("qjbasvms", model.country()); + Assertions.assertEquals("fmppe", model.firstName()); + Assertions.assertEquals("vmgxsab", model.lastName()); + Assertions.assertEquals("qduujitcjczdz", model.emailAddress()); + Assertions.assertEquals("ndhkrw", model.phoneNumber()); + Assertions.assertEquals("appd", model.country()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java index 03f5b171bd3e..2ea683f44fe8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMHostsListResponseTests.java @@ -14,24 +14,28 @@ public final class VMHostsListResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VMHostsListResponse model = BinaryData.fromString( - "{\"value\":[{\"vmId\":\"gxlefgugnxkrxd\",\"agentVersion\":\"i\",\"agentStatus\":\"thz\"}],\"nextLink\":\"qdrabhjybigehoqf\"}") + "{\"value\":[{\"vmId\":\"pxjmflbvvnchr\",\"agentVersion\":\"ciwwzjuqkhr\",\"agentStatus\":\"jiwkuofoskghsau\"},{\"vmId\":\"mjmvxieduugidyjr\",\"agentVersion\":\"byao\",\"agentStatus\":\"e\"},{\"vmId\":\"sonpclhocohs\",\"agentVersion\":\"ev\",\"agentStatus\":\"ggzfbu\"}],\"nextLink\":\"mvfaxkffeiith\"}") .toObject(VMHostsListResponse.class); - Assertions.assertEquals("gxlefgugnxkrxd", model.value().get(0).vmId()); - Assertions.assertEquals("i", model.value().get(0).agentVersion()); - Assertions.assertEquals("thz", model.value().get(0).agentStatus()); - Assertions.assertEquals("qdrabhjybigehoqf", model.nextLink()); + Assertions.assertEquals("pxjmflbvvnchr", model.value().get(0).vmId()); + Assertions.assertEquals("ciwwzjuqkhr", model.value().get(0).agentVersion()); + Assertions.assertEquals("jiwkuofoskghsau", model.value().get(0).agentStatus()); + Assertions.assertEquals("mvfaxkffeiith", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { VMHostsListResponse model = new VMHostsListResponse() - .withValue(Arrays - .asList(new VMInfoInner().withVmId("gxlefgugnxkrxd").withAgentVersion("i").withAgentStatus("thz"))) - .withNextLink("qdrabhjybigehoqf"); + .withValue(Arrays.asList( + new VMInfoInner().withVmId("pxjmflbvvnchr") + .withAgentVersion("ciwwzjuqkhr") + .withAgentStatus("jiwkuofoskghsau"), + new VMInfoInner().withVmId("mjmvxieduugidyjr").withAgentVersion("byao").withAgentStatus("e"), + new VMInfoInner().withVmId("sonpclhocohs").withAgentVersion("ev").withAgentStatus("ggzfbu"))) + .withNextLink("mvfaxkffeiith"); model = BinaryData.fromObject(model).toObject(VMHostsListResponse.class); - Assertions.assertEquals("gxlefgugnxkrxd", model.value().get(0).vmId()); - Assertions.assertEquals("i", model.value().get(0).agentVersion()); - Assertions.assertEquals("thz", model.value().get(0).agentStatus()); - Assertions.assertEquals("qdrabhjybigehoqf", model.nextLink()); + Assertions.assertEquals("pxjmflbvvnchr", model.value().get(0).vmId()); + Assertions.assertEquals("ciwwzjuqkhr", model.value().get(0).agentVersion()); + Assertions.assertEquals("jiwkuofoskghsau", model.value().get(0).agentStatus()); + Assertions.assertEquals("mvfaxkffeiith", model.nextLink()); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java index 8fc9411a20b8..22ddbe58feaa 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/test/java/com/azure/resourcemanager/newrelicobservability/generated/VMInfoInnerTests.java @@ -11,21 +11,20 @@ public final class VMInfoInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - VMInfoInner model = BinaryData - .fromString("{\"vmId\":\"wska\",\"agentVersion\":\"ktzlcuiywg\",\"agentStatus\":\"wgndrvynhzgpp\"}") - .toObject(VMInfoInner.class); - Assertions.assertEquals("wska", model.vmId()); - Assertions.assertEquals("ktzlcuiywg", model.agentVersion()); - Assertions.assertEquals("wgndrvynhzgpp", model.agentStatus()); + VMInfoInner model + = BinaryData.fromString("{\"vmId\":\"m\",\"agentVersion\":\"yvshxmz\",\"agentStatus\":\"bzoggigrx\"}") + .toObject(VMInfoInner.class); + Assertions.assertEquals("m", model.vmId()); + Assertions.assertEquals("yvshxmz", model.agentVersion()); + Assertions.assertEquals("bzoggigrx", model.agentStatus()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VMInfoInner model - = new VMInfoInner().withVmId("wska").withAgentVersion("ktzlcuiywg").withAgentStatus("wgndrvynhzgpp"); + VMInfoInner model = new VMInfoInner().withVmId("m").withAgentVersion("yvshxmz").withAgentStatus("bzoggigrx"); model = BinaryData.fromObject(model).toObject(VMInfoInner.class); - Assertions.assertEquals("wska", model.vmId()); - Assertions.assertEquals("ktzlcuiywg", model.agentVersion()); - Assertions.assertEquals("wgndrvynhzgpp", model.agentStatus()); + Assertions.assertEquals("m", model.vmId()); + Assertions.assertEquals("yvshxmz", model.agentVersion()); + Assertions.assertEquals("bzoggigrx", model.agentStatus()); } }