diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 90ae54c437b8f..328b4aadf4dfe 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -436,7 +436,7 @@ com.azure.resourcemanager:azure-resourcemanager-storagemover;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-graphservices;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-paloaltonetworks-ngfw;1.1.0;1.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.1.0;1.2.0 com.azure.resourcemanager:azure-resourcemanager-qumulo;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-selfhelp;1.0.0;1.1.0-beta.6 com.azure.resourcemanager:azure-resourcemanager-networkcloud;1.0.0;1.1.0-beta.2 diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md index 80306d4bc6512..ec4ff77e937d1 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/CHANGELOG.md @@ -1,14 +1,21 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2024-12-19) -### Features Added +- 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). ### Breaking Changes -### Bugs Fixed +#### Serialization/Deserialization change + +- `Jackson` is removed from dependency and no longer supported. + +##### Migration Guide -### Other Changes +If you are using `Jackson`/`ObjectMapper` for manual serialization/deserialization, configure your `ObjectMapper` for backward compatibility: +```java +objectMapper.registerModule(com.azure.core.serializer.json.jackson.JacksonJsonProvider.getJsonSerializableDatabindModule()); +``` ## 1.1.0 (2024-03-15) diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md index 83d0779a85648..7136c4502fd88 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-newrelicobservability - 1.1.0 + 1.2.0 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md index e482148640f75..c2df2326dd3b5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/SAMPLE.md @@ -135,8 +135,8 @@ public final class ConnectedPartnerResourcesListSamples { */ public static void connectedPartnerResourcesList( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.connectedPartnerResources().list("myResourceGroup", "myMonitor", null, - com.azure.core.util.Context.NONE); + manager.connectedPartnerResources() + .list("myResourceGroup", "myMonitor", null, com.azure.core.util.Context.NONE); } } ``` @@ -161,8 +161,10 @@ public final class MonitoredSubscriptionsCreateorUpdateSamples { */ public static void monitorsAddMonitoredSubscriptions( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitoredSubscriptions().define(ConfigurationName.DEFAULT) - .withExistingMonitor("myResourceGroup", "myMonitor").create(); + manager.monitoredSubscriptions() + .define(ConfigurationName.DEFAULT) + .withExistingMonitor("myResourceGroup", "myMonitor") + .create(); } } ``` @@ -187,8 +189,8 @@ public final class MonitoredSubscriptionsDeleteSamples { */ public static void monitorsDeleteMonitoredSubscriptions( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitoredSubscriptions().delete("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, - com.azure.core.util.Context.NONE); + manager.monitoredSubscriptions() + .delete("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, com.azure.core.util.Context.NONE); } } ``` @@ -213,8 +215,9 @@ public final class MonitoredSubscriptionsGetSamples { */ public static void monitorsGetMonitoredSubscriptions( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitoredSubscriptions().getWithResponse("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, - com.azure.core.util.Context.NONE); + manager.monitoredSubscriptions() + .getWithResponse("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, + com.azure.core.util.Context.NONE); } } ``` @@ -263,8 +266,10 @@ public final class MonitoredSubscriptionsUpdateSamples { */ public static void monitorsUpdateMonitoredSubscriptions( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - MonitoredSubscriptionProperties resource = manager.monitoredSubscriptions().getWithResponse("myResourceGroup", - "myMonitor", ConfigurationName.DEFAULT, com.azure.core.util.Context.NONE).getValue(); + MonitoredSubscriptionProperties resource = manager.monitoredSubscriptions() + .getWithResponse("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, + com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } @@ -307,24 +312,37 @@ public final class MonitorsCreateOrUpdateSamples { */ public static void monitorsCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().define("cdlymktqw").withRegion("k").withExistingResourceGroup("rgNewRelic") + manager.monitors() + .define("cdlymktqw") + .withRegion("k") + .withExistingResourceGroup("rgNewRelic") .withTags(mapOf("key6976", "fakeTokenPlaceholder")) .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("vcscxlncofcuduadesd") - .withAccountInfo(new AccountInfo() - .withAccountId("xhqmg").withIngestionKey("fakeTokenPlaceholder").withRegion("ljcf")) + .withAccountInfo(new AccountInfo().withAccountId("xhqmg") + .withIngestionKey("fakeTokenPlaceholder") + .withRegion("ljcf")) .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) - .withSingleSignOnProperties(new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("kwiwfz") - .withSingleSignOnUrl("kvseueuljsxmfwpqctz").withProvisioningState(ProvisioningState.ACCEPTED))) + .withSingleSignOnProperties( + new NewRelicSingleSignOnProperties().withSingleSignOnState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("kwiwfz") + .withSingleSignOnUrl("kvseueuljsxmfwpqctz") + .withProvisioningState(ProvisioningState.ACCEPTED))) .withUserInfo(new UserInfo().withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") - .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc").withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") - .withPhoneNumber("krf").withCountry("hslqnwdanrconqyekwbnttaetv")) - .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR) - .withSubscriptionState("Suspended").withSaaSAzureSubscriptionStatus("Subscribed").create(); + .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc") + .withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") + .withPhoneNumber("krf") + .withCountry("hslqnwdanrconqyekwbnttaetv")) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga") + .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR) + .withAccountCreationSource(AccountCreationSource.LIFTR) + .withSubscriptionState("Suspended") + .withSaaSAzureSubscriptionStatus("Subscribed") + .create(); } // Use "Map.of" if available @@ -359,8 +377,9 @@ public final class MonitorsDeleteSamples { */ public static void monitorsDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* @@ -374,8 +393,9 @@ public final class MonitorsDeleteSamples { */ public static void monitorsDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } ``` @@ -423,8 +443,9 @@ public final class MonitorsGetMetricRulesSamples { */ public static void monitorsGetMetricRulesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); + manager.monitors() + .getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } /* @@ -438,8 +459,9 @@ public final class MonitorsGetMetricRulesSamples { */ public static void monitorsGetMetricRulesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); + manager.monitors() + .getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } } ``` @@ -465,11 +487,12 @@ public final class MonitorsGetMetricStatusSamples { */ public static void monitorsGetMetricStatusMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* @@ -483,11 +506,12 @@ public final class MonitorsGetMetricStatusSamples { */ public static void monitorsGetMetricStatusMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } ``` @@ -536,11 +560,12 @@ public final class MonitorsListAppServicesSamples { */ public static void monitorsListAppServicesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* @@ -554,11 +579,12 @@ public final class MonitorsListAppServicesSamples { */ public static void monitorsListAppServicesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } ``` @@ -607,10 +633,11 @@ public final class MonitorsListHostsSamples { */ public static void monitorsListHostsMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listHosts( - "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", new HostsGetRequest() - .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")).withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .listHosts("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + new HostsGetRequest().withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* @@ -624,10 +651,11 @@ public final class MonitorsListHostsSamples { */ public static void monitorsListHostsMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listHosts( - "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", new HostsGetRequest() - .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")).withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .listHosts("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + new HostsGetRequest().withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } ``` @@ -674,8 +702,8 @@ public final class MonitorsListMonitoredResourcesSamples { */ public static void monitorsListMonitoredResourcesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); } /* @@ -689,8 +717,8 @@ public final class MonitorsListMonitoredResourcesSamples { */ public static void monitorsListMonitoredResourcesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); } } ``` @@ -719,8 +747,9 @@ public final class MonitorsSwitchBillingSamples { */ public static void monitorsSwitchBillingMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new SwitchBillingRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); + manager.monitors() + .switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new SwitchBillingRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } /* @@ -734,14 +763,17 @@ public final class MonitorsSwitchBillingSamples { */ public static void monitorsSwitchBillingMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new SwitchBillingRequest().withAzureResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") - .withOrganizationId("k") - .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new SwitchBillingRequest().withAzureResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") + .withOrganizationId("k") + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga") + .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } } ``` @@ -785,23 +817,33 @@ public final class MonitorsUpdateSamples { public static void monitorsUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { NewRelicMonitorResource resource = manager.monitors() - .getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE).getValue(); - resource.update().withTags(mapOf("key164", "fakeTokenPlaceholder")) + .getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key164", "fakeTokenPlaceholder")) .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("vcscxlncofcuduadesd") - .withAccountInfo(new AccountInfo() - .withAccountId("xhqmg").withIngestionKey("fakeTokenPlaceholder").withRegion("ljcf")) + .withAccountInfo(new AccountInfo().withAccountId("xhqmg") + .withIngestionKey("fakeTokenPlaceholder") + .withRegion("ljcf")) .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) - .withSingleSignOnProperties(new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("kwiwfz") - .withSingleSignOnUrl("kvseueuljsxmfwpqctz").withProvisioningState(ProvisioningState.ACCEPTED))) + .withSingleSignOnProperties( + new NewRelicSingleSignOnProperties().withSingleSignOnState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("kwiwfz") + .withSingleSignOnUrl("kvseueuljsxmfwpqctz") + .withProvisioningState(ProvisioningState.ACCEPTED))) .withUserInfo(new UserInfo().withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") - .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc").withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") - .withPhoneNumber("krf").withCountry("hslqnwdanrconqyekwbnttaetv")) - .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR) + .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc") + .withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") + .withPhoneNumber("krf") + .withCountry("hslqnwdanrconqyekwbnttaetv")) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga") + .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR) + .withAccountCreationSource(AccountCreationSource.LIFTR) .apply(); } @@ -837,8 +879,8 @@ public final class MonitorsVmHostPayloadSamples { */ public static void monitorsVmHostPayloadMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); } /* @@ -852,8 +894,8 @@ public final class MonitorsVmHostPayloadSamples { */ public static void monitorsVmHostPayloadMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); } } ``` @@ -996,16 +1038,19 @@ public final class TagRulesCreateOrUpdateSamples { */ public static void tagRulesCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().define("bxcantgzggsepbhqmedjqyrqeezmfb") + manager.tagRules() + .define("bxcantgzggsepbhqmedjqyrqeezmfb") .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron") .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE)))) + .withValue("sarxrqsxouhdjwsrqqicbeirdb") + .withAction(TagAction.INCLUDE)))) .withMetricRules(new MetricRulesInner() .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE))) + .withValue("sarxrqsxouhdjwsrqqicbeirdb") + .withAction(TagAction.INCLUDE))) .withUserEmail("test@testing.com")) .create(); } @@ -1021,8 +1066,10 @@ public final class TagRulesCreateOrUpdateSamples { */ public static void tagRulesCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().define("bxcantgzggsepbhqmedjqyrqeezmfb") - .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron").create(); + manager.tagRules() + .define("bxcantgzggsepbhqmedjqyrqeezmfb") + .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron") + .create(); } } ``` @@ -1045,8 +1092,9 @@ public final class TagRulesDeleteSamples { */ public static void tagRulesDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules() + .delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } /* @@ -1060,8 +1108,9 @@ public final class TagRulesDeleteSamples { */ public static void tagRulesDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules() + .delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } } ``` @@ -1084,8 +1133,9 @@ public final class TagRulesGetSamples { */ public static void tagRulesGetMinimumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules() + .getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } /* @@ -1099,8 +1149,9 @@ public final class TagRulesGetSamples { */ public static void tagRulesGetMaximumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules() + .getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } } ``` @@ -1123,8 +1174,9 @@ public final class TagRulesListByNewRelicMonitorResourceSamples { */ public static void tagRulesListByNewRelicMonitorResourceMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.tagRules() + .listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* @@ -1138,8 +1190,9 @@ public final class TagRulesListByNewRelicMonitorResourceSamples { */ public static void tagRulesListByNewRelicMonitorResourceMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.tagRules() + .listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } ``` @@ -1172,17 +1225,21 @@ public final class TagRulesUpdateSamples { */ public static void tagRulesUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - TagRule resource = manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", com.azure.core.util.Context.NONE).getValue(); + TagRule resource = manager.tagRules() + .getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE) + .getValue(); resource.update() .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE)))) + .withValue("sarxrqsxouhdjwsrqqicbeirdb") + .withAction(TagAction.INCLUDE)))) .withMetricRules(new MetricRulesInner() .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE))) + .withValue("sarxrqsxouhdjwsrqqicbeirdb") + .withAction(TagAction.INCLUDE))) .withUserEmail("test@testing.com")) .apply(); } @@ -1198,8 +1255,10 @@ public final class TagRulesUpdateSamples { */ public static void tagRulesUpdateMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - TagRule resource = manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", com.azure.core.util.Context.NONE).getValue(); + TagRule resource = manager.tagRules() + .getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml index 85846a4d287f3..aee7a8d9123fb 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/pom.xml @@ -14,7 +14,7 @@ com.azure.resourcemanager azure-resourcemanager-newrelicobservability - 1.2.0-beta.1 + 1.2.0 jar Microsoft Azure SDK for NewRelicObservability Management @@ -45,6 +45,7 @@ UTF-8 0 0 + false 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 bb75e41f72186..37e31488cc716 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 @@ -11,6 +11,7 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -19,7 +20,6 @@ import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -237,7 +237,7 @@ public NewRelicObservabilityManager authenticate(TokenCredential credential, Azu .append("-") .append("com.azure.resourcemanager.newrelicobservability") .append("/") - .append("1.1.0"); + .append("1.2.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -270,7 +270,7 @@ public NewRelicObservabilityManager authenticate(TokenCredential credential, Azu HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); 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 3c6d45adb7000..9363f36ddcc49 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 @@ -100,7 +100,7 @@ MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String monito * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param body The 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. @@ -134,7 +134,7 @@ MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, St * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param body The 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. @@ -167,7 +167,7 @@ MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupName, St * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param body The 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. @@ -201,7 +201,7 @@ MonitoredSubscriptionPropertiesInner update(String resourceGroupName, String mon * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @param body The 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. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountProperties.java index 9c2d1eba9b28d..674eba40e08c2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountProperties.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.newrelicobservability.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * List of all the New relic accounts for the given user. */ @Fluent -public final class AccountProperties { +public final class AccountProperties implements JsonSerializable { /* * organization id */ - @JsonProperty(value = "organizationId") private String organizationId; /* * account id */ - @JsonProperty(value = "accountId") private String accountId; /* * account name */ - @JsonProperty(value = "accountName") private String accountName; /* * Region where New Relic account is present */ - @JsonProperty(value = "region") private String region; /** @@ -129,4 +129,49 @@ public AccountProperties withRegion(String region) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("organizationId", this.organizationId); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountProperties 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 AccountProperties. + */ + public static AccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountProperties deserializedAccountProperties = new AccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("organizationId".equals(fieldName)) { + deserializedAccountProperties.organizationId = reader.getString(); + } else if ("accountId".equals(fieldName)) { + deserializedAccountProperties.accountId = reader.getString(); + } else if ("accountName".equals(fieldName)) { + deserializedAccountProperties.accountName = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedAccountProperties.region = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountProperties; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountResourceInner.java index b9fea867ecf55..ee8aba8385379 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AccountResourceInner.java @@ -7,7 +7,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The details of a account resource. @@ -17,15 +20,28 @@ public final class AccountResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private AccountProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of AccountResourceInner class. */ @@ -50,6 +66,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the organizationId property: organization id. * @@ -152,4 +198,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountResourceInner 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 AccountResourceInner. + */ + public static AccountResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountResourceInner deserializedAccountResourceInner = new AccountResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccountResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAccountResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAccountResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAccountResourceInner.innerProperties = AccountProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAccountResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountResourceInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AppServiceInfoInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AppServiceInfoInner.java index 6ebc8c67419cb..15a56cc03d4d9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AppServiceInfoInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/AppServiceInfoInner.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.newrelicobservability.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of VM Resource having NewRelic OneAgent installed. */ @Fluent -public final class AppServiceInfoInner { +public final class AppServiceInfoInner implements JsonSerializable { /* * Azure App service resource ID */ - @JsonProperty(value = "azureResourceId") private String azureResourceId; /* * Version of the NewRelic agent installed on the App service. */ - @JsonProperty(value = "agentVersion") private String agentVersion; /* * Status of the NewRelic agent installed on the App service. */ - @JsonProperty(value = "agentStatus") private String agentStatus; /** @@ -103,4 +104,46 @@ public AppServiceInfoInner withAgentStatus(String agentStatus) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("agentVersion", this.agentVersion); + jsonWriter.writeStringField("agentStatus", this.agentStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppServiceInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppServiceInfoInner 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 AppServiceInfoInner. + */ + public static AppServiceInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppServiceInfoInner deserializedAppServiceInfoInner = new AppServiceInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureResourceId".equals(fieldName)) { + deserializedAppServiceInfoInner.azureResourceId = reader.getString(); + } else if ("agentVersion".equals(fieldName)) { + deserializedAppServiceInfoInner.agentVersion = reader.getString(); + } else if ("agentStatus".equals(fieldName)) { + deserializedAppServiceInfoInner.agentStatus = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppServiceInfoInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/BillingInfoResponseInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/BillingInfoResponseInner.java index 835449f04a4f7..646d2b535e65b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/BillingInfoResponseInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/BillingInfoResponseInner.java @@ -5,25 +5,27 @@ 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 com.azure.resourcemanager.newrelicobservability.models.MarketplaceSaaSInfo; import com.azure.resourcemanager.newrelicobservability.models.PartnerBillingEntity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Marketplace Subscription and Organization details to which resource gets billed into. */ @Fluent -public final class BillingInfoResponseInner { +public final class BillingInfoResponseInner implements JsonSerializable { /* * Marketplace Subscription details */ - @JsonProperty(value = "marketplaceSaasInfo") private MarketplaceSaaSInfo marketplaceSaasInfo; /* * Partner Billing Entity details: Organization Info */ - @JsonProperty(value = "partnerBillingEntity") private PartnerBillingEntity partnerBillingEntity; /** @@ -85,4 +87,43 @@ public void validate() { partnerBillingEntity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("marketplaceSaasInfo", this.marketplaceSaasInfo); + jsonWriter.writeJsonField("partnerBillingEntity", this.partnerBillingEntity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingInfoResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingInfoResponseInner 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 BillingInfoResponseInner. + */ + public static BillingInfoResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingInfoResponseInner deserializedBillingInfoResponseInner = new BillingInfoResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("marketplaceSaasInfo".equals(fieldName)) { + deserializedBillingInfoResponseInner.marketplaceSaasInfo = MarketplaceSaaSInfo.fromJson(reader); + } else if ("partnerBillingEntity".equals(fieldName)) { + deserializedBillingInfoResponseInner.partnerBillingEntity = PartnerBillingEntity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBillingInfoResponseInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/ConnectedPartnerResourcesListFormatInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/ConnectedPartnerResourcesListFormatInner.java index 19a6b659015e8..7055547aef234 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/ConnectedPartnerResourcesListFormatInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/ConnectedPartnerResourcesListFormatInner.java @@ -5,18 +5,22 @@ 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 com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourceProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Connected Partner Resources List Format. */ @Fluent -public final class ConnectedPartnerResourcesListFormatInner { +public final class ConnectedPartnerResourcesListFormatInner + implements JsonSerializable { /* * Connected Partner Resource Properties */ - @JsonProperty(value = "properties") private ConnectedPartnerResourceProperties properties; /** @@ -55,4 +59,42 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedPartnerResourcesListFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedPartnerResourcesListFormatInner 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 ConnectedPartnerResourcesListFormatInner. + */ + public static ConnectedPartnerResourcesListFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedPartnerResourcesListFormatInner deserializedConnectedPartnerResourcesListFormatInner + = new ConnectedPartnerResourcesListFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedConnectedPartnerResourcesListFormatInner.properties + = ConnectedPartnerResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedPartnerResourcesListFormatInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LinkedResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LinkedResourceInner.java index d3f7375f257f8..f016209892157 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LinkedResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/LinkedResourceInner.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.newrelicobservability.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The definition of a linked resource. */ @Fluent -public final class LinkedResourceInner { +public final class LinkedResourceInner implements JsonSerializable { /* * The ARM id of the linked resource. */ - @JsonProperty(value = "id") private String id; /** @@ -51,4 +54,40 @@ public LinkedResourceInner withId(String id) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinkedResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinkedResourceInner 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 LinkedResourceInner. + */ + public static LinkedResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinkedResourceInner deserializedLinkedResourceInner = new LinkedResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLinkedResourceInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLinkedResourceInner; + }); + } } 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 eadf1eb2a7474..737bb3631ac90 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 @@ -5,32 +5,33 @@ 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 com.azure.resourcemanager.newrelicobservability.models.FilteringTag; import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Set of rules for sending metrics for the Monitor resource. */ @Fluent -public final class MetricRulesInner { +public final class MetricRulesInner implements JsonSerializable { /* * Flag specifying if metrics should be sent for the Monitor resource. */ - @JsonProperty(value = "sendMetrics") private SendMetricsStatus sendMetrics; /* * List of filtering tags to be used for capturing metrics. */ - @JsonProperty(value = "filteringTags") private List filteringTags; /* * User Email */ - @JsonProperty(value = "userEmail") private String userEmail; /** @@ -109,4 +110,47 @@ public void validate() { filteringTags().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sendMetrics", this.sendMetrics == null ? null : this.sendMetrics.toString()); + jsonWriter.writeArrayField("filteringTags", this.filteringTags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("userEmail", this.userEmail); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricRulesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricRulesInner 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 MetricRulesInner. + */ + public static MetricRulesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricRulesInner deserializedMetricRulesInner = new MetricRulesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sendMetrics".equals(fieldName)) { + deserializedMetricRulesInner.sendMetrics = SendMetricsStatus.fromString(reader.getString()); + } else if ("filteringTags".equals(fieldName)) { + List filteringTags = reader.readArray(reader1 -> FilteringTag.fromJson(reader1)); + deserializedMetricRulesInner.filteringTags = filteringTags; + } else if ("userEmail".equals(fieldName)) { + deserializedMetricRulesInner.userEmail = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricRulesInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricsStatusResponseInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricsStatusResponseInner.java index e3e0cb38499ec..c8367d9706656 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricsStatusResponseInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MetricsStatusResponseInner.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.newrelicobservability.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Response of get metrics status Operation. */ @Fluent -public final class MetricsStatusResponseInner { +public final class MetricsStatusResponseInner implements JsonSerializable { /* * Azure resource IDs */ - @JsonProperty(value = "azureResourceIds") private List azureResourceIds; /** @@ -52,4 +55,42 @@ public MetricsStatusResponseInner withAzureResourceIds(List azureResourc */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("azureResourceIds", this.azureResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsStatusResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsStatusResponseInner 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 MetricsStatusResponseInner. + */ + public static MetricsStatusResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsStatusResponseInner deserializedMetricsStatusResponseInner = new MetricsStatusResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureResourceIds".equals(fieldName)) { + List azureResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricsStatusResponseInner.azureResourceIds = azureResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsStatusResponseInner; + }); + } } 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 9684d76c19645..454404c3be467 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 @@ -5,6 +5,10 @@ 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 com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.LiftrResourceCategories; import com.azure.resourcemanager.newrelicobservability.models.MarketplaceSubscriptionStatus; @@ -14,89 +18,76 @@ import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Properties specific to the NewRelic Monitor resource. */ @Fluent -public final class MonitorProperties { +public final class MonitorProperties implements JsonSerializable { /* * Provisioning State of the resource */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * MonitoringStatus of the resource */ - @JsonProperty(value = "monitoringStatus", access = JsonProperty.Access.WRITE_ONLY) private MonitoringStatus monitoringStatus; /* * NewRelic Organization properties of the resource */ - @JsonProperty(value = "marketplaceSubscriptionStatus", access = JsonProperty.Access.WRITE_ONLY) private MarketplaceSubscriptionStatus marketplaceSubscriptionStatus; /* * Marketplace Subscription Id */ - @JsonProperty(value = "marketplaceSubscriptionId", access = JsonProperty.Access.WRITE_ONLY) private String marketplaceSubscriptionId; /* * MarketplaceSubscriptionStatus of the resource */ - @JsonProperty(value = "newRelicAccountProperties") private NewRelicAccountProperties newRelicAccountProperties; /* * User Info */ - @JsonProperty(value = "userInfo") private UserInfo userInfo; /* * Plan details */ - @JsonProperty(value = "planData") private PlanData planData; /* * Liftr resource category */ - @JsonProperty(value = "liftrResourceCategory", access = JsonProperty.Access.WRITE_ONLY) private LiftrResourceCategories liftrResourceCategory; /* * Liftr resource preference. The priority of the resource. */ - @JsonProperty(value = "liftrResourcePreference", access = JsonProperty.Access.WRITE_ONLY) private Integer liftrResourcePreference; /* * Source of org creation */ - @JsonProperty(value = "orgCreationSource") private OrgCreationSource orgCreationSource; /* * Source of account creation */ - @JsonProperty(value = "accountCreationSource") private AccountCreationSource accountCreationSource; /* * State of the Azure Subscription containing the monitor resource */ - @JsonProperty(value = "subscriptionState") private String subscriptionState; /* * Status of Azure Subscription where Marketplace SaaS is located. */ - @JsonProperty(value = "saaSAzureSubscriptionStatus") private String saaSAzureSubscriptionStatus; /** @@ -315,4 +306,76 @@ public void validate() { planData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("newRelicAccountProperties", this.newRelicAccountProperties); + jsonWriter.writeJsonField("userInfo", this.userInfo); + jsonWriter.writeJsonField("planData", this.planData); + jsonWriter.writeStringField("orgCreationSource", + this.orgCreationSource == null ? null : this.orgCreationSource.toString()); + jsonWriter.writeStringField("accountCreationSource", + this.accountCreationSource == null ? null : this.accountCreationSource.toString()); + jsonWriter.writeStringField("subscriptionState", this.subscriptionState); + jsonWriter.writeStringField("saaSAzureSubscriptionStatus", this.saaSAzureSubscriptionStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitorProperties 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 MonitorProperties. + */ + public static MonitorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitorProperties deserializedMonitorProperties = new MonitorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedMonitorProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("monitoringStatus".equals(fieldName)) { + deserializedMonitorProperties.monitoringStatus = MonitoringStatus.fromString(reader.getString()); + } else if ("marketplaceSubscriptionStatus".equals(fieldName)) { + deserializedMonitorProperties.marketplaceSubscriptionStatus + = MarketplaceSubscriptionStatus.fromString(reader.getString()); + } else if ("marketplaceSubscriptionId".equals(fieldName)) { + deserializedMonitorProperties.marketplaceSubscriptionId = reader.getString(); + } else if ("newRelicAccountProperties".equals(fieldName)) { + deserializedMonitorProperties.newRelicAccountProperties + = NewRelicAccountProperties.fromJson(reader); + } else if ("userInfo".equals(fieldName)) { + deserializedMonitorProperties.userInfo = UserInfo.fromJson(reader); + } else if ("planData".equals(fieldName)) { + deserializedMonitorProperties.planData = PlanData.fromJson(reader); + } else if ("liftrResourceCategory".equals(fieldName)) { + deserializedMonitorProperties.liftrResourceCategory + = LiftrResourceCategories.fromString(reader.getString()); + } else if ("liftrResourcePreference".equals(fieldName)) { + deserializedMonitorProperties.liftrResourcePreference = reader.getNullable(JsonReader::getInt); + } else if ("orgCreationSource".equals(fieldName)) { + deserializedMonitorProperties.orgCreationSource = OrgCreationSource.fromString(reader.getString()); + } else if ("accountCreationSource".equals(fieldName)) { + deserializedMonitorProperties.accountCreationSource + = AccountCreationSource.fromString(reader.getString()); + } else if ("subscriptionState".equals(fieldName)) { + deserializedMonitorProperties.subscriptionState = reader.getString(); + } else if ("saaSAzureSubscriptionStatus".equals(fieldName)) { + deserializedMonitorProperties.saaSAzureSubscriptionStatus = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitorProperties; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredResourceInner.java index 2067b0609c848..ca2b4717b8600 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredResourceInner.java @@ -5,43 +5,42 @@ 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 com.azure.resourcemanager.newrelicobservability.models.SendingLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Details of resource being monitored by NewRelic monitor resource. */ @Fluent -public final class MonitoredResourceInner { +public final class MonitoredResourceInner implements JsonSerializable { /* * The ARM id of the resource. */ - @JsonProperty(value = "id") private String id; /* * Flag indicating if resource is sending metrics to NewRelic. */ - @JsonProperty(value = "sendingMetrics") private SendingMetricsStatus sendingMetrics; /* * Reason for why the resource is sending metrics (or why it is not sending). */ - @JsonProperty(value = "reasonForMetricsStatus") private String reasonForMetricsStatus; /* * Flag indicating if resource is sending logs to NewRelic. */ - @JsonProperty(value = "sendingLogs") private SendingLogsStatus sendingLogs; /* * Reason for why the resource is sending logs (or why it is not sending). */ - @JsonProperty(value = "reasonForLogsStatus") private String reasonForLogsStatus; /** @@ -159,4 +158,54 @@ public MonitoredResourceInner withReasonForLogsStatus(String reasonForLogsStatus */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("sendingMetrics", + this.sendingMetrics == null ? null : this.sendingMetrics.toString()); + jsonWriter.writeStringField("reasonForMetricsStatus", this.reasonForMetricsStatus); + jsonWriter.writeStringField("sendingLogs", this.sendingLogs == null ? null : this.sendingLogs.toString()); + jsonWriter.writeStringField("reasonForLogsStatus", this.reasonForLogsStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoredResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoredResourceInner 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 MonitoredResourceInner. + */ + public static MonitoredResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoredResourceInner deserializedMonitoredResourceInner = new MonitoredResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMonitoredResourceInner.id = reader.getString(); + } else if ("sendingMetrics".equals(fieldName)) { + deserializedMonitoredResourceInner.sendingMetrics + = SendingMetricsStatus.fromString(reader.getString()); + } else if ("reasonForMetricsStatus".equals(fieldName)) { + deserializedMonitoredResourceInner.reasonForMetricsStatus = reader.getString(); + } else if ("sendingLogs".equals(fieldName)) { + deserializedMonitoredResourceInner.sendingLogs = SendingLogsStatus.fromString(reader.getString()); + } else if ("reasonForLogsStatus".equals(fieldName)) { + deserializedMonitoredResourceInner.reasonForLogsStatus = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoredResourceInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionInner.java index 46e8a7c4dbee2..c52c4418ace5b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionInner.java @@ -5,36 +5,36 @@ 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 com.azure.resourcemanager.newrelicobservability.models.Status; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The list of subscriptions and it's monitoring status by current NewRelic monitor. */ @Fluent -public final class MonitoredSubscriptionInner { +public final class MonitoredSubscriptionInner implements JsonSerializable { /* * The subscriptionId to be monitored. */ - @JsonProperty(value = "subscriptionId") private String subscriptionId; /* * The state of monitoring. */ - @JsonProperty(value = "status") private Status status; /* * The reason of not monitoring the subscription. */ - @JsonProperty(value = "error") private String error; /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "tagRules") private MonitoringTagRulesPropertiesInner tagRules; /** @@ -133,4 +133,50 @@ public void validate() { tagRules().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("error", this.error); + jsonWriter.writeJsonField("tagRules", this.tagRules); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoredSubscriptionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoredSubscriptionInner 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 MonitoredSubscriptionInner. + */ + public static MonitoredSubscriptionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoredSubscriptionInner deserializedMonitoredSubscriptionInner = new MonitoredSubscriptionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptionId".equals(fieldName)) { + deserializedMonitoredSubscriptionInner.subscriptionId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedMonitoredSubscriptionInner.status = Status.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedMonitoredSubscriptionInner.error = reader.getString(); + } else if ("tagRules".equals(fieldName)) { + deserializedMonitoredSubscriptionInner.tagRules + = MonitoringTagRulesPropertiesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoredSubscriptionInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionPropertiesInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionPropertiesInner.java index aa16c325c746f..6b7ff7a49ce1b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionPropertiesInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoredSubscriptionPropertiesInner.java @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.newrelicobservability.models.SubscriptionList; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The request to update subscriptions needed to be monitored by the NewRelic monitor resource. @@ -17,9 +20,23 @@ public final class MonitoredSubscriptionPropertiesInner extends ProxyResource { /* * The request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ - @JsonProperty(value = "properties") private SubscriptionList properties; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of MonitoredSubscriptionPropertiesInner class. */ @@ -48,6 +65,36 @@ public MonitoredSubscriptionPropertiesInner withProperties(SubscriptionList prop return this; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Validates the instance. * @@ -58,4 +105,48 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoredSubscriptionPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoredSubscriptionPropertiesInner 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 MonitoredSubscriptionPropertiesInner. + */ + public static MonitoredSubscriptionPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoredSubscriptionPropertiesInner deserializedMonitoredSubscriptionPropertiesInner + = new MonitoredSubscriptionPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMonitoredSubscriptionPropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMonitoredSubscriptionPropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMonitoredSubscriptionPropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMonitoredSubscriptionPropertiesInner.properties = SubscriptionList.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoredSubscriptionPropertiesInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoringTagRulesPropertiesInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoringTagRulesPropertiesInner.java index 69fba227d8739..bcbfeebd9af31 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoringTagRulesPropertiesInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/MonitoringTagRulesPropertiesInner.java @@ -5,31 +5,32 @@ 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 com.azure.resourcemanager.newrelicobservability.models.LogRules; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The resource-specific properties for this resource. */ @Fluent -public final class MonitoringTagRulesPropertiesInner { +public final class MonitoringTagRulesPropertiesInner implements JsonSerializable { /* * Provisioning State of the resource */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * Set of rules for sending logs for the Monitor resource. */ - @JsonProperty(value = "logRules") private LogRules logRules; /* * Set of rules for sending metrics for the Monitor resource. */ - @JsonProperty(value = "metricRules") private MetricRulesInner metricRules; /** @@ -100,4 +101,47 @@ public void validate() { metricRules().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logRules", this.logRules); + jsonWriter.writeJsonField("metricRules", this.metricRules); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoringTagRulesPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoringTagRulesPropertiesInner 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 MonitoringTagRulesPropertiesInner. + */ + public static MonitoringTagRulesPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoringTagRulesPropertiesInner deserializedMonitoringTagRulesPropertiesInner + = new MonitoringTagRulesPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedMonitoringTagRulesPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("logRules".equals(fieldName)) { + deserializedMonitoringTagRulesPropertiesInner.logRules = LogRules.fromJson(reader); + } else if ("metricRules".equals(fieldName)) { + deserializedMonitoringTagRulesPropertiesInner.metricRules = MetricRulesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoringTagRulesPropertiesInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceInner.java index 2d24d2e99e2bc..7eeb2b2125b01 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceInner.java @@ -8,6 +8,9 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.LiftrResourceCategories; import com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity; @@ -18,7 +21,7 @@ import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -29,21 +32,33 @@ public final class NewRelicMonitorResourceInner extends Resource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private MonitorProperties innerProperties = new MonitorProperties(); /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of NewRelicMonitorResourceInner class. */ @@ -88,6 +103,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * {@inheritDoc} */ @@ -329,8 +374,9 @@ public NewRelicMonitorResourceInner withSaaSAzureSubscriptionStatus(String saaSA */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property innerProperties in model NewRelicMonitorResourceInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model NewRelicMonitorResourceInner")); } else { innerProperties().validate(); } @@ -340,4 +386,59 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(NewRelicMonitorResourceInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NewRelicMonitorResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NewRelicMonitorResourceInner 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 NewRelicMonitorResourceInner. + */ + public static NewRelicMonitorResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NewRelicMonitorResourceInner deserializedNewRelicMonitorResourceInner = new NewRelicMonitorResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNewRelicMonitorResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNewRelicMonitorResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNewRelicMonitorResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNewRelicMonitorResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNewRelicMonitorResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNewRelicMonitorResourceInner.innerProperties = MonitorProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedNewRelicMonitorResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNewRelicMonitorResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNewRelicMonitorResourceInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceUpdateProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceUpdateProperties.java index f4ef675e1293d..202efcef9e91f 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceUpdateProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/NewRelicMonitorResourceUpdateProperties.java @@ -5,46 +5,46 @@ 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 com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanData; import com.azure.resourcemanager.newrelicobservability.models.UserInfo; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The updatable properties of the NewRelicMonitorResource. */ @Fluent -public final class NewRelicMonitorResourceUpdateProperties { +public final class NewRelicMonitorResourceUpdateProperties + implements JsonSerializable { /* * MarketplaceSubscriptionStatus of the resource */ - @JsonProperty(value = "newRelicAccountProperties") private NewRelicAccountProperties newRelicAccountProperties; /* * User Info */ - @JsonProperty(value = "userInfo") private UserInfo userInfo; /* * Plan details */ - @JsonProperty(value = "planData") private PlanData planData; /* * Source of org creation */ - @JsonProperty(value = "orgCreationSource") private OrgCreationSource orgCreationSource; /* * Source of account creation */ - @JsonProperty(value = "accountCreationSource") private AccountCreationSource accountCreationSource; /** @@ -171,4 +171,58 @@ public void validate() { planData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("newRelicAccountProperties", this.newRelicAccountProperties); + jsonWriter.writeJsonField("userInfo", this.userInfo); + jsonWriter.writeJsonField("planData", this.planData); + jsonWriter.writeStringField("orgCreationSource", + this.orgCreationSource == null ? null : this.orgCreationSource.toString()); + jsonWriter.writeStringField("accountCreationSource", + this.accountCreationSource == null ? null : this.accountCreationSource.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NewRelicMonitorResourceUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NewRelicMonitorResourceUpdateProperties 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 NewRelicMonitorResourceUpdateProperties. + */ + public static NewRelicMonitorResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NewRelicMonitorResourceUpdateProperties deserializedNewRelicMonitorResourceUpdateProperties + = new NewRelicMonitorResourceUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("newRelicAccountProperties".equals(fieldName)) { + deserializedNewRelicMonitorResourceUpdateProperties.newRelicAccountProperties + = NewRelicAccountProperties.fromJson(reader); + } else if ("userInfo".equals(fieldName)) { + deserializedNewRelicMonitorResourceUpdateProperties.userInfo = UserInfo.fromJson(reader); + } else if ("planData".equals(fieldName)) { + deserializedNewRelicMonitorResourceUpdateProperties.planData = PlanData.fromJson(reader); + } else if ("orgCreationSource".equals(fieldName)) { + deserializedNewRelicMonitorResourceUpdateProperties.orgCreationSource + = OrgCreationSource.fromString(reader.getString()); + } else if ("accountCreationSource".equals(fieldName)) { + deserializedNewRelicMonitorResourceUpdateProperties.accountCreationSource + = AccountCreationSource.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNewRelicMonitorResourceUpdateProperties; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OperationInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OperationInner.java index fcb6e352326f2..8865d4c049dba 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OperationInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OperationInner.java @@ -5,10 +5,14 @@ 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 com.azure.resourcemanager.newrelicobservability.models.ActionType; import com.azure.resourcemanager.newrelicobservability.models.OperationDisplay; import com.azure.resourcemanager.newrelicobservability.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * REST API Operation @@ -16,38 +20,33 @@ * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent -public final class OperationInner { +public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for * ARM/control-plane operations. */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; /* * Localized display information for this particular operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default * value is "user,system" */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; /** @@ -126,4 +125,48 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner 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 OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationProperties.java index 687ebeed98901..b720dca5b7401 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationProperties.java @@ -5,30 +5,31 @@ 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 com.azure.resourcemanager.newrelicobservability.models.BillingSource; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Details of Organizations. */ @Fluent -public final class OrganizationProperties { +public final class OrganizationProperties implements JsonSerializable { /* * organization id */ - @JsonProperty(value = "organizationId") private String organizationId; /* * organization name */ - @JsonProperty(value = "organizationName") private String organizationName; /* * Billing source */ - @JsonProperty(value = "billingSource") private BillingSource billingSource; /** @@ -104,4 +105,46 @@ public OrganizationProperties withBillingSource(BillingSource billingSource) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("organizationId", this.organizationId); + jsonWriter.writeStringField("organizationName", this.organizationName); + jsonWriter.writeStringField("billingSource", this.billingSource == null ? null : this.billingSource.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationProperties 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 OrganizationProperties. + */ + public static OrganizationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationProperties deserializedOrganizationProperties = new OrganizationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("organizationId".equals(fieldName)) { + deserializedOrganizationProperties.organizationId = reader.getString(); + } else if ("organizationName".equals(fieldName)) { + deserializedOrganizationProperties.organizationName = reader.getString(); + } else if ("billingSource".equals(fieldName)) { + deserializedOrganizationProperties.billingSource = BillingSource.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationProperties; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationResourceInner.java index 49728479de56a..3e64ba77b7c07 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/OrganizationResourceInner.java @@ -7,8 +7,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.newrelicobservability.models.BillingSource; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The details of a Organization resource. @@ -18,15 +21,28 @@ public final class OrganizationResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private OrganizationProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of OrganizationResourceInner class. */ @@ -51,6 +67,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the organizationId property: organization id. * @@ -130,4 +176,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationResourceInner 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 OrganizationResourceInner. + */ + public static OrganizationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationResourceInner deserializedOrganizationResourceInner = new OrganizationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOrganizationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOrganizationResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOrganizationResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOrganizationResourceInner.innerProperties = OrganizationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOrganizationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationResourceInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataProperties.java index 2773e5d2527c1..86a2051c6fc24 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataProperties.java @@ -5,32 +5,33 @@ 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 com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Plan details. */ @Fluent -public final class PlanDataProperties { +public final class PlanDataProperties implements JsonSerializable { /* * Plan details */ - @JsonProperty(value = "planData") private PlanData planData; /* * Source of org creation */ - @JsonProperty(value = "orgCreationSource") private OrgCreationSource orgCreationSource; /* * Source of account creation */ - @JsonProperty(value = "accountCreationSource") private AccountCreationSource accountCreationSource; /** @@ -109,4 +110,49 @@ public void validate() { planData().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("planData", this.planData); + jsonWriter.writeStringField("orgCreationSource", + this.orgCreationSource == null ? null : this.orgCreationSource.toString()); + jsonWriter.writeStringField("accountCreationSource", + this.accountCreationSource == null ? null : this.accountCreationSource.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlanDataProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlanDataProperties 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 PlanDataProperties. + */ + public static PlanDataProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlanDataProperties deserializedPlanDataProperties = new PlanDataProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("planData".equals(fieldName)) { + deserializedPlanDataProperties.planData = PlanData.fromJson(reader); + } else if ("orgCreationSource".equals(fieldName)) { + deserializedPlanDataProperties.orgCreationSource = OrgCreationSource.fromString(reader.getString()); + } else if ("accountCreationSource".equals(fieldName)) { + deserializedPlanDataProperties.accountCreationSource + = AccountCreationSource.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPlanDataProperties; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataResourceInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataResourceInner.java index 000633eb66ce7..9e54f2ba4ef34 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataResourceInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/PlanDataResourceInner.java @@ -7,10 +7,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource; import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource; import com.azure.resourcemanager.newrelicobservability.models.PlanData; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The details of a PlanData resource. @@ -20,15 +23,28 @@ public final class PlanDataResourceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private PlanDataProperties innerProperties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of PlanDataResourceInner class. */ @@ -53,6 +69,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the planData property: Plan details. * @@ -132,4 +178,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlanDataResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlanDataResourceInner 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 PlanDataResourceInner. + */ + public static PlanDataResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlanDataResourceInner deserializedPlanDataResourceInner = new PlanDataResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPlanDataResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPlanDataResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPlanDataResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPlanDataResourceInner.innerProperties = PlanDataProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPlanDataResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPlanDataResourceInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleInner.java index 9990f515edcbb..653f1d910709b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleInner.java @@ -8,9 +8,12 @@ import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.newrelicobservability.models.LogRules; import com.azure.resourcemanager.newrelicobservability.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * A tag rule belonging to NewRelic account. @@ -20,15 +23,28 @@ public final class TagRuleInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties", required = true) private MonitoringTagRulesPropertiesInner innerProperties = new MonitoringTagRulesPropertiesInner(); /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of TagRuleInner class. */ @@ -53,6 +69,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Get the provisioningState property: Provisioning State of the resource. * @@ -115,12 +161,57 @@ public TagRuleInner withMetricRules(MetricRulesInner metricRules) { */ public void validate() { if (innerProperties() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model TagRuleInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model TagRuleInner")); } else { innerProperties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(TagRuleInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagRuleInner 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 TagRuleInner. + */ + public static TagRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagRuleInner deserializedTagRuleInner = new TagRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTagRuleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTagRuleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTagRuleInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTagRuleInner.innerProperties = MonitoringTagRulesPropertiesInner.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTagRuleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTagRuleInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdateInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdateInner.java index 20f78dee1a815..751175bfb3b96 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdateInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdateInner.java @@ -5,18 +5,21 @@ 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 com.azure.resourcemanager.newrelicobservability.models.LogRules; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The type used for update operations of the TagRule. */ @Fluent -public final class TagRuleUpdateInner { +public final class TagRuleUpdateInner implements JsonSerializable { /* * The updatable properties of the TagRule. */ - @JsonProperty(value = "properties") private TagRuleUpdatePropertiesInner innerProperties; /** @@ -90,4 +93,40 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagRuleUpdateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagRuleUpdateInner 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 TagRuleUpdateInner. + */ + public static TagRuleUpdateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagRuleUpdateInner deserializedTagRuleUpdateInner = new TagRuleUpdateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedTagRuleUpdateInner.innerProperties = TagRuleUpdatePropertiesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTagRuleUpdateInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdatePropertiesInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdatePropertiesInner.java index 1dc98a2c7f9d6..0f29858557615 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdatePropertiesInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/TagRuleUpdatePropertiesInner.java @@ -5,24 +5,26 @@ 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 com.azure.resourcemanager.newrelicobservability.models.LogRules; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The updatable properties of the TagRule. */ @Fluent -public final class TagRuleUpdatePropertiesInner { +public final class TagRuleUpdatePropertiesInner implements JsonSerializable { /* * Set of rules for sending logs for the Monitor resource. */ - @JsonProperty(value = "logRules") private LogRules logRules; /* * Set of rules for sending metrics for the Monitor resource. */ - @JsonProperty(value = "metricRules") private MetricRulesInner metricRules; /** @@ -84,4 +86,43 @@ public void validate() { metricRules().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("logRules", this.logRules); + jsonWriter.writeJsonField("metricRules", this.metricRules); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagRuleUpdatePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagRuleUpdatePropertiesInner 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 TagRuleUpdatePropertiesInner. + */ + public static TagRuleUpdatePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagRuleUpdatePropertiesInner deserializedTagRuleUpdatePropertiesInner = new TagRuleUpdatePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logRules".equals(fieldName)) { + deserializedTagRuleUpdatePropertiesInner.logRules = LogRules.fromJson(reader); + } else if ("metricRules".equals(fieldName)) { + deserializedTagRuleUpdatePropertiesInner.metricRules = MetricRulesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTagRuleUpdatePropertiesInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMExtensionPayloadInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMExtensionPayloadInner.java index 6923a21104e71..601caa34afe1a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMExtensionPayloadInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMExtensionPayloadInner.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.newrelicobservability.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 payload to be passed while installing VM agent. */ @Fluent -public final class VMExtensionPayloadInner { +public final class VMExtensionPayloadInner implements JsonSerializable { /* * Ingestion key of the account */ - @JsonProperty(value = "ingestionKey") private String ingestionKey; /** @@ -51,4 +54,40 @@ public VMExtensionPayloadInner withIngestionKey(String ingestionKey) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ingestionKey", this.ingestionKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMExtensionPayloadInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMExtensionPayloadInner 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 VMExtensionPayloadInner. + */ + public static VMExtensionPayloadInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMExtensionPayloadInner deserializedVMExtensionPayloadInner = new VMExtensionPayloadInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ingestionKey".equals(fieldName)) { + deserializedVMExtensionPayloadInner.ingestionKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVMExtensionPayloadInner; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMInfoInner.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMInfoInner.java index 337f45f108224..e6d1593101ab4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMInfoInner.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/models/VMInfoInner.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.newrelicobservability.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Details of VM Resource having NewRelic OneAgent installed. */ @Fluent -public final class VMInfoInner { +public final class VMInfoInner implements JsonSerializable { /* * Azure VM resource ID */ - @JsonProperty(value = "vmId") private String vmId; /* * Version of the NewRelic agent installed on the VM. */ - @JsonProperty(value = "agentVersion") private String agentVersion; /* * Status of the NewRelic agent installed on the VM. */ - @JsonProperty(value = "agentStatus") private String agentStatus; /** @@ -103,4 +104,46 @@ public VMInfoInner withAgentStatus(String agentStatus) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vmId", this.vmId); + jsonWriter.writeStringField("agentVersion", this.agentVersion); + jsonWriter.writeStringField("agentStatus", this.agentStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMInfoInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMInfoInner 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 VMInfoInner. + */ + public static VMInfoInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMInfoInner deserializedVMInfoInner = new VMInfoInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vmId".equals(fieldName)) { + deserializedVMInfoInner.vmId = reader.getString(); + } else if ("agentVersion".equals(fieldName)) { + deserializedVMInfoInner.agentVersion = reader.getString(); + } else if ("agentStatus".equals(fieldName)) { + deserializedVMInfoInner.agentStatus = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVMInfoInner; + }); + } } 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 486fe2a102817..354f27cf8b47a 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 @@ -219,9 +219,7 @@ public PagedIterable list(String userEmail, String locatio /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -247,9 +245,7 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 421d8cd8c863b..8751c9d24dfde 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 @@ -51,8 +51,8 @@ public final class BillingInfoesClientImpl implements BillingInfoesClient { } /** - * The interface defining all the services for NewRelicObservabilityBillingInfoes to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for NewRelicObservabilityBillingInfoes to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") 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 122d706635971..0d8517e85136a 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 @@ -254,9 +254,7 @@ public PagedIterable list(String resou /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -283,9 +281,7 @@ private Mono> listNextSi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 ff12c8a207b3a..78b8b8f604905 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 @@ -418,7 +418,7 @@ public MonitoredSubscriptionPropertiesInner get(String resourceGroupName, String * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -463,7 +463,7 @@ private Mono>> createorUpdateWithResponseAsync(String * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -509,7 +509,7 @@ private Mono>> createorUpdateWithResponseAsync(String * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -556,7 +556,7 @@ private Mono>> createorUpdateWithResponseAsync(String * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -601,7 +601,7 @@ private Mono>> createorUpdateWithResponseAsync(String * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -623,7 +623,7 @@ private Mono>> createorUpdateWithResponseAsync(String * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -663,7 +663,7 @@ private Mono createorUpdateAsync(String re * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -702,7 +702,7 @@ public MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupN * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -721,7 +721,7 @@ public MonitoredSubscriptionPropertiesInner createorUpdate(String resourceGroupN * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -766,7 +766,7 @@ private Mono>> updateWithResponseAsync(String 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 body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -811,7 +811,7 @@ private Mono>> updateWithResponseAsync(String 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 body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -858,7 +858,7 @@ private Mono>> updateWithResponseAsync(String 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 body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -903,7 +903,7 @@ private Mono>> updateWithResponseAsync(String 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 body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -924,7 +924,7 @@ private Mono>> updateWithResponseAsync(String 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 body The request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -964,7 +964,7 @@ private Mono updateAsync(String resourceGr * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -1003,7 +1003,7 @@ public MonitoredSubscriptionPropertiesInner update(String resourceGroupName, Str * @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 request to update subscriptions needed to be monitored by the NewRelic monitor resource. + * @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. @@ -1244,9 +1244,7 @@ public void delete(String resourceGroupName, String monitorName, ConfigurationNa /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1271,9 +1269,7 @@ private Mono> listNextSingle /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 bc95b7a057d3e..4c2acd40e870a 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 @@ -2359,9 +2359,7 @@ public VMExtensionPayloadInner vmHostPayload(String resourceGroupName, String mo /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2389,9 +2387,7 @@ private Mono> listBySubscriptionNext /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2419,9 +2415,7 @@ private Mono> listBySubscriptionNext /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2449,9 +2443,7 @@ private Mono> listByResourceGroupNex /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2479,9 +2471,7 @@ private Mono> listByResourceGroupNex /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2508,9 +2498,7 @@ private Mono> listAppServicesNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2538,9 +2526,7 @@ private Mono> listAppServicesNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2567,9 +2553,7 @@ private Mono> listHostsNextSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2596,9 +2580,7 @@ private Mono> listHostsNextSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2626,9 +2608,7 @@ private Mono> listMonitoredResourcesNextSi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2656,9 +2636,7 @@ private Mono> listMonitoredResourcesNextSi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -2685,9 +2663,7 @@ private Mono> listLinkedResourcesNextSinglePa /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 ac4568d8cea6f..4a492601703ad 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.newrelicobservability.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -387,7 +388,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { 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 1494f38ad4276..677c5fd1c7918 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 @@ -183,9 +183,7 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -211,9 +209,7 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 2ab8c0aea7e41..c566f056f48d8 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 @@ -56,8 +56,8 @@ public final class OrganizationsClientImpl implements OrganizationsClient { } /** - * The interface defining all the services for NewRelicObservabilityOrganizations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for NewRelicObservabilityOrganizations to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") @@ -221,9 +221,7 @@ public PagedIterable list(String userEmail, String lo /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -249,9 +247,7 @@ private Mono> listNextSinglePageAsync(S /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. 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 1f99e5b5c0675..2f74169245a27 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 @@ -55,8 +55,8 @@ public final class PlansClientImpl implements PlansClient { } /** - * The interface defining all the services for NewRelicObservabilityPlans to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for NewRelicObservabilityPlans to be used by the proxy service to perform + * REST calls. */ @Host("{$host}") @ServiceInterface(name = "NewRelicObservabilit") @@ -221,9 +221,7 @@ public PagedIterable list(String accountId, String organi /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -249,9 +247,7 @@ private Mono> listNextSinglePageAsync(Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ResourceManagerUtils.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ResourceManagerUtils.java index 3590ef2e387a9..00745d54d2e1d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ResourceManagerUtils.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/ResourceManagerUtils.java @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { 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 c6a36f438f50c..54daa8f39d7ac 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 @@ -1022,9 +1022,7 @@ public TagRuleInner update(String resourceGroupName, String monitorName, String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1051,9 +1049,7 @@ private Mono> listByNewRelicMonitorResourceNextSingl /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountCreationSource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountCreationSource.java index 4c2909c34574d..8339d4f664adf 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountCreationSource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountCreationSource.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public AccountCreationSource() { * @param name a name to look for. * @return the corresponding AccountCreationSource. */ - @JsonCreator public static AccountCreationSource fromString(String name) { return fromString(name, AccountCreationSource.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 bcf9544d539ba..00cbaac977b3c 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 @@ -5,29 +5,30 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Account Info of the NewRelic account. */ @Fluent -public final class AccountInfo { +public final class AccountInfo implements JsonSerializable { /* * Account id */ - @JsonProperty(value = "accountId") private String accountId; /* * ingestion key of account */ - @JsonProperty(value = "ingestionKey") private String ingestionKey; /* * Region where New Relic account is present */ - @JsonProperty(value = "region") private String region; /** @@ -103,4 +104,46 @@ public AccountInfo withRegion(String region) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeStringField("ingestionKey", this.ingestionKey); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountInfo 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 AccountInfo. + */ + public static AccountInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountInfo deserializedAccountInfo = new AccountInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountId".equals(fieldName)) { + deserializedAccountInfo.accountId = reader.getString(); + } else if ("ingestionKey".equals(fieldName)) { + deserializedAccountInfo.ingestionKey = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedAccountInfo.region = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountInfo; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountsListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountsListResponse.java index 3320e801be2e9..d81a95e0e3197 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountsListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AccountsListResponse.java @@ -6,25 +6,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response of get all accounts Operation. */ @Fluent -public final class AccountsListResponse { +public final class AccountsListResponse implements JsonSerializable { /* * The AccountResource items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,54 @@ public AccountsListResponse withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AccountsListResponse")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AccountsListResponse")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(AccountsListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountsListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountsListResponse 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 AccountsListResponse. + */ + public static AccountsListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountsListResponse deserializedAccountsListResponse = new AccountsListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AccountResourceInner.fromJson(reader1)); + deserializedAccountsListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAccountsListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountsListResponse; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActionType.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActionType.java index 865448613306d..d9254a6ad21e0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActionType.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ActionType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ActionType() { * @param name a name to look for. * @return the corresponding ActionType. */ - @JsonCreator public static ActionType fromString(String name) { return fromString(name, ActionType.class); } 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 2a6ce76478765..f9ffd7d72560b 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 @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Request of a app services get Operation. */ @Fluent -public final class AppServicesGetRequest { +public final class AppServicesGetRequest implements JsonSerializable { /* * Azure resource IDs */ - @JsonProperty(value = "azureResourceIds") private List azureResourceIds; /* * User Email */ - @JsonProperty(value = "userEmail", required = true) private String userEmail; /** @@ -79,10 +81,53 @@ public AppServicesGetRequest withUserEmail(String userEmail) { */ public void validate() { if (userEmail() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model AppServicesGetRequest")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property userEmail in model AppServicesGetRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(AppServicesGetRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userEmail", this.userEmail); + jsonWriter.writeArrayField("azureResourceIds", this.azureResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppServicesGetRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppServicesGetRequest 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 AppServicesGetRequest. + */ + public static AppServicesGetRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppServicesGetRequest deserializedAppServicesGetRequest = new AppServicesGetRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userEmail".equals(fieldName)) { + deserializedAppServicesGetRequest.userEmail = reader.getString(); + } else if ("azureResourceIds".equals(fieldName)) { + List azureResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedAppServicesGetRequest.azureResourceIds = azureResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedAppServicesGetRequest; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesListResponse.java index da1f6ef3913c5..6d5e6e3259022 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/AppServicesListResponse.java @@ -6,25 +6,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response of a list app services Operation. */ @Fluent -public final class AppServicesListResponse { +public final class AppServicesListResponse implements JsonSerializable { /* * The AppServiceInfo items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,54 @@ public AppServicesListResponse withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AppServicesListResponse")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AppServicesListResponse")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(AppServicesListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AppServicesListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AppServicesListResponse 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 AppServicesListResponse. + */ + public static AppServicesListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AppServicesListResponse deserializedAppServicesListResponse = new AppServicesListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AppServiceInfoInner.fromJson(reader1)); + deserializedAppServicesListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAppServicesListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAppServicesListResponse; + }); + } } 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 index 6846b132b23c7..feebfc64e4251 100644 --- 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public BillingCycle() { * @param name a name to look for. * @return the corresponding BillingCycle. */ - @JsonCreator public static BillingCycle fromString(String name) { return fromString(name, BillingCycle.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingSource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingSource.java index 1ce36932b649d..1b4968206a2c4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingSource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/BillingSource.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public BillingSource() { * @param name a name to look for. * @return the corresponding BillingSource. */ - @JsonCreator public static BillingSource fromString(String name) { return fromString(name, BillingSource.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConfigurationName.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConfigurationName.java index e3f0b963decaa..d728e4858347a 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConfigurationName.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConfigurationName.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ConfigurationName() { * @param name a name to look for. * @return the corresponding ConfigurationName. */ - @JsonCreator public static ConfigurationName fromString(String name) { return fromString(name, ConfigurationName.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourceProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourceProperties.java index 9ca3d700c1e5f..c010cf65add03 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourceProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ConnectedPartnerResourceProperties.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Connected Partner Resource Properties. */ @Fluent -public final class ConnectedPartnerResourceProperties { +public final class ConnectedPartnerResourceProperties implements JsonSerializable { /* * NewRelic account name */ - @JsonProperty(value = "accountName") private String accountName; /* * NewRelic Account Id */ - @JsonProperty(value = "accountId") private String accountId; /* * The azure resource Id of the deployment. */ - @JsonProperty(value = "azureResourceId") private String azureResourceId; /* * The location of the deployment. */ - @JsonProperty(value = "location") private String location; /** @@ -129,4 +129,50 @@ public ConnectedPartnerResourceProperties withLocation(String location) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedPartnerResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectedPartnerResourceProperties 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 ConnectedPartnerResourceProperties. + */ + public static ConnectedPartnerResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedPartnerResourceProperties deserializedConnectedPartnerResourceProperties + = new ConnectedPartnerResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountName".equals(fieldName)) { + deserializedConnectedPartnerResourceProperties.accountName = reader.getString(); + } else if ("accountId".equals(fieldName)) { + deserializedConnectedPartnerResourceProperties.accountId = reader.getString(); + } else if ("azureResourceId".equals(fieldName)) { + deserializedConnectedPartnerResourceProperties.azureResourceId = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConnectedPartnerResourceProperties.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedPartnerResourceProperties; + }); + } } 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 f154a03ca3c7a..7d481faf8208d 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,25 +5,28 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List of all active newrelic deployments. */ @Fluent -public final class ConnectedPartnerResourcesListResponse { +public final class ConnectedPartnerResourcesListResponse + implements JsonSerializable { /* * Results of a list operation. */ - @JsonProperty(value = "value") private List value; /* * Link to the next set of results, if any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +85,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectedPartnerResourcesListResponse from the JsonReader. + * + * @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 IOException If an error occurs while reading the ConnectedPartnerResourcesListResponse. + */ + public static ConnectedPartnerResourcesListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectedPartnerResourcesListResponse deserializedConnectedPartnerResourcesListResponse + = new ConnectedPartnerResourcesListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConnectedPartnerResourcesListFormatInner.fromJson(reader1)); + deserializedConnectedPartnerResourcesListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConnectedPartnerResourcesListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectedPartnerResourcesListResponse; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/FilteringTag.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/FilteringTag.java index 8866e5b561cd3..a325819510781 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/FilteringTag.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/FilteringTag.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them from * being monitored. */ @Fluent -public final class FilteringTag { +public final class FilteringTag implements JsonSerializable { /* * The name (also known as the key) of the tag. */ - @JsonProperty(value = "name") private String name; /* * The value of the tag. */ - @JsonProperty(value = "value") private String value; /* * Valid actions for a filtering tag. Exclusion takes priority over inclusion. */ - @JsonProperty(value = "action") private TagAction action; /** @@ -104,4 +105,46 @@ public FilteringTag withAction(TagAction action) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FilteringTag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FilteringTag 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 FilteringTag. + */ + public static FilteringTag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FilteringTag deserializedFilteringTag = new FilteringTag(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFilteringTag.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedFilteringTag.value = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedFilteringTag.action = TagAction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFilteringTag; + }); + } } 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 5399bc21a498d..2e2ee7fe1d1ea 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 @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Request of a Hosts get Operation. */ @Fluent -public final class HostsGetRequest { +public final class HostsGetRequest implements JsonSerializable { /* * VM resource IDs */ - @JsonProperty(value = "vmIds") private List vmIds; /* * User Email */ - @JsonProperty(value = "userEmail", required = true) private String userEmail; /** @@ -79,10 +81,51 @@ public HostsGetRequest withUserEmail(String userEmail) { */ public void validate() { if (userEmail() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model HostsGetRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property userEmail in model HostsGetRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(HostsGetRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userEmail", this.userEmail); + jsonWriter.writeArrayField("vmIds", this.vmIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostsGetRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostsGetRequest 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 HostsGetRequest. + */ + public static HostsGetRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostsGetRequest deserializedHostsGetRequest = new HostsGetRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userEmail".equals(fieldName)) { + deserializedHostsGetRequest.userEmail = reader.getString(); + } else if ("vmIds".equals(fieldName)) { + List vmIds = reader.readArray(reader1 -> reader1.getString()); + deserializedHostsGetRequest.vmIds = vmIds; + } else { + reader.skipChildren(); + } + } + + return deserializedHostsGetRequest; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LiftrResourceCategories.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LiftrResourceCategories.java index 5489faf533647..d38fda5742536 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LiftrResourceCategories.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LiftrResourceCategories.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public LiftrResourceCategories() { * @param name a name to look for. * @return the corresponding LiftrResourceCategories. */ - @JsonCreator public static LiftrResourceCategories fromString(String name) { return fromString(name, LiftrResourceCategories.class); } 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 77d6d8b301efe..aae3ce0d79037 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,25 +5,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response of a list operation. */ @Fluent -public final class LinkedResourceListResponse { +public final class LinkedResourceListResponse implements JsonSerializable { /* * Results of a list operation. */ - @JsonProperty(value = "value") private List value; /* * Link to the next set of results, if any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinkedResourceListResponse from the JsonReader. + * + * @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 IOException If an error occurs while reading the LinkedResourceListResponse. + */ + public static LinkedResourceListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinkedResourceListResponse deserializedLinkedResourceListResponse = new LinkedResourceListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LinkedResourceInner.fromJson(reader1)); + deserializedLinkedResourceListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLinkedResourceListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLinkedResourceListResponse; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LogRules.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LogRules.java index aac1473d13a25..2a9f9b003ed66 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LogRules.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/LogRules.java @@ -5,39 +5,39 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Set of rules for sending logs for the Monitor resource. */ @Fluent -public final class LogRules { +public final class LogRules implements JsonSerializable { /* * Flag specifying if AAD logs should be sent for the Monitor resource. */ - @JsonProperty(value = "sendAadLogs") private SendAadLogsStatus sendAadLogs; /* * Flag specifying if subscription logs should be sent for the Monitor resource. */ - @JsonProperty(value = "sendSubscriptionLogs") private SendSubscriptionLogsStatus sendSubscriptionLogs; /* * Flag specifying if activity logs from Azure resources should be sent for the Monitor resource. */ - @JsonProperty(value = "sendActivityLogs") private SendActivityLogsStatus sendActivityLogs; /* - * List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is - * enabled. If empty, all resources will be captured. + * List of filtering tags to be used for capturing logs. This only takes effect if SendActivityLogs flag is enabled. + * If empty, all resources will be captured. * If only Exclude action is specified, the rules will apply to the list of all available resources. If Include * actions are specified, the rules will only include resources with the associated tags. */ - @JsonProperty(value = "filteringTags") private List filteringTags; /** @@ -146,4 +146,53 @@ public void validate() { filteringTags().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sendAadLogs", this.sendAadLogs == null ? null : this.sendAadLogs.toString()); + jsonWriter.writeStringField("sendSubscriptionLogs", + this.sendSubscriptionLogs == null ? null : this.sendSubscriptionLogs.toString()); + jsonWriter.writeStringField("sendActivityLogs", + this.sendActivityLogs == null ? null : this.sendActivityLogs.toString()); + jsonWriter.writeArrayField("filteringTags", this.filteringTags, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogRules 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 LogRules. + */ + public static LogRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogRules deserializedLogRules = new LogRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sendAadLogs".equals(fieldName)) { + deserializedLogRules.sendAadLogs = SendAadLogsStatus.fromString(reader.getString()); + } else if ("sendSubscriptionLogs".equals(fieldName)) { + deserializedLogRules.sendSubscriptionLogs + = SendSubscriptionLogsStatus.fromString(reader.getString()); + } else if ("sendActivityLogs".equals(fieldName)) { + deserializedLogRules.sendActivityLogs = SendActivityLogsStatus.fromString(reader.getString()); + } else if ("filteringTags".equals(fieldName)) { + List filteringTags = reader.readArray(reader1 -> FilteringTag.fromJson(reader1)); + deserializedLogRules.filteringTags = filteringTags; + } else { + reader.skipChildren(); + } + } + + return deserializedLogRules; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentity.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentity.java index 12609b227f0fa..58624e2e73b71 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentity.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ManagedServiceIdentity.java @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; import java.util.UUID; @@ -15,36 +18,30 @@ * Managed service identity (system assigned and/or user assigned identities). */ @Fluent -public final class ManagedServiceIdentity { +public final class ManagedServiceIdentity implements JsonSerializable { /* * The service principal ID of the system assigned identity. This property will only be provided for a system * assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* * The tenant ID of the system assigned identity. This property will only be provided for a system assigned * identity. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private UUID tenantId; /* * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ - @JsonProperty(value = "type", required = true) private ManagedServiceIdentityType type; /* - * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys - * will be ARM resource ids in the form: + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ - * userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /** @@ -64,8 +61,8 @@ public UUID principalId() { } /** - * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided - * for a system assigned identity. + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. * * @return the tenantId value. */ @@ -128,8 +125,8 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { @@ -141,4 +138,53 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity 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 ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } } 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 c0964b0a0531a..f99582aab2d50 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 @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public ManagedServiceIdentityType() { * @param name a name to look for. * @return the corresponding ManagedServiceIdentityType. */ - @JsonCreator public static ManagedServiceIdentityType fromString(String name) { return fromString(name, ManagedServiceIdentityType.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSaaSInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSaaSInfo.java index b391698ecb792..b35a02d7af652 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSaaSInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSaaSInfo.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Marketplace SAAS Info of the resource. */ @Fluent -public final class MarketplaceSaaSInfo { +public final class MarketplaceSaaSInfo implements JsonSerializable { /* * Marketplace Subscription Id. This is a GUID-formatted string. */ - @JsonProperty(value = "marketplaceSubscriptionId") private String marketplaceSubscriptionId; /* * Marketplace Subscription Details: SAAS Name */ - @JsonProperty(value = "marketplaceSubscriptionName") private String marketplaceSubscriptionName; /* * Marketplace Subscription Details: Resource URI */ - @JsonProperty(value = "marketplaceResourceId") private String marketplaceResourceId; /* * Marketplace Subscription Details: SaaS Subscription Status */ - @JsonProperty(value = "marketplaceStatus") private String marketplaceStatus; /* * The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. */ - @JsonProperty(value = "billedAzureSubscriptionId") private String billedAzureSubscriptionId; /** @@ -157,4 +156,52 @@ public MarketplaceSaaSInfo withBilledAzureSubscriptionId(String billedAzureSubsc */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("marketplaceSubscriptionId", this.marketplaceSubscriptionId); + jsonWriter.writeStringField("marketplaceSubscriptionName", this.marketplaceSubscriptionName); + jsonWriter.writeStringField("marketplaceResourceId", this.marketplaceResourceId); + jsonWriter.writeStringField("marketplaceStatus", this.marketplaceStatus); + jsonWriter.writeStringField("billedAzureSubscriptionId", this.billedAzureSubscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MarketplaceSaaSInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MarketplaceSaaSInfo 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 MarketplaceSaaSInfo. + */ + public static MarketplaceSaaSInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MarketplaceSaaSInfo deserializedMarketplaceSaaSInfo = new MarketplaceSaaSInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("marketplaceSubscriptionId".equals(fieldName)) { + deserializedMarketplaceSaaSInfo.marketplaceSubscriptionId = reader.getString(); + } else if ("marketplaceSubscriptionName".equals(fieldName)) { + deserializedMarketplaceSaaSInfo.marketplaceSubscriptionName = reader.getString(); + } else if ("marketplaceResourceId".equals(fieldName)) { + deserializedMarketplaceSaaSInfo.marketplaceResourceId = reader.getString(); + } else if ("marketplaceStatus".equals(fieldName)) { + deserializedMarketplaceSaaSInfo.marketplaceStatus = reader.getString(); + } else if ("billedAzureSubscriptionId".equals(fieldName)) { + deserializedMarketplaceSaaSInfo.billedAzureSubscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMarketplaceSaaSInfo; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSubscriptionStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSubscriptionStatus.java index 6c0036fd3d574..d4e598f3023e0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSubscriptionStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MarketplaceSubscriptionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public MarketplaceSubscriptionStatus() { * @param name a name to look for. * @return the corresponding MarketplaceSubscriptionStatus. */ - @JsonCreator public static MarketplaceSubscriptionStatus fromString(String name) { return fromString(name, MarketplaceSubscriptionStatus.class); } 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 4b9c056fb6579..828a11625efbe 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 @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Request of get metrics Operation. */ @Fluent -public final class MetricsRequest { +public final class MetricsRequest implements JsonSerializable { /* * User Email */ - @JsonProperty(value = "userEmail", required = true) private String userEmail; /** @@ -52,10 +55,47 @@ public MetricsRequest withUserEmail(String userEmail) { */ public void validate() { if (userEmail() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model MetricsRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property userEmail in model MetricsRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(MetricsRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userEmail", this.userEmail); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsRequest 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 MetricsRequest. + */ + public static MetricsRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsRequest deserializedMetricsRequest = new MetricsRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userEmail".equals(fieldName)) { + deserializedMetricsRequest.userEmail = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsRequest; + }); + } } 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 e0855e61c0789..fa78a76607e56 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 @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Request of get metrics status Operation. */ @Fluent -public final class MetricsStatusRequest { +public final class MetricsStatusRequest implements JsonSerializable { /* * Azure resource IDs */ - @JsonProperty(value = "azureResourceIds") private List azureResourceIds; /* * User Email */ - @JsonProperty(value = "userEmail", required = true) private String userEmail; /** @@ -79,10 +81,52 @@ public MetricsStatusRequest withUserEmail(String userEmail) { */ public void validate() { if (userEmail() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model MetricsStatusRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property userEmail in model MetricsStatusRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(MetricsStatusRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userEmail", this.userEmail); + jsonWriter.writeArrayField("azureResourceIds", this.azureResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricsStatusRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricsStatusRequest 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 MetricsStatusRequest. + */ + public static MetricsStatusRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricsStatusRequest deserializedMetricsStatusRequest = new MetricsStatusRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userEmail".equals(fieldName)) { + deserializedMetricsStatusRequest.userEmail = reader.getString(); + } else if ("azureResourceIds".equals(fieldName)) { + List azureResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricsStatusRequest.azureResourceIds = azureResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedMetricsStatusRequest; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResourceListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResourceListResponse.java index f11afb5054c51..cfc49c34268a9 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResourceListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoredResourceListResponse.java @@ -6,25 +6,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List of all the resources being monitored by NewRelic monitor resource. */ @Fluent -public final class MonitoredResourceListResponse { +public final class MonitoredResourceListResponse implements JsonSerializable { /* * The MonitoredResource items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,56 @@ public MonitoredResourceListResponse withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model MonitoredResourceListResponse")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model MonitoredResourceListResponse")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(MonitoredResourceListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoredResourceListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MonitoredResourceListResponse 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 MonitoredResourceListResponse. + */ + public static MonitoredResourceListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoredResourceListResponse deserializedMonitoredResourceListResponse + = new MonitoredResourceListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MonitoredResourceInner.fromJson(reader1)); + deserializedMonitoredResourceListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMonitoredResourceListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoredResourceListResponse; + }); + } } 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 b6aba0334b58f..2ad12d3124efd 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,25 +5,28 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The MonitoredSubscriptionPropertiesList model. */ @Fluent -public final class MonitoredSubscriptionPropertiesList { +public final class MonitoredSubscriptionPropertiesList + implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +85,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MonitoredSubscriptionPropertiesList from the JsonReader. + * + * @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 IOException If an error occurs while reading the MonitoredSubscriptionPropertiesList. + */ + public static MonitoredSubscriptionPropertiesList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MonitoredSubscriptionPropertiesList deserializedMonitoredSubscriptionPropertiesList + = new MonitoredSubscriptionPropertiesList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MonitoredSubscriptionPropertiesInner.fromJson(reader1)); + deserializedMonitoredSubscriptionPropertiesList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMonitoredSubscriptionPropertiesList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMonitoredSubscriptionPropertiesList; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringStatus.java index fa8ae17da2ddb..cc561269cad0d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/MonitoringStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public MonitoringStatus() { * @param name a name to look for. * @return the corresponding MonitoringStatus. */ - @JsonCreator public static MonitoringStatus fromString(String name) { return fromString(name, MonitoringStatus.class); } 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 index 7f8019b708048..3964b79e475d1 100644 --- 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 @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; /** * The MonitorsSwitchBillingHeaders model. @@ -17,7 +16,6 @@ public final class MonitorsSwitchBillingHeaders { /* * The Retry-After property. */ - @JsonProperty(value = "Retry-After") private Integer retryAfter; // HttpHeaders containing the raw property values. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicAccountProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicAccountProperties.java index d8fcad01865bf..052d9700af776 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicAccountProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicAccountProperties.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of the NewRelic account. */ @Fluent -public final class NewRelicAccountProperties { +public final class NewRelicAccountProperties implements JsonSerializable { /* * User id */ - @JsonProperty(value = "userId") private String userId; /* * NewRelic Account Information */ - @JsonProperty(value = "accountInfo") private AccountInfo accountInfo; /* * NewRelic Organization Information */ - @JsonProperty(value = "organizationInfo") private OrganizationInfo organizationInfo; /* * date when plan was applied */ - @JsonProperty(value = "singleSignOnProperties") private NewRelicSingleSignOnProperties singleSignOnProperties; /** @@ -138,4 +138,50 @@ public void validate() { singleSignOnProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userId", this.userId); + jsonWriter.writeJsonField("accountInfo", this.accountInfo); + jsonWriter.writeJsonField("organizationInfo", this.organizationInfo); + jsonWriter.writeJsonField("singleSignOnProperties", this.singleSignOnProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NewRelicAccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NewRelicAccountProperties 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 NewRelicAccountProperties. + */ + public static NewRelicAccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NewRelicAccountProperties deserializedNewRelicAccountProperties = new NewRelicAccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userId".equals(fieldName)) { + deserializedNewRelicAccountProperties.userId = reader.getString(); + } else if ("accountInfo".equals(fieldName)) { + deserializedNewRelicAccountProperties.accountInfo = AccountInfo.fromJson(reader); + } else if ("organizationInfo".equals(fieldName)) { + deserializedNewRelicAccountProperties.organizationInfo = OrganizationInfo.fromJson(reader); + } else if ("singleSignOnProperties".equals(fieldName)) { + deserializedNewRelicAccountProperties.singleSignOnProperties + = NewRelicSingleSignOnProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNewRelicAccountProperties; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceListResult.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceListResult.java index c98892305a9eb..92741285a1484 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceListResult.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResourceListResult.java @@ -6,25 +6,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a NewRelicMonitorResource list operation. */ @Fluent -public final class NewRelicMonitorResourceListResult { +public final class NewRelicMonitorResourceListResult implements JsonSerializable { /* * The NewRelicMonitorResource items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,56 @@ public NewRelicMonitorResourceListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property value in model NewRelicMonitorResourceListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model NewRelicMonitorResourceListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(NewRelicMonitorResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NewRelicMonitorResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NewRelicMonitorResourceListResult 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 NewRelicMonitorResourceListResult. + */ + public static NewRelicMonitorResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NewRelicMonitorResourceListResult deserializedNewRelicMonitorResourceListResult + = new NewRelicMonitorResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NewRelicMonitorResourceInner.fromJson(reader1)); + deserializedNewRelicMonitorResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNewRelicMonitorResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNewRelicMonitorResourceListResult; + }); + } } 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 116d814f188e9..cb2401c5c93b6 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 @@ -5,33 +5,32 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceUpdateProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** * The type used for update operations of the NewRelicMonitorResource. */ @Fluent -public final class NewRelicMonitorResourceUpdate { +public final class NewRelicMonitorResourceUpdate implements JsonSerializable { /* * The managed service identities assigned to this resource. */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The updatable properties of the NewRelicMonitorResource. */ - @JsonProperty(value = "properties") private NewRelicMonitorResourceUpdateProperties innerProperties; /** @@ -218,4 +217,49 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NewRelicMonitorResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NewRelicMonitorResourceUpdate 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 NewRelicMonitorResourceUpdate. + */ + public static NewRelicMonitorResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NewRelicMonitorResourceUpdate deserializedNewRelicMonitorResourceUpdate + = new NewRelicMonitorResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedNewRelicMonitorResourceUpdate.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNewRelicMonitorResourceUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedNewRelicMonitorResourceUpdate.innerProperties + = NewRelicMonitorResourceUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNewRelicMonitorResourceUpdate; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicSingleSignOnProperties.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicSingleSignOnProperties.java index 9ec3bb2746efe..997d603227c88 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicSingleSignOnProperties.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicSingleSignOnProperties.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Single sign on Info of the NewRelic account. */ @Fluent -public final class NewRelicSingleSignOnProperties { +public final class NewRelicSingleSignOnProperties implements JsonSerializable { /* * Single sign-on state */ - @JsonProperty(value = "singleSignOnState") private SingleSignOnStates singleSignOnState; /* * The Id of the Enterprise App used for Single sign-on. */ - @JsonProperty(value = "enterpriseAppId") private String enterpriseAppId; /* * The login URL specific to this NewRelic Organization */ - @JsonProperty(value = "singleSignOnUrl") private String singleSignOnUrl; /* * Provisioning state */ - @JsonProperty(value = "provisioningState") private ProvisioningState provisioningState; /** @@ -129,4 +129,54 @@ public NewRelicSingleSignOnProperties withProvisioningState(ProvisioningState pr */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("singleSignOnState", + this.singleSignOnState == null ? null : this.singleSignOnState.toString()); + jsonWriter.writeStringField("enterpriseAppId", this.enterpriseAppId); + jsonWriter.writeStringField("singleSignOnUrl", this.singleSignOnUrl); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NewRelicSingleSignOnProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NewRelicSingleSignOnProperties 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 NewRelicSingleSignOnProperties. + */ + public static NewRelicSingleSignOnProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NewRelicSingleSignOnProperties deserializedNewRelicSingleSignOnProperties + = new NewRelicSingleSignOnProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("singleSignOnState".equals(fieldName)) { + deserializedNewRelicSingleSignOnProperties.singleSignOnState + = SingleSignOnStates.fromString(reader.getString()); + } else if ("enterpriseAppId".equals(fieldName)) { + deserializedNewRelicSingleSignOnProperties.enterpriseAppId = reader.getString(); + } else if ("singleSignOnUrl".equals(fieldName)) { + deserializedNewRelicSingleSignOnProperties.singleSignOnUrl = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNewRelicSingleSignOnProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNewRelicSingleSignOnProperties; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationDisplay.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationDisplay.java index 72fab579594c3..2875c2dca2ba4 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationDisplay.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationDisplay.java @@ -5,38 +5,38 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Localized display information for this particular operation. */ @Immutable -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** @@ -92,4 +92,45 @@ public String description() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay 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 OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationListResult.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationListResult.java index 13c7b8937074c..9d70bf47a2d9b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationListResult.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OperationListResult.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.newrelicobservability.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set - * of results. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. */ @Immutable -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the resource provider */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * URL to get the next set of operation list results (if there are any). */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -61,4 +63,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult 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 OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrgCreationSource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrgCreationSource.java index 074728fd70d8d..0e75c549627c0 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrgCreationSource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrgCreationSource.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public OrgCreationSource() { * @param name a name to look for. * @return the corresponding OrgCreationSource. */ - @JsonCreator public static OrgCreationSource fromString(String name) { return fromString(name, OrgCreationSource.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationInfo.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationInfo.java index cd90e5b41d964..2380f8cba5b08 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationInfo.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationInfo.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Organization Info of the NewRelic account. */ @Fluent -public final class OrganizationInfo { +public final class OrganizationInfo implements JsonSerializable { /* * Organization id */ - @JsonProperty(value = "organizationId") private String organizationId; /** @@ -51,4 +54,40 @@ public OrganizationInfo withOrganizationId(String organizationId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("organizationId", this.organizationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationInfo 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 OrganizationInfo. + */ + public static OrganizationInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationInfo deserializedOrganizationInfo = new OrganizationInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("organizationId".equals(fieldName)) { + deserializedOrganizationInfo.organizationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationInfo; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationsListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationsListResponse.java index e46061fe6a60d..6456284e7472d 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationsListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/OrganizationsListResponse.java @@ -6,25 +6,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response of get all organizations Operation. */ @Fluent -public final class OrganizationsListResponse { +public final class OrganizationsListResponse implements JsonSerializable { /* * The OrganizationResource items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,55 @@ public OrganizationsListResponse withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model OrganizationsListResponse")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model OrganizationsListResponse")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(OrganizationsListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrganizationsListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrganizationsListResponse 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 OrganizationsListResponse. + */ + public static OrganizationsListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrganizationsListResponse deserializedOrganizationsListResponse = new OrganizationsListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OrganizationResourceInner.fromJson(reader1)); + deserializedOrganizationsListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOrganizationsListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationsListResponse; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Origin.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Origin.java index 2d78da40d07b9..4fffe445dfda6 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Origin.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Origin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public Origin() { * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, Origin.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PartnerBillingEntity.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PartnerBillingEntity.java index 2c1296363c5a8..93341962870c2 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PartnerBillingEntity.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PartnerBillingEntity.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Partner Billing details associated with the resource. */ @Fluent -public final class PartnerBillingEntity { +public final class PartnerBillingEntity implements JsonSerializable { /* * The New Relic Organization Id. */ - @JsonProperty(value = "organizationId") private String organizationId; /* * The New Relic Organization Name. */ - @JsonProperty(value = "organizationName") private String organizationName; /** @@ -77,4 +79,43 @@ public PartnerBillingEntity withOrganizationName(String organizationName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("organizationId", this.organizationId); + jsonWriter.writeStringField("organizationName", this.organizationName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartnerBillingEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartnerBillingEntity 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 PartnerBillingEntity. + */ + public static PartnerBillingEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartnerBillingEntity deserializedPartnerBillingEntity = new PartnerBillingEntity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("organizationId".equals(fieldName)) { + deserializedPartnerBillingEntity.organizationId = reader.getString(); + } else if ("organizationName".equals(fieldName)) { + deserializedPartnerBillingEntity.organizationName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPartnerBillingEntity; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PatchOperation.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PatchOperation.java index cae070e9070a1..0142724d07d50 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PatchOperation.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PatchOperation.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public PatchOperation() { * @param name a name to look for. * @return the corresponding PatchOperation. */ - @JsonCreator public static PatchOperation fromString(String name) { return fromString(name, PatchOperation.class); } 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 4d79b71569478..f272e0357177c 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 @@ -5,36 +5,38 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Plan data of NewRelic Monitor resource. */ @Fluent -public final class PlanData { +public final class PlanData implements JsonSerializable { /* * Different usage type like PAYG/COMMITTED. this could be enum */ - @JsonProperty(value = "usageType") private UsageType usageType; /* * Different billing cycles like MONTHLY/WEEKLY. this could be enum */ - @JsonProperty(value = "billingCycle") private BillingCycle billingCycle; /* * plan id as published by NewRelic */ - @JsonProperty(value = "planDetails") private String planDetails; /* * date when plan was applied */ - @JsonProperty(value = "effectiveDate") private OffsetDateTime effectiveDate; /** @@ -130,4 +132,51 @@ public PlanData withEffectiveDate(OffsetDateTime effectiveDate) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + 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("planDetails", this.planDetails); + jsonWriter.writeStringField("effectiveDate", + this.effectiveDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.effectiveDate)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlanData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlanData 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 PlanData. + */ + public static PlanData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlanData deserializedPlanData = new PlanData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("usageType".equals(fieldName)) { + deserializedPlanData.usageType = UsageType.fromString(reader.getString()); + } else if ("billingCycle".equals(fieldName)) { + deserializedPlanData.billingCycle = BillingCycle.fromString(reader.getString()); + } else if ("planDetails".equals(fieldName)) { + deserializedPlanData.planDetails = reader.getString(); + } else if ("effectiveDate".equals(fieldName)) { + deserializedPlanData.effectiveDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedPlanData; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataListResponse.java index d2dda05c88b09..b82ffd0f414e3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/PlanDataListResponse.java @@ -6,25 +6,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response of get all plan data Operation. */ @Fluent -public final class PlanDataListResponse { +public final class PlanDataListResponse implements JsonSerializable { /* * The PlanDataResource items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,54 @@ public PlanDataListResponse withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model PlanDataListResponse")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model PlanDataListResponse")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(PlanDataListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlanDataListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlanDataListResponse 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 PlanDataListResponse. + */ + public static PlanDataListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlanDataListResponse deserializedPlanDataListResponse = new PlanDataListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PlanDataResourceInner.fromJson(reader1)); + deserializedPlanDataListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPlanDataListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlanDataListResponse; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ProvisioningState.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ProvisioningState.java index de7d9b599c2b7..81baa006ddfd1 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ProvisioningState.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/ProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -72,7 +71,6 @@ public ProvisioningState() { * @param name a name to look for. * @return the corresponding ProvisioningState. */ - @JsonCreator public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendAadLogsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendAadLogsStatus.java index ee4878c00331e..41457903e5f9b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendAadLogsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendAadLogsStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public SendAadLogsStatus() { * @param name a name to look for. * @return the corresponding SendAadLogsStatus. */ - @JsonCreator public static SendAadLogsStatus fromString(String name) { return fromString(name, SendAadLogsStatus.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendActivityLogsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendActivityLogsStatus.java index 3afab4836c366..019226b5a8861 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendActivityLogsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendActivityLogsStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public SendActivityLogsStatus() { * @param name a name to look for. * @return the corresponding SendActivityLogsStatus. */ - @JsonCreator public static SendActivityLogsStatus fromString(String name) { return fromString(name, SendActivityLogsStatus.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendMetricsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendMetricsStatus.java index 93995df8d6bb7..98ed149c97698 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendMetricsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendMetricsStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public SendMetricsStatus() { * @param name a name to look for. * @return the corresponding SendMetricsStatus. */ - @JsonCreator public static SendMetricsStatus fromString(String name) { return fromString(name, SendMetricsStatus.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendSubscriptionLogsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendSubscriptionLogsStatus.java index be80411e148b4..042869f90e22b 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendSubscriptionLogsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendSubscriptionLogsStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public SendSubscriptionLogsStatus() { * @param name a name to look for. * @return the corresponding SendSubscriptionLogsStatus. */ - @JsonCreator public static SendSubscriptionLogsStatus fromString(String name) { return fromString(name, SendSubscriptionLogsStatus.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingLogsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingLogsStatus.java index 9be59c17731cd..68e4c10a66fd3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingLogsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingLogsStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public SendingLogsStatus() { * @param name a name to look for. * @return the corresponding SendingLogsStatus. */ - @JsonCreator public static SendingLogsStatus fromString(String name) { return fromString(name, SendingLogsStatus.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingMetricsStatus.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingMetricsStatus.java index f1eef9e27b0cb..3a5af5a979d52 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingMetricsStatus.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SendingMetricsStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public SendingMetricsStatus() { * @param name a name to look for. * @return the corresponding SendingMetricsStatus. */ - @JsonCreator public static SendingMetricsStatus fromString(String name) { return fromString(name, SendingMetricsStatus.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SingleSignOnStates.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SingleSignOnStates.java index c92e95f9d205a..e85753e5065dc 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SingleSignOnStates.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SingleSignOnStates.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public SingleSignOnStates() { * @param name a name to look for. * @return the corresponding SingleSignOnStates. */ - @JsonCreator public static SingleSignOnStates fromString(String name) { return fromString(name, SingleSignOnStates.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Status.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Status.java index ec90cf8326883..564c75d11e0b3 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Status.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Status.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public Status() { * @param name a name to look for. * @return the corresponding Status. */ - @JsonCreator public static Status fromString(String name) { return fromString(name, Status.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SubscriptionList.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SubscriptionList.java index 7a5bf54b8ded3..63d8b444978d5 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SubscriptionList.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/SubscriptionList.java @@ -5,31 +5,32 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The request to update subscriptions needed to be monitored by the NewRelic monitor resource. */ @Fluent -public final class SubscriptionList { +public final class SubscriptionList implements JsonSerializable { /* * The operation for the patch on the resource. */ - @JsonProperty(value = "patchOperation") private PatchOperation patchOperation; /* * List of subscriptions and the state of the monitoring. */ - @JsonProperty(value = "monitoredSubscriptionList") private List monitoredSubscriptionList; /* * Provisioning State of the resource */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** @@ -97,4 +98,49 @@ public void validate() { monitoredSubscriptionList().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("patchOperation", + this.patchOperation == null ? null : this.patchOperation.toString()); + jsonWriter.writeArrayField("monitoredSubscriptionList", this.monitoredSubscriptionList, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionList 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 SubscriptionList. + */ + public static SubscriptionList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionList deserializedSubscriptionList = new SubscriptionList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("patchOperation".equals(fieldName)) { + deserializedSubscriptionList.patchOperation = PatchOperation.fromString(reader.getString()); + } else if ("monitoredSubscriptionList".equals(fieldName)) { + List monitoredSubscriptionList + = reader.readArray(reader1 -> MonitoredSubscriptionInner.fromJson(reader1)); + deserializedSubscriptionList.monitoredSubscriptionList = monitoredSubscriptionList; + } else if ("provisioningState".equals(fieldName)) { + deserializedSubscriptionList.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionList; + }); + } } 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 6171213e240fd..32c61191bba20 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 @@ -6,35 +6,35 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Request of a switch billing Operation. */ @Fluent -public final class SwitchBillingRequest { +public final class SwitchBillingRequest implements JsonSerializable { /* * Azure resource Id */ - @JsonProperty(value = "azureResourceId") private String azureResourceId; /* * Organization id */ - @JsonProperty(value = "organizationId") private String organizationId; /* * Plan details */ - @JsonProperty(value = "planData") private PlanData planData; /* * User Email */ - @JsonProperty(value = "userEmail", required = true) private String userEmail; /** @@ -133,10 +133,56 @@ public void validate() { planData().validate(); } if (userEmail() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property userEmail in model SwitchBillingRequest")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property userEmail in model SwitchBillingRequest")); } } private static final ClientLogger LOGGER = new ClientLogger(SwitchBillingRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userEmail", this.userEmail); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("organizationId", this.organizationId); + jsonWriter.writeJsonField("planData", this.planData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SwitchBillingRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SwitchBillingRequest 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 SwitchBillingRequest. + */ + public static SwitchBillingRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SwitchBillingRequest deserializedSwitchBillingRequest = new SwitchBillingRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userEmail".equals(fieldName)) { + deserializedSwitchBillingRequest.userEmail = reader.getString(); + } else if ("azureResourceId".equals(fieldName)) { + deserializedSwitchBillingRequest.azureResourceId = reader.getString(); + } else if ("organizationId".equals(fieldName)) { + deserializedSwitchBillingRequest.organizationId = reader.getString(); + } else if ("planData".equals(fieldName)) { + deserializedSwitchBillingRequest.planData = PlanData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSwitchBillingRequest; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagAction.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagAction.java index e91a643f400dc..a203eeaf026fd 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagAction.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagAction.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public TagAction() { * @param name a name to look for. * @return the corresponding TagAction. */ - @JsonCreator public static TagAction fromString(String name) { return fromString(name, TagAction.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleListResult.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleListResult.java index 488aafdcca92f..befef0e5db059 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleListResult.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/TagRuleListResult.java @@ -6,25 +6,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a TagRule list operation. */ @Fluent -public final class TagRuleListResult { +public final class TagRuleListResult implements JsonSerializable { /* * The TagRule items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,53 @@ public TagRuleListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model TagRuleListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model TagRuleListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(TagRuleListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagRuleListResult 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 TagRuleListResult. + */ + public static TagRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagRuleListResult deserializedTagRuleListResult = new TagRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> TagRuleInner.fromJson(reader1)); + deserializedTagRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTagRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagRuleListResult; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UsageType.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UsageType.java index 97bd6091e1f49..6ecd2f296649e 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UsageType.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UsageType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public UsageType() { * @param name a name to look for. * @return the corresponding UsageType. */ - @JsonCreator public static UsageType fromString(String name) { return fromString(name, UsageType.class); } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserAssignedIdentity.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserAssignedIdentity.java index 48a6239592d13..da13c5a5e7e37 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserAssignedIdentity.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/UserAssignedIdentity.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.UUID; /** * User assigned identity properties. */ @Immutable -public final class UserAssignedIdentity { +public final class UserAssignedIdentity implements JsonSerializable { /* * The principal ID of the assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* * The client ID of the assigned identity. */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private UUID clientId; /** @@ -56,4 +58,43 @@ public UUID clientId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } } 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 a51372366e3f8..606178ef5cbb1 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 @@ -5,41 +5,40 @@ package com.azure.resourcemanager.newrelicobservability.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * User Info of NewRelic Monitor resource. */ @Fluent -public final class UserInfo { +public final class UserInfo implements JsonSerializable { /* * First name */ - @JsonProperty(value = "firstName") private String firstName; /* * Last name */ - @JsonProperty(value = "lastName") private String lastName; /* * User Email */ - @JsonProperty(value = "emailAddress") private String emailAddress; /* * Contact phone number */ - @JsonProperty(value = "phoneNumber") private String phoneNumber; /* * country if user */ - @JsonProperty(value = "country") private String country; /** @@ -155,4 +154,52 @@ public UserInfo withCountry(String country) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("firstName", this.firstName); + jsonWriter.writeStringField("lastName", this.lastName); + jsonWriter.writeStringField("emailAddress", this.emailAddress); + jsonWriter.writeStringField("phoneNumber", this.phoneNumber); + jsonWriter.writeStringField("country", this.country); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserInfo 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 UserInfo. + */ + public static UserInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserInfo deserializedUserInfo = new UserInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("firstName".equals(fieldName)) { + deserializedUserInfo.firstName = reader.getString(); + } else if ("lastName".equals(fieldName)) { + deserializedUserInfo.lastName = reader.getString(); + } else if ("emailAddress".equals(fieldName)) { + deserializedUserInfo.emailAddress = reader.getString(); + } else if ("phoneNumber".equals(fieldName)) { + deserializedUserInfo.phoneNumber = reader.getString(); + } else if ("country".equals(fieldName)) { + deserializedUserInfo.country = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserInfo; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMHostsListResponse.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMHostsListResponse.java index e3a24e32e1652..1d8b023386f20 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMHostsListResponse.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/VMHostsListResponse.java @@ -6,25 +6,27 @@ 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 com.azure.resourcemanager.newrelicobservability.fluent.models.VMInfoInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response of a list VM Host Operation. */ @Fluent -public final class VMHostsListResponse { +public final class VMHostsListResponse implements JsonSerializable { /* * The VMInfo items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,53 @@ public VMHostsListResponse withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model VMHostsListResponse")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model VMHostsListResponse")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(VMHostsListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VMHostsListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VMHostsListResponse 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 VMHostsListResponse. + */ + public static VMHostsListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VMHostsListResponse deserializedVMHostsListResponse = new VMHostsListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VMInfoInner.fromJson(reader1)); + deserializedVMHostsListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVMHostsListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVMHostsListResponse; + }); + } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/module-info.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/module-info.java index 1e6147f45c7ab..805eb32b029ae 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/module-info.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/module-info.java @@ -10,7 +10,6 @@ exports com.azure.resourcemanager.newrelicobservability.fluent.models; exports com.azure.resourcemanager.newrelicobservability.models; - opens com.azure.resourcemanager.newrelicobservability.fluent.models - to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.newrelicobservability.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.newrelicobservability.fluent.models to com.azure.core; + opens com.azure.resourcemanager.newrelicobservability.models to com.azure.core; } 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 a8095368d2081..a384731a470bd 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.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.AccountsClientImpl$AccountsService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.MonitorsClientImpl$MonitorsService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.OrganizationsClientImpl$OrganizationsService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.PlansClientImpl$PlansService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.BillingInfoesClientImpl$BillingInfoesService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.ConnectedPartnerResourcesClientImpl$ConnectedPartnerResourcesService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.TagRulesClientImpl$TagRulesService" ], [ "com.azure.resourcemanager.newrelicobservability.implementation.MonitoredSubscriptionsClientImpl$MonitoredSubscriptionsService" ] ] \ 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.TagRulesClientImpl$TagRulesService"]] \ No newline at end of file diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/reflect-config.json b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/reflect-config.json index a8e7fce62ba7a..0637a088a01e8 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/reflect-config.json +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-newrelicobservability/reflect-config.json @@ -1,411 +1 @@ -[ { - "name" : "com.azure.resourcemanager.newrelicobservability.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.OperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.AccountsListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.AccountResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.AccountProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitorProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.NewRelicAccountProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.AccountInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.OrganizationInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.NewRelicSingleSignOnProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.UserInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.PlanData", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.UserAssignedIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.OrganizationsListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.OrganizationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.PlanDataListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.PlanDataProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.NewRelicMonitorResourceUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.NewRelicMonitorResourceUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.MetricsRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.FilteringTag", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MetricsStatusResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.AppServicesListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.AppServiceInfoInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SwitchBillingRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.VMHostsListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.VMInfoInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.MonitoredResourceListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.BillingInfoResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.MarketplaceSaaSInfo", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.PartnerBillingEntity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.ConnectedPartnerResourcesListFormatInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.TagRuleListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoringTagRulesPropertiesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.LogRules", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdateInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.TagRuleUpdatePropertiesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionPropertiesList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionPropertiesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SubscriptionList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.LinkedResourceListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.LinkedResourceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.fluent.models.VMExtensionPayloadInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.MonitorsSwitchBillingHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.Origin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.ActionType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.ProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.MonitoringStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.MarketplaceSubscriptionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SingleSignOnStates", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.UsageType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.BillingCycle", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.LiftrResourceCategories", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.ManagedServiceIdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.BillingSource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.TagAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SendingLogsStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.PatchOperation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.Status", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.newrelicobservability.models.ConfigurationName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ No newline at end of file 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 3d97174a6caa6..aabca36166aa4 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 @@ -19,7 +19,7 @@ public final class ConnectedPartnerResourcesListSamples { */ public static void connectedPartnerResourcesList( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.connectedPartnerResources().list("myResourceGroup", "myMonitor", null, - com.azure.core.util.Context.NONE); + manager.connectedPartnerResources() + .list("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/MonitoredSubscriptionsCreateorUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitoredSubscriptionsCreateorUpdateSamples.java index 81a98072e16cd..f22bd2447d041 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 @@ -21,7 +21,9 @@ public final class MonitoredSubscriptionsCreateorUpdateSamples { */ public static void monitorsAddMonitoredSubscriptions( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitoredSubscriptions().define(ConfigurationName.DEFAULT) - .withExistingMonitor("myResourceGroup", "myMonitor").create(); + manager.monitoredSubscriptions() + .define(ConfigurationName.DEFAULT) + .withExistingMonitor("myResourceGroup", "myMonitor") + .create(); } } 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 5103c32c3b5f0..dda1ebeffa066 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 @@ -21,7 +21,7 @@ public final class MonitoredSubscriptionsDeleteSamples { */ public static void monitorsDeleteMonitoredSubscriptions( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitoredSubscriptions().delete("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, - com.azure.core.util.Context.NONE); + manager.monitoredSubscriptions() + .delete("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, com.azure.core.util.Context.NONE); } } 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 423fffd5efeb3..d11b01e302af7 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 @@ -21,7 +21,8 @@ public final class MonitoredSubscriptionsGetSamples { */ public static void monitorsGetMonitoredSubscriptions( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitoredSubscriptions().getWithResponse("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, - com.azure.core.util.Context.NONE); + manager.monitoredSubscriptions() + .getWithResponse("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, + com.azure.core.util.Context.NONE); } } 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 a1f305680bbc5..e7943bd2125c0 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 @@ -22,8 +22,10 @@ public final class MonitoredSubscriptionsUpdateSamples { */ public static void monitorsUpdateMonitoredSubscriptions( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - MonitoredSubscriptionProperties resource = manager.monitoredSubscriptions().getWithResponse("myResourceGroup", - "myMonitor", ConfigurationName.DEFAULT, com.azure.core.util.Context.NONE).getValue(); + MonitoredSubscriptionProperties resource = manager.monitoredSubscriptions() + .getWithResponse("myResourceGroup", "myMonitor", ConfigurationName.DEFAULT, + com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } 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 4b3326d538692..f963a84b8a065 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 @@ -38,24 +38,37 @@ public final class MonitorsCreateOrUpdateSamples { */ public static void monitorsCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().define("cdlymktqw").withRegion("k").withExistingResourceGroup("rgNewRelic") + manager.monitors() + .define("cdlymktqw") + .withRegion("k") + .withExistingResourceGroup("rgNewRelic") .withTags(mapOf("key6976", "fakeTokenPlaceholder")) .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("vcscxlncofcuduadesd") - .withAccountInfo(new AccountInfo() - .withAccountId("xhqmg").withIngestionKey("fakeTokenPlaceholder").withRegion("ljcf")) + .withAccountInfo(new AccountInfo().withAccountId("xhqmg") + .withIngestionKey("fakeTokenPlaceholder") + .withRegion("ljcf")) .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) - .withSingleSignOnProperties(new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("kwiwfz") - .withSingleSignOnUrl("kvseueuljsxmfwpqctz").withProvisioningState(ProvisioningState.ACCEPTED))) + .withSingleSignOnProperties( + new NewRelicSingleSignOnProperties().withSingleSignOnState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("kwiwfz") + .withSingleSignOnUrl("kvseueuljsxmfwpqctz") + .withProvisioningState(ProvisioningState.ACCEPTED))) .withUserInfo(new UserInfo().withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") - .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc").withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") - .withPhoneNumber("krf").withCountry("hslqnwdanrconqyekwbnttaetv")) - .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR) - .withSubscriptionState("Suspended").withSaaSAzureSubscriptionStatus("Subscribed").create(); + .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc") + .withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") + .withPhoneNumber("krf") + .withCountry("hslqnwdanrconqyekwbnttaetv")) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga") + .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR) + .withAccountCreationSource(AccountCreationSource.LIFTR) + .withSubscriptionState("Suspended") + .withSaaSAzureSubscriptionStatus("Subscribed") + .create(); } // Use "Map.of" if available 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 c33964d683a6f..e33d392f62b4e 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 @@ -19,8 +19,9 @@ public final class MonitorsDeleteSamples { */ public static void monitorsDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* @@ -34,7 +35,8 @@ public static void monitorsDeleteMinimumSetGen( */ public static void monitorsDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .delete("rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } 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 a7925763fca43..19ac552fbf44b 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 @@ -21,8 +21,9 @@ public final class MonitorsGetMetricRulesSamples { */ public static void monitorsGetMetricRulesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); + manager.monitors() + .getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } /* @@ -36,7 +37,8 @@ public static void monitorsGetMetricRulesMinimumSetGen( */ public static void monitorsGetMetricRulesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); + manager.monitors() + .getMetricRulesWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsRequest().withUserEmail("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/MonitorsGetMetricStatusSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsGetMetricStatusSamples.java index 1e76d589c2e1c..3115d777c5d73 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 @@ -22,11 +22,12 @@ public final class MonitorsGetMetricStatusSamples { */ public static void monitorsGetMetricStatusMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* @@ -40,10 +41,11 @@ public static void monitorsGetMetricStatusMinimumSetGen( */ public static void monitorsGetMetricStatusMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .getMetricStatusWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new MetricsStatusRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("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/MonitorsListAppServicesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListAppServicesSamples.java index 4a2902ed55258..c2268bddffca6 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 @@ -22,11 +22,12 @@ public final class MonitorsListAppServicesSamples { */ public static void monitorsListAppServicesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* @@ -40,10 +41,11 @@ public static void monitorsListAppServicesMaximumSetGen( */ public static void monitorsListAppServicesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .listAppServices("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new AppServicesGetRequest().withAzureResourceIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz")) + .withUserEmail("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/MonitorsListHostsSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListHostsSamples.java index 6dc202b91fe24..ae8c0bc0836c5 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 @@ -22,10 +22,11 @@ public final class MonitorsListHostsSamples { */ public static void monitorsListHostsMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listHosts( - "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", new HostsGetRequest() - .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")).withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .listHosts("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + new HostsGetRequest().withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")) + .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), + com.azure.core.util.Context.NONE); } /* @@ -39,9 +40,10 @@ public static void monitorsListHostsMinimumSetGen( */ public static void monitorsListHostsMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listHosts( - "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", new HostsGetRequest() - .withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")).withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .listHosts("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + new HostsGetRequest().withVmIds(Arrays.asList("xzphvxvfmvjrnsgyns")) + .withUserEmail("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/MonitorsListMonitoredResourcesSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsListMonitoredResourcesSamples.java index 812b01ef5e06f..85a54990ace6c 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 @@ -19,8 +19,8 @@ public final class MonitorsListMonitoredResourcesSamples { */ public static void monitorsListMonitoredResourcesMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); } /* @@ -34,7 +34,7 @@ public static void monitorsListMonitoredResourcesMinimumSetGen( */ public static void monitorsListMonitoredResourcesMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .listMonitoredResources("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", 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 a5102e651ba22..4090f02b2adf4 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 @@ -25,8 +25,9 @@ public final class MonitorsSwitchBillingSamples { */ public static void monitorsSwitchBillingMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new SwitchBillingRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); + manager.monitors() + .switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new SwitchBillingRequest().withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), com.azure.core.util.Context.NONE); } /* @@ -40,13 +41,16 @@ public static void monitorsSwitchBillingMinimumSetGen( */ public static void monitorsSwitchBillingMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", - new SwitchBillingRequest().withAzureResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") - .withOrganizationId("k") - .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withUserEmail("ruxvg@xqkmdhrnoo.hlmbpm"), - com.azure.core.util.Context.NONE); + manager.monitors() + .switchBillingWithResponse("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", + new SwitchBillingRequest().withAzureResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgNewRelic/providers/NewRelic.Observability/monitors/fhcjxnxumkdlgpwanewtkdnyuz") + .withOrganizationId("k") + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga") + .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withUserEmail("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/MonitorsUpdateSamples.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/samples/java/com/azure/resourcemanager/newrelicobservability/generated/MonitorsUpdateSamples.java index a39b88575f5b1..172bbc349a465 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 @@ -40,23 +40,33 @@ public final class MonitorsUpdateSamples { public static void monitorsUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { NewRelicMonitorResource resource = manager.monitors() - .getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE).getValue(); - resource.update().withTags(mapOf("key164", "fakeTokenPlaceholder")) + .getByResourceGroupWithResponse("rgNewRelic", "cdlymktqw", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key164", "fakeTokenPlaceholder")) .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) .withUserAssignedIdentities(mapOf("key8903", new UserAssignedIdentity()))) .withNewRelicAccountProperties(new NewRelicAccountProperties().withUserId("vcscxlncofcuduadesd") - .withAccountInfo(new AccountInfo() - .withAccountId("xhqmg").withIngestionKey("fakeTokenPlaceholder").withRegion("ljcf")) + .withAccountInfo(new AccountInfo().withAccountId("xhqmg") + .withIngestionKey("fakeTokenPlaceholder") + .withRegion("ljcf")) .withOrganizationInfo(new OrganizationInfo().withOrganizationId("k")) - .withSingleSignOnProperties(new NewRelicSingleSignOnProperties() - .withSingleSignOnState(SingleSignOnStates.INITIAL).withEnterpriseAppId("kwiwfz") - .withSingleSignOnUrl("kvseueuljsxmfwpqctz").withProvisioningState(ProvisioningState.ACCEPTED))) + .withSingleSignOnProperties( + new NewRelicSingleSignOnProperties().withSingleSignOnState(SingleSignOnStates.INITIAL) + .withEnterpriseAppId("kwiwfz") + .withSingleSignOnUrl("kvseueuljsxmfwpqctz") + .withProvisioningState(ProvisioningState.ACCEPTED))) .withUserInfo(new UserInfo().withFirstName("vdftzcggirefejajwahhwhyibutramdaotvnuf") - .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc").withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") - .withPhoneNumber("krf").withCountry("hslqnwdanrconqyekwbnttaetv")) - .withPlanData(new PlanData().withUsageType(UsageType.PAYG).withBillingCycle(BillingCycle.YEARLY) - .withPlanDetails("tbbiaga").withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) - .withOrgCreationSource(OrgCreationSource.LIFTR).withAccountCreationSource(AccountCreationSource.LIFTR) + .withLastName("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc") + .withEmailAddress("%6%@4-g.N1.3F-kI1.Ue-.lJso") + .withPhoneNumber("krf") + .withCountry("hslqnwdanrconqyekwbnttaetv")) + .withPlanData(new PlanData().withUsageType(UsageType.PAYG) + .withBillingCycle(BillingCycle.YEARLY) + .withPlanDetails("tbbiaga") + .withEffectiveDate(OffsetDateTime.parse("2022-12-05T14:11:37.786Z"))) + .withOrgCreationSource(OrgCreationSource.LIFTR) + .withAccountCreationSource(AccountCreationSource.LIFTR) .apply(); } 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 2c3ffa0e82754..0a8f98ffe5244 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 @@ -19,8 +19,8 @@ public final class MonitorsVmHostPayloadSamples { */ public static void monitorsVmHostPayloadMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", com.azure.core.util.Context.NONE); } /* @@ -34,7 +34,7 @@ public static void monitorsVmHostPayloadMinimumSetGen( */ public static void monitorsVmHostPayloadMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.monitors().vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.monitors() + .vmHostPayloadWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", 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 855790e35c59a..1b92c64f14a7e 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 @@ -28,16 +28,19 @@ public final class TagRulesCreateOrUpdateSamples { */ public static void tagRulesCreateOrUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().define("bxcantgzggsepbhqmedjqyrqeezmfb") + manager.tagRules() + .define("bxcantgzggsepbhqmedjqyrqeezmfb") .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron") .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE)))) + .withValue("sarxrqsxouhdjwsrqqicbeirdb") + .withAction(TagAction.INCLUDE)))) .withMetricRules(new MetricRulesInner() .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE))) + .withValue("sarxrqsxouhdjwsrqqicbeirdb") + .withAction(TagAction.INCLUDE))) .withUserEmail("test@testing.com")) .create(); } @@ -53,7 +56,9 @@ public static void tagRulesCreateOrUpdateMaximumSetGen( */ public static void tagRulesCreateOrUpdateMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().define("bxcantgzggsepbhqmedjqyrqeezmfb") - .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron").create(); + manager.tagRules() + .define("bxcantgzggsepbhqmedjqyrqeezmfb") + .withExistingMonitor("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron") + .create(); } } 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 0de870c4ee262..aad10088dbe78 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 @@ -19,8 +19,9 @@ public final class TagRulesDeleteSamples { */ public static void tagRulesDeleteMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules() + .delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } /* @@ -34,7 +35,8 @@ public static void tagRulesDeleteMinimumSetGen( */ public static void tagRulesDeleteMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules() + .delete("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } } 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 1fc8dbcdce8e3..5017e02836c50 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 @@ -19,8 +19,9 @@ public final class TagRulesGetSamples { */ public static void tagRulesGetMinimumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules() + .getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } /* @@ -34,7 +35,8 @@ public final class TagRulesGetSamples { */ public static void tagRulesGetMaximumSetGen(com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", - com.azure.core.util.Context.NONE); + manager.tagRules() + .getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE); } } 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 db66fbf3d26a6..23dbdf45b7816 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 @@ -19,8 +19,9 @@ public final class TagRulesListByNewRelicMonitorResourceSamples { */ public static void tagRulesListByNewRelicMonitorResourceMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.tagRules() + .listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } /* @@ -34,7 +35,8 @@ public static void tagRulesListByNewRelicMonitorResourceMinimumSetGen( */ public static void tagRulesListByNewRelicMonitorResourceMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - manager.tagRules().listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - com.azure.core.util.Context.NONE); + manager.tagRules() + .listByNewRelicMonitorResource("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", + com.azure.core.util.Context.NONE); } } 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 13b4756ffe6d8..9249ac8a0748e 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 @@ -29,17 +29,21 @@ public final class TagRulesUpdateSamples { */ public static void tagRulesUpdateMaximumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - TagRule resource = manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", com.azure.core.util.Context.NONE).getValue(); + TagRule resource = manager.tagRules() + .getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE) + .getValue(); resource.update() .withLogRules(new LogRules().withSendAadLogs(SendAadLogsStatus.ENABLED) .withSendSubscriptionLogs(SendSubscriptionLogsStatus.ENABLED) .withSendActivityLogs(SendActivityLogsStatus.ENABLED) .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE)))) + .withValue("sarxrqsxouhdjwsrqqicbeirdb") + .withAction(TagAction.INCLUDE)))) .withMetricRules(new MetricRulesInner() .withFilteringTags(Arrays.asList(new FilteringTag().withName("saokgpjvdlorciqbjmjxazpee") - .withValue("sarxrqsxouhdjwsrqqicbeirdb").withAction(TagAction.INCLUDE))) + .withValue("sarxrqsxouhdjwsrqqicbeirdb") + .withAction(TagAction.INCLUDE))) .withUserEmail("test@testing.com")) .apply(); } @@ -55,8 +59,10 @@ public static void tagRulesUpdateMaximumSetGen( */ public static void tagRulesUpdateMinimumSetGen( com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager manager) { - TagRule resource = manager.tagRules().getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", - "bxcantgzggsepbhqmedjqyrqeezmfb", com.azure.core.util.Context.NONE).getValue(); + TagRule resource = manager.tagRules() + .getWithResponse("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", + com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } 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 c24a31c082c98..ba1c02a87ee5e 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 @@ -6,45 +6,26 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.AccountResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class AccountsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"organizationId\":\"bnxknalaulppg\",\"accountId\":\"tpnapnyiropuhpig\",\"accountName\":\"gylgqgitxmedjvcs\",\"region\":\"n\"},\"id\":\"wncwzzhxgktrmg\",\"name\":\"cnapkteoell\",\"type\":\"pt\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 f531c6b231513..3ebe4e42b308b 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,44 +6,25 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.BillingInfoResponse; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class BillingInfoesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"marketplaceSaasInfo\":{\"marketplaceSubscriptionId\":\"mkcxozapvh\",\"marketplaceSubscriptionName\":\"xprglyatddc\",\"marketplaceResourceId\":\"bcuejrjxgci\",\"marketplaceStatus\":\"brh\",\"billedAzureSubscriptionId\":\"xsdqrhzoymibmrqy\"},\"partnerBillingEntity\":{\"organizationId\":\"hwflu\",\"organizationName\":\"dtmhrkwofyyvoqa\"}}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 f29090caf2bcc..7a755063b3227 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 @@ -6,45 +6,26 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.ConnectedPartnerResourcesListFormat; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ConnectedPartnerResourcesListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"accountName\":\"nqxwbp\",\"accountId\":\"ulpiuj\",\"azureResourceId\":\"asipqiio\",\"location\":\"uqerpqlpqwc\"}}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 0bc0dc5b97a3f..708b84daff54e 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,7 +16,7 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"0d515111-0dc0-4c79-ae35-bca8b0ff4154\",\"tenantId\":\"b65466f3-b3f7-4db6-b20d-92b39e36d15a\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ouskcqvkocrc\":{\"principalId\":\"edbc0ee6-6ed1-423a-914c-efc493826b54\",\"clientId\":\"38be2d04-ad2e-40ed-97c8-a81b5638be65\"},\"wtnhxbnjbiksqr\":{\"principalId\":\"1f47b747-1ebc-4183-996a-5fb0848fa847\",\"clientId\":\"58511d65-2fdb-49a0-aed6-0629aae71d97\"}}}") + "{\"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\"}}}") .toObject(ManagedServiceIdentity.class); Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); } 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 index 8a0ade3b21ab6..cae666317e6ae 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,11 +6,9 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredSubscriptionInner; @@ -21,38 +19,21 @@ import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; import com.azure.resourcemanager.newrelicobservability.models.Status; import com.azure.resourcemanager.newrelicobservability.models.SubscriptionList; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitoredSubscriptionsCreateorUpdateMockTests { @Test public void testCreateorUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - 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\"}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 2709699d57054..efdd10afc5093 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,47 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.ConfigurationName; import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; import com.azure.resourcemanager.newrelicobservability.models.Status; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitoredSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - 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\"}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 baa43cc6d8175..ef1dbc9f16440 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 @@ -6,47 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.MonitoredSubscriptionProperties; import com.azure.resourcemanager.newrelicobservability.models.PatchOperation; import com.azure.resourcemanager.newrelicobservability.models.Status; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitoredSubscriptionsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"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\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 e57cdae119f4b..964e6e7d380fd 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,41 +6,22 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitorsDeleteMockTests { @Test public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 40cdc1b9df053..7d345a39a31ef 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,47 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.MetricRules; import com.azure.resourcemanager.newrelicobservability.models.MetricsRequest; import com.azure.resourcemanager.newrelicobservability.models.SendMetricsStatus; import com.azure.resourcemanager.newrelicobservability.models.TagAction; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitorsGetMetricRulesWithResponseMockTests { @Test public void testGetMetricRulesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - 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\"}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 a0f03b31c8d84..8a97fd034cdb8 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,45 +6,26 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusRequest; import com.azure.resourcemanager.newrelicobservability.models.MetricsStatusResponse; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitorsGetMetricStatusWithResponseMockTests { @Test public void testGetMetricStatusWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"azureResourceIds\":[\"duhavhqlkt\",\"umaq\",\"lbg\",\"cdui\"]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 cfccfcf8c4fc3..979849a70da4e 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 @@ -6,47 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.AppServiceInfo; import com.azure.resourcemanager.newrelicobservability.models.AppServicesGetRequest; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitorsListAppServicesMockTests { @Test public void testListAppServices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"azureResourceId\":\"dvxzbncblylpst\",\"agentVersion\":\"hh\",\"agentStatus\":\"rzdzucerscdnt\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 4d14689337c84..24794359d7d13 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 @@ -6,47 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.HostsGetRequest; import com.azure.resourcemanager.newrelicobservability.models.VMInfo; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitorsListHostsMockTests { @Test public void testListHosts() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"vmId\":\"koievseo\",\"agentVersion\":\"q\",\"agentStatus\":\"ltmuwlauwzizx\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 b6ad34a92b009..d25911a89f2c1 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 @@ -6,44 +6,25 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.LinkedResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitorsListLinkedResourcesMockTests { @Test public void testListLinkedResources() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"id\":\"xzxcl\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 dfdf211073ab8..66f20f28a294b 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 @@ -6,47 +6,28 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.MonitoredResource; import com.azure.resourcemanager.newrelicobservability.models.SendingLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class MonitorsListMonitoredResourcesMockTests { @Test public void testListMonitoredResources() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"id\":\"orppxebmnzbtb\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"lkfg\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"euel\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 0b2799c63509e..f75d7a1206fc9 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 @@ -6,44 +6,25 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.Operation; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class OperationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"name\":\"uusdttouwa\",\"isDataAction\":false,\"display\":{\"provider\":\"v\",\"resource\":\"lns\",\"operation\":\"bxwyjsflhhcaa\",\"description\":\"jixisxyawjoyaqcs\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 a80cd548dcdbf..bdd1bb744e710 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 @@ -6,46 +6,27 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.BillingSource; import com.azure.resourcemanager.newrelicobservability.models.OrganizationResource; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class OrganizationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"organizationId\":\"cjwvn\",\"organizationName\":\"ld\",\"billingSource\":\"AZURE\"},\"id\":\"cxrslpmutwuoe\",\"name\":\"rpkhjwn\",\"type\":\"yqsluic\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 026c6e800589c..a3a931ee7706f 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 @@ -6,49 +6,30 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.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; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class PlansListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"planData\":{\"usageType\":\"PAYG\",\"billingCycle\":\"MONTHLY\",\"planDetails\":\"ft\",\"effectiveDate\":\"2021-05-16T02:46:56Z\"},\"orgCreationSource\":\"NEWRELIC\",\"accountCreationSource\":\"NEWRELIC\"},\"id\":\"zvqtmnubexkp\",\"name\":\"ksmond\",\"type\":\"mquxvypo\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 61433ed658889..2459b19c945c5 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,11 +6,9 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.fluent.models.MetricRulesInner; import com.azure.resourcemanager.newrelicobservability.models.FilteringTag; @@ -21,38 +19,21 @@ import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.TagAction; import com.azure.resourcemanager.newrelicobservability.models.TagRule; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class TagRulesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - 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\"}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 9c27e8cb3244e..43af27ef8aecc 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,41 +6,22 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class TagRulesDeleteMockTests { @Test public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 093e524fb07dd..94300f4e0cafe 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,11 +6,9 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; @@ -18,37 +16,20 @@ import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.TagAction; import com.azure.resourcemanager.newrelicobservability.models.TagRule; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class TagRulesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - 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\"}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 129a30258dc07..0c942c71e49f8 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 @@ -6,12 +6,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.newrelicobservability.NewRelicObservabilityManager; import com.azure.resourcemanager.newrelicobservability.models.SendAadLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.SendActivityLogsStatus; @@ -19,37 +17,20 @@ import com.azure.resourcemanager.newrelicobservability.models.SendSubscriptionLogsStatus; import com.azure.resourcemanager.newrelicobservability.models.TagAction; import com.azure.resourcemanager.newrelicobservability.models.TagRule; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class TagRulesListByNewRelicMonitorResourceMockTests { @Test public void testListByNewRelicMonitorResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":[{\"properties\":{\"provisioningState\":\"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\"}]}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - + 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)), 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 8add577f3dac0..c341cdf7e5df4 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\":\"8a6e797b-d54f-4f62-b647-5febff1104b3\",\"clientId\":\"02d7ff7b-5b05-448c-bc76-2918b6a0e6a4\"}") + "{\"principalId\":\"2afaa392-448a-47a3-891b-b41604fbc1f0\",\"clientId\":\"594a5240-c392-4d0f-93ac-15a1f61c66fe\"}") .toObject(UserAssignedIdentity.class); }