scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval =
+ Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw LOGGER
+ .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of NewRelic service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the NewRelic service API instance.
+ */
+ public NewRelicManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.newrelic")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
+ policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new NewRelicManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of Operations.
+ *
+ * @return Resource collection API of Operations.
+ */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /**
+ * Gets the resource collection API of Accounts.
+ *
+ * @return Resource collection API of Accounts.
+ */
+ public Accounts accounts() {
+ if (this.accounts == null) {
+ this.accounts = new AccountsImpl(clientObject.getAccounts(), this);
+ }
+ return accounts;
+ }
+
+ /**
+ * Gets the resource collection API of Monitors. It manages NewRelicMonitorResource.
+ *
+ * @return Resource collection API of Monitors.
+ */
+ public Monitors monitors() {
+ if (this.monitors == null) {
+ this.monitors = new MonitorsImpl(clientObject.getMonitors(), this);
+ }
+ return monitors;
+ }
+
+ /**
+ * Gets the resource collection API of Organizations.
+ *
+ * @return Resource collection API of Organizations.
+ */
+ public Organizations organizations() {
+ if (this.organizations == null) {
+ this.organizations = new OrganizationsImpl(clientObject.getOrganizations(), this);
+ }
+ return organizations;
+ }
+
+ /**
+ * Gets the resource collection API of Plans.
+ *
+ * @return Resource collection API of Plans.
+ */
+ public Plans plans() {
+ if (this.plans == null) {
+ this.plans = new PlansImpl(clientObject.getPlans(), this);
+ }
+ return plans;
+ }
+
+ /**
+ * Gets the resource collection API of TagRules. It manages TagRule.
+ *
+ * @return Resource collection API of TagRules.
+ */
+ public TagRules tagRules() {
+ if (this.tagRules == null) {
+ this.tagRules = new TagRulesImpl(clientObject.getTagRules(), this);
+ }
+ return tagRules;
+ }
+
+ /**
+ * @return Wrapped service client NewRelicObservability providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ */
+ public NewRelicObservability serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/AccountsClient.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/AccountsClient.java
new file mode 100644
index 000000000000..b7640f313ece
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/AccountsClient.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.newrelic.fluent.models.AccountResourceInner;
+
+/** An instance of this class provides access to all the operations defined in AccountsClient. */
+public interface AccountsClient {
+ /**
+ * List all the existing accounts.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String userEmail, String location);
+
+ /**
+ * List all the existing accounts.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String userEmail, String location, Context context);
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/MonitorsClient.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/MonitorsClient.java
new file mode 100644
index 000000000000..99c6e2288968
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/MonitorsClient.java
@@ -0,0 +1,467 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.newrelic.fluent.models.AppServiceInfoInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MetricRulesInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MetricsStatusResponseInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MonitoredResourceInner;
+import com.azure.resourcemanager.newrelic.fluent.models.NewRelicMonitorResourceInner;
+import com.azure.resourcemanager.newrelic.fluent.models.VMExtensionPayloadInner;
+import com.azure.resourcemanager.newrelic.fluent.models.VMInfoInner;
+import com.azure.resourcemanager.newrelic.models.AppServicesGetRequest;
+import com.azure.resourcemanager.newrelic.models.HostsGetRequest;
+import com.azure.resourcemanager.newrelic.models.MetricsRequest;
+import com.azure.resourcemanager.newrelic.models.MetricsStatusRequest;
+import com.azure.resourcemanager.newrelic.models.NewRelicMonitorResourceUpdate;
+import com.azure.resourcemanager.newrelic.models.SwitchBillingRequest;
+
+/** An instance of this class provides access to all the operations defined in MonitorsClient. */
+public interface MonitorsClient {
+ /**
+ * List NewRelicMonitorResource resources by subscription ID.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List NewRelicMonitorResource resources by subscription ID.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * List NewRelicMonitorResource resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List NewRelicMonitorResource resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Get a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a NewRelicMonitorResource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String monitorName, Context context);
+
+ /**
+ * Get a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a NewRelicMonitorResource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ NewRelicMonitorResourceInner getByResourceGroup(String resourceGroupName, String monitorName);
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, NewRelicMonitorResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource);
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, NewRelicMonitorResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context);
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ NewRelicMonitorResourceInner createOrUpdate(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource);
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ NewRelicMonitorResourceInner createOrUpdate(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context);
+
+ /**
+ * Update a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties, Context context);
+
+ /**
+ * Update a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ NewRelicMonitorResourceInner update(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties);
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String userEmail, String monitorName);
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String userEmail, String monitorName, Context context);
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String userEmail, String monitorName);
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String userEmail, String monitorName, Context context);
+
+ /**
+ * Get metric rules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric rules along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getMetricRulesWithResponse(
+ String resourceGroupName, String monitorName, MetricsRequest request, Context context);
+
+ /**
+ * Get metric rules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric rules.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MetricRulesInner getMetricRules(String resourceGroupName, String monitorName, MetricsRequest request);
+
+ /**
+ * Get metric status.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric status along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getMetricStatusWithResponse(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context);
+
+ /**
+ * Get metric status.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric status.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MetricsStatusResponseInner getMetricStatus(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request);
+
+ /**
+ * List the app service resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the app services get request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAppServices(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request);
+
+ /**
+ * List the app service resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the app services get request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listAppServices(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context);
+
+ /**
+ * Switches the billing for NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the switch billing request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response switchBillingWithResponse(
+ String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context);
+
+ /**
+ * Switches the billing for NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the switch billing request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request);
+
+ /**
+ * List the compute vm resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the Hosts get request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request);
+
+ /**
+ * List the compute vm resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the Hosts get request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listHosts(
+ String resourceGroupName, String monitorName, HostsGetRequest request, Context context);
+
+ /**
+ * List the resources currently being monitored by the NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listMonitoredResources(String resourceGroupName, String monitorName);
+
+ /**
+ * List the resources currently being monitored by the NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listMonitoredResources(
+ String resourceGroupName, String monitorName, Context context);
+
+ /**
+ * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of payload to be passed while installing VM agent along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response vmHostPayloadWithResponse(
+ String resourceGroupName, String monitorName, Context context);
+
+ /**
+ * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of payload to be passed while installing VM agent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VMExtensionPayloadInner vmHostPayload(String resourceGroupName, String monitorName);
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/NewRelicObservability.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/NewRelicObservability.java
new file mode 100644
index 000000000000..134ffb9d8e77
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/NewRelicObservability.java
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for NewRelicObservability class. */
+public interface NewRelicObservability {
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the AccountsClient object to access its operations.
+ *
+ * @return the AccountsClient object.
+ */
+ AccountsClient getAccounts();
+
+ /**
+ * Gets the MonitorsClient object to access its operations.
+ *
+ * @return the MonitorsClient object.
+ */
+ MonitorsClient getMonitors();
+
+ /**
+ * Gets the OrganizationsClient object to access its operations.
+ *
+ * @return the OrganizationsClient object.
+ */
+ OrganizationsClient getOrganizations();
+
+ /**
+ * Gets the PlansClient object to access its operations.
+ *
+ * @return the PlansClient object.
+ */
+ PlansClient getPlans();
+
+ /**
+ * Gets the TagRulesClient object to access its operations.
+ *
+ * @return the TagRulesClient object.
+ */
+ TagRulesClient getTagRules();
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/OperationsClient.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/OperationsClient.java
new file mode 100644
index 000000000000..a322afb2216b
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/OperationsClient.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.newrelic.fluent.models.OperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * List the operations for the provider.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/OrganizationsClient.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/OrganizationsClient.java
new file mode 100644
index 000000000000..bbdd9a20cb1b
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/OrganizationsClient.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.newrelic.fluent.models.OrganizationResourceInner;
+
+/** An instance of this class provides access to all the operations defined in OrganizationsClient. */
+public interface OrganizationsClient {
+ /**
+ * List all the existing organizations.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all organizations Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String userEmail, String location);
+
+ /**
+ * List all the existing organizations.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all organizations Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String userEmail, String location, Context context);
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/PlansClient.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/PlansClient.java
new file mode 100644
index 000000000000..28eff2f0a9bb
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/PlansClient.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.newrelic.fluent.models.PlanDataResourceInner;
+
+/** An instance of this class provides access to all the operations defined in PlansClient. */
+public interface PlansClient {
+ /**
+ * List plans data.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all plan data Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List plans data.
+ *
+ * @param accountId Account Id.
+ * @param organizationId Organization Id.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all plan data Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String accountId, String organizationId, Context context);
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/TagRulesClient.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/TagRulesClient.java
new file mode 100644
index 000000000000..df15b6713585
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/TagRulesClient.java
@@ -0,0 +1,236 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.newrelic.fluent.models.TagRuleInner;
+import com.azure.resourcemanager.newrelic.fluent.models.TagRuleUpdateInner;
+
+/** An instance of this class provides access to all the operations defined in TagRulesClient. */
+public interface TagRulesClient {
+ /**
+ * List TagRule resources by NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByNewRelicMonitorResource(String resourceGroupName, String monitorName);
+
+ /**
+ * List TagRule resources by NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TagRule list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByNewRelicMonitorResource(
+ String resourceGroupName, String monitorName, Context context);
+
+ /**
+ * Get a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TagRule along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String monitorName, String ruleSetName, Context context);
+
+ /**
+ * Get a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TagRule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TagRuleInner get(String resourceGroupName, String monitorName, String ruleSetName);
+
+ /**
+ * Create a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a tag rule belonging to NewRelic account.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, TagRuleInner> beginCreateOrUpdate(
+ String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource);
+
+ /**
+ * Create a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a tag rule belonging to NewRelic account.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, TagRuleInner> beginCreateOrUpdate(
+ String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context);
+
+ /**
+ * Create a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a tag rule belonging to NewRelic account.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TagRuleInner createOrUpdate(
+ String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource);
+
+ /**
+ * Create a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a tag rule belonging to NewRelic account.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TagRuleInner createOrUpdate(
+ String resourceGroupName, String monitorName, String ruleSetName, TagRuleInner resource, Context context);
+
+ /**
+ * Delete a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String monitorName, String ruleSetName);
+
+ /**
+ * Delete a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String monitorName, String ruleSetName, Context context);
+
+ /**
+ * Delete a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String monitorName, String ruleSetName);
+
+ /**
+ * Delete a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String monitorName, String ruleSetName, Context context);
+
+ /**
+ * Update a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a tag rule belonging to NewRelic account along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName,
+ String monitorName,
+ String ruleSetName,
+ TagRuleUpdateInner properties,
+ Context context);
+
+ /**
+ * Update a TagRule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param ruleSetName Name of the TagRule.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a tag rule belonging to NewRelic account.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TagRuleInner update(
+ String resourceGroupName, String monitorName, String ruleSetName, TagRuleUpdateInner properties);
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AccountProperties.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AccountProperties.java
new file mode 100644
index 000000000000..7afd9f85fc18
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AccountProperties.java
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** List of all the New relic accounts for the given user. */
+@Fluent
+public final class AccountProperties {
+ /*
+ * 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
+ */
+ @JsonProperty(value = "region")
+ private String region;
+
+ /** Creates an instance of AccountProperties class. */
+ public AccountProperties() {
+ }
+
+ /**
+ * Get the organizationId property: organization id.
+ *
+ * @return the organizationId value.
+ */
+ public String organizationId() {
+ return this.organizationId;
+ }
+
+ /**
+ * Set the organizationId property: organization id.
+ *
+ * @param organizationId the organizationId value to set.
+ * @return the AccountProperties object itself.
+ */
+ public AccountProperties withOrganizationId(String organizationId) {
+ this.organizationId = organizationId;
+ return this;
+ }
+
+ /**
+ * Get the accountId property: account id.
+ *
+ * @return the accountId value.
+ */
+ public String accountId() {
+ return this.accountId;
+ }
+
+ /**
+ * Set the accountId property: account id.
+ *
+ * @param accountId the accountId value to set.
+ * @return the AccountProperties object itself.
+ */
+ public AccountProperties withAccountId(String accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * Get the accountName property: account name.
+ *
+ * @return the accountName value.
+ */
+ public String accountName() {
+ return this.accountName;
+ }
+
+ /**
+ * Set the accountName property: account name.
+ *
+ * @param accountName the accountName value to set.
+ * @return the AccountProperties object itself.
+ */
+ public AccountProperties withAccountName(String accountName) {
+ this.accountName = accountName;
+ return this;
+ }
+
+ /**
+ * Get the region property: region.
+ *
+ * @return the region value.
+ */
+ public String region() {
+ return this.region;
+ }
+
+ /**
+ * Set the region property: region.
+ *
+ * @param region the region value to set.
+ * @return the AccountProperties object itself.
+ */
+ public AccountProperties withRegion(String region) {
+ this.region = region;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AccountResourceInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AccountResourceInner.java
new file mode 100644
index 000000000000..48b7f27f9bd9
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AccountResourceInner.java
@@ -0,0 +1,151 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The details of a account resource. */
+@Fluent
+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;
+
+ /** Creates an instance of AccountResourceInner class. */
+ public AccountResourceInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private AccountProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the organizationId property: organization id.
+ *
+ * @return the organizationId value.
+ */
+ public String organizationId() {
+ return this.innerProperties() == null ? null : this.innerProperties().organizationId();
+ }
+
+ /**
+ * Set the organizationId property: organization id.
+ *
+ * @param organizationId the organizationId value to set.
+ * @return the AccountResourceInner object itself.
+ */
+ public AccountResourceInner withOrganizationId(String organizationId) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new AccountProperties();
+ }
+ this.innerProperties().withOrganizationId(organizationId);
+ return this;
+ }
+
+ /**
+ * Get the accountId property: account id.
+ *
+ * @return the accountId value.
+ */
+ public String accountId() {
+ return this.innerProperties() == null ? null : this.innerProperties().accountId();
+ }
+
+ /**
+ * Set the accountId property: account id.
+ *
+ * @param accountId the accountId value to set.
+ * @return the AccountResourceInner object itself.
+ */
+ public AccountResourceInner withAccountId(String accountId) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new AccountProperties();
+ }
+ this.innerProperties().withAccountId(accountId);
+ return this;
+ }
+
+ /**
+ * Get the accountName property: account name.
+ *
+ * @return the accountName value.
+ */
+ public String accountName() {
+ return this.innerProperties() == null ? null : this.innerProperties().accountName();
+ }
+
+ /**
+ * Set the accountName property: account name.
+ *
+ * @param accountName the accountName value to set.
+ * @return the AccountResourceInner object itself.
+ */
+ public AccountResourceInner withAccountName(String accountName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new AccountProperties();
+ }
+ this.innerProperties().withAccountName(accountName);
+ return this;
+ }
+
+ /**
+ * Get the region property: region.
+ *
+ * @return the region value.
+ */
+ public String region() {
+ return this.innerProperties() == null ? null : this.innerProperties().region();
+ }
+
+ /**
+ * Set the region property: region.
+ *
+ * @param region the region value to set.
+ * @return the AccountResourceInner object itself.
+ */
+ public AccountResourceInner withRegion(String region) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new AccountProperties();
+ }
+ this.innerProperties().withRegion(region);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AppServiceInfoInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AppServiceInfoInner.java
new file mode 100644
index 000000000000..839d5e4f08ba
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/AppServiceInfoInner.java
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Details of VM Resource having NewRelic OneAgent installed. */
+@Fluent
+public final class AppServiceInfoInner {
+ /*
+ * 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;
+
+ /** Creates an instance of AppServiceInfoInner class. */
+ public AppServiceInfoInner() {
+ }
+
+ /**
+ * Get the azureResourceId property: Azure App service resource ID.
+ *
+ * @return the azureResourceId value.
+ */
+ public String azureResourceId() {
+ return this.azureResourceId;
+ }
+
+ /**
+ * Set the azureResourceId property: Azure App service resource ID.
+ *
+ * @param azureResourceId the azureResourceId value to set.
+ * @return the AppServiceInfoInner object itself.
+ */
+ public AppServiceInfoInner withAzureResourceId(String azureResourceId) {
+ this.azureResourceId = azureResourceId;
+ return this;
+ }
+
+ /**
+ * Get the agentVersion property: Version of the NewRelic agent installed on the App service.
+ *
+ * @return the agentVersion value.
+ */
+ public String agentVersion() {
+ return this.agentVersion;
+ }
+
+ /**
+ * Set the agentVersion property: Version of the NewRelic agent installed on the App service.
+ *
+ * @param agentVersion the agentVersion value to set.
+ * @return the AppServiceInfoInner object itself.
+ */
+ public AppServiceInfoInner withAgentVersion(String agentVersion) {
+ this.agentVersion = agentVersion;
+ return this;
+ }
+
+ /**
+ * Get the agentStatus property: Status of the NewRelic agent installed on the App service.
+ *
+ * @return the agentStatus value.
+ */
+ public String agentStatus() {
+ return this.agentStatus;
+ }
+
+ /**
+ * Set the agentStatus property: Status of the NewRelic agent installed on the App service.
+ *
+ * @param agentStatus the agentStatus value to set.
+ * @return the AppServiceInfoInner object itself.
+ */
+ public AppServiceInfoInner withAgentStatus(String agentStatus) {
+ this.agentStatus = agentStatus;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MetricRulesInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MetricRulesInner.java
new file mode 100644
index 000000000000..45f3a42cb6f4
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MetricRulesInner.java
@@ -0,0 +1,108 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.FilteringTag;
+import com.azure.resourcemanager.newrelic.models.SendMetricsStatus;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Set of rules for sending metrics for the Monitor resource. */
+@Fluent
+public final class MetricRulesInner {
+ /*
+ * 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;
+
+ /** Creates an instance of MetricRulesInner class. */
+ public MetricRulesInner() {
+ }
+
+ /**
+ * Get the sendMetrics property: Flag specifying if metrics should be sent for the Monitor resource.
+ *
+ * @return the sendMetrics value.
+ */
+ public SendMetricsStatus sendMetrics() {
+ return this.sendMetrics;
+ }
+
+ /**
+ * Set the sendMetrics property: Flag specifying if metrics should be sent for the Monitor resource.
+ *
+ * @param sendMetrics the sendMetrics value to set.
+ * @return the MetricRulesInner object itself.
+ */
+ public MetricRulesInner withSendMetrics(SendMetricsStatus sendMetrics) {
+ this.sendMetrics = sendMetrics;
+ return this;
+ }
+
+ /**
+ * Get the filteringTags property: List of filtering tags to be used for capturing metrics.
+ *
+ * @return the filteringTags value.
+ */
+ public List filteringTags() {
+ return this.filteringTags;
+ }
+
+ /**
+ * Set the filteringTags property: List of filtering tags to be used for capturing metrics.
+ *
+ * @param filteringTags the filteringTags value to set.
+ * @return the MetricRulesInner object itself.
+ */
+ public MetricRulesInner withFilteringTags(List filteringTags) {
+ this.filteringTags = filteringTags;
+ return this;
+ }
+
+ /**
+ * Get the userEmail property: User Email.
+ *
+ * @return the userEmail value.
+ */
+ public String userEmail() {
+ return this.userEmail;
+ }
+
+ /**
+ * Set the userEmail property: User Email.
+ *
+ * @param userEmail the userEmail value to set.
+ * @return the MetricRulesInner object itself.
+ */
+ public MetricRulesInner withUserEmail(String userEmail) {
+ this.userEmail = userEmail;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (filteringTags() != null) {
+ filteringTags().forEach(e -> e.validate());
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MetricsStatusResponseInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MetricsStatusResponseInner.java
new file mode 100644
index 000000000000..58f29ac7c7ef
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MetricsStatusResponseInner.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Response of get metrics status Operation. */
+@Fluent
+public final class MetricsStatusResponseInner {
+ /*
+ * Azure resource IDs
+ */
+ @JsonProperty(value = "azureResourceIds")
+ private List azureResourceIds;
+
+ /** Creates an instance of MetricsStatusResponseInner class. */
+ public MetricsStatusResponseInner() {
+ }
+
+ /**
+ * Get the azureResourceIds property: Azure resource IDs.
+ *
+ * @return the azureResourceIds value.
+ */
+ public List azureResourceIds() {
+ return this.azureResourceIds;
+ }
+
+ /**
+ * Set the azureResourceIds property: Azure resource IDs.
+ *
+ * @param azureResourceIds the azureResourceIds value to set.
+ * @return the MetricsStatusResponseInner object itself.
+ */
+ public MetricsStatusResponseInner withAzureResourceIds(List azureResourceIds) {
+ this.azureResourceIds = azureResourceIds;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitorProperties.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitorProperties.java
new file mode 100644
index 000000000000..3f772f8bfa60
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitorProperties.java
@@ -0,0 +1,262 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.AccountCreationSource;
+import com.azure.resourcemanager.newrelic.models.LiftrResourceCategories;
+import com.azure.resourcemanager.newrelic.models.MarketplaceSubscriptionStatus;
+import com.azure.resourcemanager.newrelic.models.MonitoringStatus;
+import com.azure.resourcemanager.newrelic.models.NewRelicAccountProperties;
+import com.azure.resourcemanager.newrelic.models.OrgCreationSource;
+import com.azure.resourcemanager.newrelic.models.PlanData;
+import com.azure.resourcemanager.newrelic.models.ProvisioningState;
+import com.azure.resourcemanager.newrelic.models.UserInfo;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Properties specific to the NewRelic Monitor resource. */
+@Fluent
+public final class MonitorProperties {
+ /*
+ * 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;
+
+ /** Creates an instance of MonitorProperties class. */
+ public MonitorProperties() {
+ }
+
+ /**
+ * Get the provisioningState property: Provisioning State of the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the monitoringStatus property: MonitoringStatus of the resource.
+ *
+ * @return the monitoringStatus value.
+ */
+ public MonitoringStatus monitoringStatus() {
+ return this.monitoringStatus;
+ }
+
+ /**
+ * Get the marketplaceSubscriptionStatus property: NewRelic Organization properties of the resource.
+ *
+ * @return the marketplaceSubscriptionStatus value.
+ */
+ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() {
+ return this.marketplaceSubscriptionStatus;
+ }
+
+ /**
+ * Get the marketplaceSubscriptionId property: Marketplace Subscription Id.
+ *
+ * @return the marketplaceSubscriptionId value.
+ */
+ public String marketplaceSubscriptionId() {
+ return this.marketplaceSubscriptionId;
+ }
+
+ /**
+ * Get the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource.
+ *
+ * @return the newRelicAccountProperties value.
+ */
+ public NewRelicAccountProperties newRelicAccountProperties() {
+ return this.newRelicAccountProperties;
+ }
+
+ /**
+ * Set the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource.
+ *
+ * @param newRelicAccountProperties the newRelicAccountProperties value to set.
+ * @return the MonitorProperties object itself.
+ */
+ public MonitorProperties withNewRelicAccountProperties(NewRelicAccountProperties newRelicAccountProperties) {
+ this.newRelicAccountProperties = newRelicAccountProperties;
+ return this;
+ }
+
+ /**
+ * Get the userInfo property: User Info.
+ *
+ * @return the userInfo value.
+ */
+ public UserInfo userInfo() {
+ return this.userInfo;
+ }
+
+ /**
+ * Set the userInfo property: User Info.
+ *
+ * @param userInfo the userInfo value to set.
+ * @return the MonitorProperties object itself.
+ */
+ public MonitorProperties withUserInfo(UserInfo userInfo) {
+ this.userInfo = userInfo;
+ return this;
+ }
+
+ /**
+ * Get the planData property: Plan details.
+ *
+ * @return the planData value.
+ */
+ public PlanData planData() {
+ return this.planData;
+ }
+
+ /**
+ * Set the planData property: Plan details.
+ *
+ * @param planData the planData value to set.
+ * @return the MonitorProperties object itself.
+ */
+ public MonitorProperties withPlanData(PlanData planData) {
+ this.planData = planData;
+ return this;
+ }
+
+ /**
+ * Get the liftrResourceCategory property: Liftr resource category.
+ *
+ * @return the liftrResourceCategory value.
+ */
+ public LiftrResourceCategories liftrResourceCategory() {
+ return this.liftrResourceCategory;
+ }
+
+ /**
+ * Get the liftrResourcePreference property: Liftr resource preference. The priority of the resource.
+ *
+ * @return the liftrResourcePreference value.
+ */
+ public Integer liftrResourcePreference() {
+ return this.liftrResourcePreference;
+ }
+
+ /**
+ * Get the orgCreationSource property: Source of org creation.
+ *
+ * @return the orgCreationSource value.
+ */
+ public OrgCreationSource orgCreationSource() {
+ return this.orgCreationSource;
+ }
+
+ /**
+ * Set the orgCreationSource property: Source of org creation.
+ *
+ * @param orgCreationSource the orgCreationSource value to set.
+ * @return the MonitorProperties object itself.
+ */
+ public MonitorProperties withOrgCreationSource(OrgCreationSource orgCreationSource) {
+ this.orgCreationSource = orgCreationSource;
+ return this;
+ }
+
+ /**
+ * Get the accountCreationSource property: Source of account creation.
+ *
+ * @return the accountCreationSource value.
+ */
+ public AccountCreationSource accountCreationSource() {
+ return this.accountCreationSource;
+ }
+
+ /**
+ * Set the accountCreationSource property: Source of account creation.
+ *
+ * @param accountCreationSource the accountCreationSource value to set.
+ * @return the MonitorProperties object itself.
+ */
+ public MonitorProperties withAccountCreationSource(AccountCreationSource accountCreationSource) {
+ this.accountCreationSource = accountCreationSource;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (newRelicAccountProperties() != null) {
+ newRelicAccountProperties().validate();
+ }
+ if (userInfo() != null) {
+ userInfo().validate();
+ }
+ if (planData() != null) {
+ planData().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitoredResourceInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitoredResourceInner.java
new file mode 100644
index 000000000000..184a895aeef7
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitoredResourceInner.java
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.SendingLogsStatus;
+import com.azure.resourcemanager.newrelic.models.SendingMetricsStatus;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Details of resource being monitored by NewRelic monitor resource. */
+@Fluent
+public final class MonitoredResourceInner {
+ /*
+ * 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;
+
+ /** Creates an instance of MonitoredResourceInner class. */
+ public MonitoredResourceInner() {
+ }
+
+ /**
+ * Get the id property: The ARM id of the resource.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set the id property: The ARM id of the resource.
+ *
+ * @param id the id value to set.
+ * @return the MonitoredResourceInner object itself.
+ */
+ public MonitoredResourceInner withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get the sendingMetrics property: Flag indicating if resource is sending metrics to NewRelic.
+ *
+ * @return the sendingMetrics value.
+ */
+ public SendingMetricsStatus sendingMetrics() {
+ return this.sendingMetrics;
+ }
+
+ /**
+ * Set the sendingMetrics property: Flag indicating if resource is sending metrics to NewRelic.
+ *
+ * @param sendingMetrics the sendingMetrics value to set.
+ * @return the MonitoredResourceInner object itself.
+ */
+ public MonitoredResourceInner withSendingMetrics(SendingMetricsStatus sendingMetrics) {
+ this.sendingMetrics = sendingMetrics;
+ return this;
+ }
+
+ /**
+ * Get the reasonForMetricsStatus property: Reason for why the resource is sending metrics (or why it is not
+ * sending).
+ *
+ * @return the reasonForMetricsStatus value.
+ */
+ public String reasonForMetricsStatus() {
+ return this.reasonForMetricsStatus;
+ }
+
+ /**
+ * Set the reasonForMetricsStatus property: Reason for why the resource is sending metrics (or why it is not
+ * sending).
+ *
+ * @param reasonForMetricsStatus the reasonForMetricsStatus value to set.
+ * @return the MonitoredResourceInner object itself.
+ */
+ public MonitoredResourceInner withReasonForMetricsStatus(String reasonForMetricsStatus) {
+ this.reasonForMetricsStatus = reasonForMetricsStatus;
+ return this;
+ }
+
+ /**
+ * Get the sendingLogs property: Flag indicating if resource is sending logs to NewRelic.
+ *
+ * @return the sendingLogs value.
+ */
+ public SendingLogsStatus sendingLogs() {
+ return this.sendingLogs;
+ }
+
+ /**
+ * Set the sendingLogs property: Flag indicating if resource is sending logs to NewRelic.
+ *
+ * @param sendingLogs the sendingLogs value to set.
+ * @return the MonitoredResourceInner object itself.
+ */
+ public MonitoredResourceInner withSendingLogs(SendingLogsStatus sendingLogs) {
+ this.sendingLogs = sendingLogs;
+ return this;
+ }
+
+ /**
+ * Get the reasonForLogsStatus property: Reason for why the resource is sending logs (or why it is not sending).
+ *
+ * @return the reasonForLogsStatus value.
+ */
+ public String reasonForLogsStatus() {
+ return this.reasonForLogsStatus;
+ }
+
+ /**
+ * Set the reasonForLogsStatus property: Reason for why the resource is sending logs (or why it is not sending).
+ *
+ * @param reasonForLogsStatus the reasonForLogsStatus value to set.
+ * @return the MonitoredResourceInner object itself.
+ */
+ public MonitoredResourceInner withReasonForLogsStatus(String reasonForLogsStatus) {
+ this.reasonForLogsStatus = reasonForLogsStatus;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitoringTagRulesPropertiesInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitoringTagRulesPropertiesInner.java
new file mode 100644
index 000000000000..917e768739b7
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/MonitoringTagRulesPropertiesInner.java
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.LogRules;
+import com.azure.resourcemanager.newrelic.models.ProvisioningState;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The resource-specific properties for this resource. */
+@Fluent
+public final class MonitoringTagRulesPropertiesInner {
+ /*
+ * 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;
+
+ /** Creates an instance of MonitoringTagRulesPropertiesInner class. */
+ public MonitoringTagRulesPropertiesInner() {
+ }
+
+ /**
+ * Get the provisioningState property: Provisioning State of the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the logRules property: Set of rules for sending logs for the Monitor resource.
+ *
+ * @return the logRules value.
+ */
+ public LogRules logRules() {
+ return this.logRules;
+ }
+
+ /**
+ * Set the logRules property: Set of rules for sending logs for the Monitor resource.
+ *
+ * @param logRules the logRules value to set.
+ * @return the MonitoringTagRulesPropertiesInner object itself.
+ */
+ public MonitoringTagRulesPropertiesInner withLogRules(LogRules logRules) {
+ this.logRules = logRules;
+ return this;
+ }
+
+ /**
+ * Get the metricRules property: Set of rules for sending metrics for the Monitor resource.
+ *
+ * @return the metricRules value.
+ */
+ public MetricRulesInner metricRules() {
+ return this.metricRules;
+ }
+
+ /**
+ * Set the metricRules property: Set of rules for sending metrics for the Monitor resource.
+ *
+ * @param metricRules the metricRules value to set.
+ * @return the MonitoringTagRulesPropertiesInner object itself.
+ */
+ public MonitoringTagRulesPropertiesInner withMetricRules(MetricRulesInner metricRules) {
+ this.metricRules = metricRules;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (logRules() != null) {
+ logRules().validate();
+ }
+ if (metricRules() != null) {
+ metricRules().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/NewRelicMonitorResourceInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/NewRelicMonitorResourceInner.java
new file mode 100644
index 000000000000..479dc2ad3c01
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/NewRelicMonitorResourceInner.java
@@ -0,0 +1,291 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.newrelic.models.AccountCreationSource;
+import com.azure.resourcemanager.newrelic.models.LiftrResourceCategories;
+import com.azure.resourcemanager.newrelic.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.newrelic.models.MarketplaceSubscriptionStatus;
+import com.azure.resourcemanager.newrelic.models.MonitoringStatus;
+import com.azure.resourcemanager.newrelic.models.NewRelicAccountProperties;
+import com.azure.resourcemanager.newrelic.models.OrgCreationSource;
+import com.azure.resourcemanager.newrelic.models.PlanData;
+import com.azure.resourcemanager.newrelic.models.ProvisioningState;
+import com.azure.resourcemanager.newrelic.models.UserInfo;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
+/** A Monitor Resource by NewRelic. */
+@Fluent
+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;
+
+ /** Creates an instance of NewRelicMonitorResourceInner class. */
+ public NewRelicMonitorResourceInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private MonitorProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the identity property: The managed service identities assigned to this resource.
+ *
+ * @return the identity value.
+ */
+ public ManagedServiceIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: The managed service identities assigned to this resource.
+ *
+ * @param identity the identity value to set.
+ * @return the NewRelicMonitorResourceInner object itself.
+ */
+ public NewRelicMonitorResourceInner withIdentity(ManagedServiceIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public NewRelicMonitorResourceInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public NewRelicMonitorResourceInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: Provisioning State of the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the monitoringStatus property: MonitoringStatus of the resource.
+ *
+ * @return the monitoringStatus value.
+ */
+ public MonitoringStatus monitoringStatus() {
+ return this.innerProperties() == null ? null : this.innerProperties().monitoringStatus();
+ }
+
+ /**
+ * Get the marketplaceSubscriptionStatus property: NewRelic Organization properties of the resource.
+ *
+ * @return the marketplaceSubscriptionStatus value.
+ */
+ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() {
+ return this.innerProperties() == null ? null : this.innerProperties().marketplaceSubscriptionStatus();
+ }
+
+ /**
+ * Get the marketplaceSubscriptionId property: Marketplace Subscription Id.
+ *
+ * @return the marketplaceSubscriptionId value.
+ */
+ public String marketplaceSubscriptionId() {
+ return this.innerProperties() == null ? null : this.innerProperties().marketplaceSubscriptionId();
+ }
+
+ /**
+ * Get the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource.
+ *
+ * @return the newRelicAccountProperties value.
+ */
+ public NewRelicAccountProperties newRelicAccountProperties() {
+ return this.innerProperties() == null ? null : this.innerProperties().newRelicAccountProperties();
+ }
+
+ /**
+ * Set the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource.
+ *
+ * @param newRelicAccountProperties the newRelicAccountProperties value to set.
+ * @return the NewRelicMonitorResourceInner object itself.
+ */
+ public NewRelicMonitorResourceInner withNewRelicAccountProperties(
+ NewRelicAccountProperties newRelicAccountProperties) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MonitorProperties();
+ }
+ this.innerProperties().withNewRelicAccountProperties(newRelicAccountProperties);
+ return this;
+ }
+
+ /**
+ * Get the userInfo property: User Info.
+ *
+ * @return the userInfo value.
+ */
+ public UserInfo userInfo() {
+ return this.innerProperties() == null ? null : this.innerProperties().userInfo();
+ }
+
+ /**
+ * Set the userInfo property: User Info.
+ *
+ * @param userInfo the userInfo value to set.
+ * @return the NewRelicMonitorResourceInner object itself.
+ */
+ public NewRelicMonitorResourceInner withUserInfo(UserInfo userInfo) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MonitorProperties();
+ }
+ this.innerProperties().withUserInfo(userInfo);
+ return this;
+ }
+
+ /**
+ * Get the planData property: Plan details.
+ *
+ * @return the planData value.
+ */
+ public PlanData planData() {
+ return this.innerProperties() == null ? null : this.innerProperties().planData();
+ }
+
+ /**
+ * Set the planData property: Plan details.
+ *
+ * @param planData the planData value to set.
+ * @return the NewRelicMonitorResourceInner object itself.
+ */
+ public NewRelicMonitorResourceInner withPlanData(PlanData planData) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MonitorProperties();
+ }
+ this.innerProperties().withPlanData(planData);
+ return this;
+ }
+
+ /**
+ * Get the liftrResourceCategory property: Liftr resource category.
+ *
+ * @return the liftrResourceCategory value.
+ */
+ public LiftrResourceCategories liftrResourceCategory() {
+ return this.innerProperties() == null ? null : this.innerProperties().liftrResourceCategory();
+ }
+
+ /**
+ * Get the liftrResourcePreference property: Liftr resource preference. The priority of the resource.
+ *
+ * @return the liftrResourcePreference value.
+ */
+ public Integer liftrResourcePreference() {
+ return this.innerProperties() == null ? null : this.innerProperties().liftrResourcePreference();
+ }
+
+ /**
+ * Get the orgCreationSource property: Source of org creation.
+ *
+ * @return the orgCreationSource value.
+ */
+ public OrgCreationSource orgCreationSource() {
+ return this.innerProperties() == null ? null : this.innerProperties().orgCreationSource();
+ }
+
+ /**
+ * Set the orgCreationSource property: Source of org creation.
+ *
+ * @param orgCreationSource the orgCreationSource value to set.
+ * @return the NewRelicMonitorResourceInner object itself.
+ */
+ public NewRelicMonitorResourceInner withOrgCreationSource(OrgCreationSource orgCreationSource) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MonitorProperties();
+ }
+ this.innerProperties().withOrgCreationSource(orgCreationSource);
+ return this;
+ }
+
+ /**
+ * Get the accountCreationSource property: Source of account creation.
+ *
+ * @return the accountCreationSource value.
+ */
+ public AccountCreationSource accountCreationSource() {
+ return this.innerProperties() == null ? null : this.innerProperties().accountCreationSource();
+ }
+
+ /**
+ * Set the accountCreationSource property: Source of account creation.
+ *
+ * @param accountCreationSource the accountCreationSource value to set.
+ * @return the NewRelicMonitorResourceInner object itself.
+ */
+ public NewRelicMonitorResourceInner withAccountCreationSource(AccountCreationSource accountCreationSource) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MonitorProperties();
+ }
+ this.innerProperties().withAccountCreationSource(accountCreationSource);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property innerProperties in model NewRelicMonitorResourceInner"));
+ } else {
+ innerProperties().validate();
+ }
+ if (identity() != null) {
+ identity().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(NewRelicMonitorResourceInner.class);
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/NewRelicMonitorResourceUpdateProperties.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/NewRelicMonitorResourceUpdateProperties.java
new file mode 100644
index 000000000000..fa5a286a644c
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/NewRelicMonitorResourceUpdateProperties.java
@@ -0,0 +1,170 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.AccountCreationSource;
+import com.azure.resourcemanager.newrelic.models.NewRelicAccountProperties;
+import com.azure.resourcemanager.newrelic.models.OrgCreationSource;
+import com.azure.resourcemanager.newrelic.models.PlanData;
+import com.azure.resourcemanager.newrelic.models.UserInfo;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The updatable properties of the NewRelicMonitorResource. */
+@Fluent
+public final class NewRelicMonitorResourceUpdateProperties {
+ /*
+ * 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;
+
+ /** Creates an instance of NewRelicMonitorResourceUpdateProperties class. */
+ public NewRelicMonitorResourceUpdateProperties() {
+ }
+
+ /**
+ * Get the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource.
+ *
+ * @return the newRelicAccountProperties value.
+ */
+ public NewRelicAccountProperties newRelicAccountProperties() {
+ return this.newRelicAccountProperties;
+ }
+
+ /**
+ * Set the newRelicAccountProperties property: MarketplaceSubscriptionStatus of the resource.
+ *
+ * @param newRelicAccountProperties the newRelicAccountProperties value to set.
+ * @return the NewRelicMonitorResourceUpdateProperties object itself.
+ */
+ public NewRelicMonitorResourceUpdateProperties withNewRelicAccountProperties(
+ NewRelicAccountProperties newRelicAccountProperties) {
+ this.newRelicAccountProperties = newRelicAccountProperties;
+ return this;
+ }
+
+ /**
+ * Get the userInfo property: User Info.
+ *
+ * @return the userInfo value.
+ */
+ public UserInfo userInfo() {
+ return this.userInfo;
+ }
+
+ /**
+ * Set the userInfo property: User Info.
+ *
+ * @param userInfo the userInfo value to set.
+ * @return the NewRelicMonitorResourceUpdateProperties object itself.
+ */
+ public NewRelicMonitorResourceUpdateProperties withUserInfo(UserInfo userInfo) {
+ this.userInfo = userInfo;
+ return this;
+ }
+
+ /**
+ * Get the planData property: Plan details.
+ *
+ * @return the planData value.
+ */
+ public PlanData planData() {
+ return this.planData;
+ }
+
+ /**
+ * Set the planData property: Plan details.
+ *
+ * @param planData the planData value to set.
+ * @return the NewRelicMonitorResourceUpdateProperties object itself.
+ */
+ public NewRelicMonitorResourceUpdateProperties withPlanData(PlanData planData) {
+ this.planData = planData;
+ return this;
+ }
+
+ /**
+ * Get the orgCreationSource property: Source of org creation.
+ *
+ * @return the orgCreationSource value.
+ */
+ public OrgCreationSource orgCreationSource() {
+ return this.orgCreationSource;
+ }
+
+ /**
+ * Set the orgCreationSource property: Source of org creation.
+ *
+ * @param orgCreationSource the orgCreationSource value to set.
+ * @return the NewRelicMonitorResourceUpdateProperties object itself.
+ */
+ public NewRelicMonitorResourceUpdateProperties withOrgCreationSource(OrgCreationSource orgCreationSource) {
+ this.orgCreationSource = orgCreationSource;
+ return this;
+ }
+
+ /**
+ * Get the accountCreationSource property: Source of account creation.
+ *
+ * @return the accountCreationSource value.
+ */
+ public AccountCreationSource accountCreationSource() {
+ return this.accountCreationSource;
+ }
+
+ /**
+ * Set the accountCreationSource property: Source of account creation.
+ *
+ * @param accountCreationSource the accountCreationSource value to set.
+ * @return the NewRelicMonitorResourceUpdateProperties object itself.
+ */
+ public NewRelicMonitorResourceUpdateProperties withAccountCreationSource(
+ AccountCreationSource accountCreationSource) {
+ this.accountCreationSource = accountCreationSource;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (newRelicAccountProperties() != null) {
+ newRelicAccountProperties().validate();
+ }
+ if (userInfo() != null) {
+ userInfo().validate();
+ }
+ if (planData() != null) {
+ planData().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OperationInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OperationInner.java
new file mode 100644
index 000000000000..06597852c486
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OperationInner.java
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.ActionType;
+import com.azure.resourcemanager.newrelic.models.OperationDisplay;
+import com.azure.resourcemanager.newrelic.models.Origin;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Fluent
+public final class OperationInner {
+ /*
+ * 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;
+
+ /** Creates an instance of OperationInner class. */
+ public OperationInner() {
+ }
+
+ /**
+ * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for ARM/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Get the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Localized display information for this particular operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ public Origin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
+ * only APIs.
+ *
+ * @return the actionType value.
+ */
+ public ActionType actionType() {
+ return this.actionType;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OrganizationProperties.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OrganizationProperties.java
new file mode 100644
index 000000000000..a61147db87a4
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OrganizationProperties.java
@@ -0,0 +1,103 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.BillingSource;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Details of Organizations. */
+@Fluent
+public final class OrganizationProperties {
+ /*
+ * organization id
+ */
+ @JsonProperty(value = "organizationId")
+ private String organizationId;
+
+ /*
+ * organization name
+ */
+ @JsonProperty(value = "organizationName")
+ private String organizationName;
+
+ /*
+ * Billing source
+ */
+ @JsonProperty(value = "billingSource")
+ private BillingSource billingSource;
+
+ /** Creates an instance of OrganizationProperties class. */
+ public OrganizationProperties() {
+ }
+
+ /**
+ * Get the organizationId property: organization id.
+ *
+ * @return the organizationId value.
+ */
+ public String organizationId() {
+ return this.organizationId;
+ }
+
+ /**
+ * Set the organizationId property: organization id.
+ *
+ * @param organizationId the organizationId value to set.
+ * @return the OrganizationProperties object itself.
+ */
+ public OrganizationProperties withOrganizationId(String organizationId) {
+ this.organizationId = organizationId;
+ return this;
+ }
+
+ /**
+ * Get the organizationName property: organization name.
+ *
+ * @return the organizationName value.
+ */
+ public String organizationName() {
+ return this.organizationName;
+ }
+
+ /**
+ * Set the organizationName property: organization name.
+ *
+ * @param organizationName the organizationName value to set.
+ * @return the OrganizationProperties object itself.
+ */
+ public OrganizationProperties withOrganizationName(String organizationName) {
+ this.organizationName = organizationName;
+ return this;
+ }
+
+ /**
+ * Get the billingSource property: Billing source.
+ *
+ * @return the billingSource value.
+ */
+ public BillingSource billingSource() {
+ return this.billingSource;
+ }
+
+ /**
+ * Set the billingSource property: Billing source.
+ *
+ * @param billingSource the billingSource value to set.
+ * @return the OrganizationProperties object itself.
+ */
+ public OrganizationProperties withBillingSource(BillingSource billingSource) {
+ this.billingSource = billingSource;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OrganizationResourceInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OrganizationResourceInner.java
new file mode 100644
index 000000000000..a23877d73a53
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/OrganizationResourceInner.java
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.newrelic.models.BillingSource;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The details of a Organization resource. */
+@Fluent
+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;
+
+ /** Creates an instance of OrganizationResourceInner class. */
+ public OrganizationResourceInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private OrganizationProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the organizationId property: organization id.
+ *
+ * @return the organizationId value.
+ */
+ public String organizationId() {
+ return this.innerProperties() == null ? null : this.innerProperties().organizationId();
+ }
+
+ /**
+ * Set the organizationId property: organization id.
+ *
+ * @param organizationId the organizationId value to set.
+ * @return the OrganizationResourceInner object itself.
+ */
+ public OrganizationResourceInner withOrganizationId(String organizationId) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new OrganizationProperties();
+ }
+ this.innerProperties().withOrganizationId(organizationId);
+ return this;
+ }
+
+ /**
+ * Get the organizationName property: organization name.
+ *
+ * @return the organizationName value.
+ */
+ public String organizationName() {
+ return this.innerProperties() == null ? null : this.innerProperties().organizationName();
+ }
+
+ /**
+ * Set the organizationName property: organization name.
+ *
+ * @param organizationName the organizationName value to set.
+ * @return the OrganizationResourceInner object itself.
+ */
+ public OrganizationResourceInner withOrganizationName(String organizationName) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new OrganizationProperties();
+ }
+ this.innerProperties().withOrganizationName(organizationName);
+ return this;
+ }
+
+ /**
+ * Get the billingSource property: Billing source.
+ *
+ * @return the billingSource value.
+ */
+ public BillingSource billingSource() {
+ return this.innerProperties() == null ? null : this.innerProperties().billingSource();
+ }
+
+ /**
+ * Set the billingSource property: Billing source.
+ *
+ * @param billingSource the billingSource value to set.
+ * @return the OrganizationResourceInner object itself.
+ */
+ public OrganizationResourceInner withBillingSource(BillingSource billingSource) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new OrganizationProperties();
+ }
+ this.innerProperties().withBillingSource(billingSource);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/PlanDataProperties.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/PlanDataProperties.java
new file mode 100644
index 000000000000..d35620d2ed25
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/PlanDataProperties.java
@@ -0,0 +1,108 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.AccountCreationSource;
+import com.azure.resourcemanager.newrelic.models.OrgCreationSource;
+import com.azure.resourcemanager.newrelic.models.PlanData;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Plan details. */
+@Fluent
+public final class PlanDataProperties {
+ /*
+ * 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;
+
+ /** Creates an instance of PlanDataProperties class. */
+ public PlanDataProperties() {
+ }
+
+ /**
+ * Get the planData property: Plan details.
+ *
+ * @return the planData value.
+ */
+ public PlanData planData() {
+ return this.planData;
+ }
+
+ /**
+ * Set the planData property: Plan details.
+ *
+ * @param planData the planData value to set.
+ * @return the PlanDataProperties object itself.
+ */
+ public PlanDataProperties withPlanData(PlanData planData) {
+ this.planData = planData;
+ return this;
+ }
+
+ /**
+ * Get the orgCreationSource property: Source of org creation.
+ *
+ * @return the orgCreationSource value.
+ */
+ public OrgCreationSource orgCreationSource() {
+ return this.orgCreationSource;
+ }
+
+ /**
+ * Set the orgCreationSource property: Source of org creation.
+ *
+ * @param orgCreationSource the orgCreationSource value to set.
+ * @return the PlanDataProperties object itself.
+ */
+ public PlanDataProperties withOrgCreationSource(OrgCreationSource orgCreationSource) {
+ this.orgCreationSource = orgCreationSource;
+ return this;
+ }
+
+ /**
+ * Get the accountCreationSource property: Source of account creation.
+ *
+ * @return the accountCreationSource value.
+ */
+ public AccountCreationSource accountCreationSource() {
+ return this.accountCreationSource;
+ }
+
+ /**
+ * Set the accountCreationSource property: Source of account creation.
+ *
+ * @param accountCreationSource the accountCreationSource value to set.
+ * @return the PlanDataProperties object itself.
+ */
+ public PlanDataProperties withAccountCreationSource(AccountCreationSource accountCreationSource) {
+ this.accountCreationSource = accountCreationSource;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (planData() != null) {
+ planData().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/PlanDataResourceInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/PlanDataResourceInner.java
new file mode 100644
index 000000000000..140b16067b6f
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/PlanDataResourceInner.java
@@ -0,0 +1,131 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.newrelic.models.AccountCreationSource;
+import com.azure.resourcemanager.newrelic.models.OrgCreationSource;
+import com.azure.resourcemanager.newrelic.models.PlanData;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The details of a PlanData resource. */
+@Fluent
+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;
+
+ /** Creates an instance of PlanDataResourceInner class. */
+ public PlanDataResourceInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private PlanDataProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the planData property: Plan details.
+ *
+ * @return the planData value.
+ */
+ public PlanData planData() {
+ return this.innerProperties() == null ? null : this.innerProperties().planData();
+ }
+
+ /**
+ * Set the planData property: Plan details.
+ *
+ * @param planData the planData value to set.
+ * @return the PlanDataResourceInner object itself.
+ */
+ public PlanDataResourceInner withPlanData(PlanData planData) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PlanDataProperties();
+ }
+ this.innerProperties().withPlanData(planData);
+ return this;
+ }
+
+ /**
+ * Get the orgCreationSource property: Source of org creation.
+ *
+ * @return the orgCreationSource value.
+ */
+ public OrgCreationSource orgCreationSource() {
+ return this.innerProperties() == null ? null : this.innerProperties().orgCreationSource();
+ }
+
+ /**
+ * Set the orgCreationSource property: Source of org creation.
+ *
+ * @param orgCreationSource the orgCreationSource value to set.
+ * @return the PlanDataResourceInner object itself.
+ */
+ public PlanDataResourceInner withOrgCreationSource(OrgCreationSource orgCreationSource) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PlanDataProperties();
+ }
+ this.innerProperties().withOrgCreationSource(orgCreationSource);
+ return this;
+ }
+
+ /**
+ * Get the accountCreationSource property: Source of account creation.
+ *
+ * @return the accountCreationSource value.
+ */
+ public AccountCreationSource accountCreationSource() {
+ return this.innerProperties() == null ? null : this.innerProperties().accountCreationSource();
+ }
+
+ /**
+ * Set the accountCreationSource property: Source of account creation.
+ *
+ * @param accountCreationSource the accountCreationSource value to set.
+ * @return the PlanDataResourceInner object itself.
+ */
+ public PlanDataResourceInner withAccountCreationSource(AccountCreationSource accountCreationSource) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PlanDataProperties();
+ }
+ this.innerProperties().withAccountCreationSource(accountCreationSource);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleInner.java
new file mode 100644
index 000000000000..193160eed329
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleInner.java
@@ -0,0 +1,123 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.newrelic.models.LogRules;
+import com.azure.resourcemanager.newrelic.models.ProvisioningState;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** A tag rule belonging to NewRelic account. */
+@Fluent
+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;
+
+ /** Creates an instance of TagRuleInner class. */
+ public TagRuleInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private MonitoringTagRulesPropertiesInner innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the provisioningState property: Provisioning State of the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the logRules property: Set of rules for sending logs for the Monitor resource.
+ *
+ * @return the logRules value.
+ */
+ public LogRules logRules() {
+ return this.innerProperties() == null ? null : this.innerProperties().logRules();
+ }
+
+ /**
+ * Set the logRules property: Set of rules for sending logs for the Monitor resource.
+ *
+ * @param logRules the logRules value to set.
+ * @return the TagRuleInner object itself.
+ */
+ public TagRuleInner withLogRules(LogRules logRules) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MonitoringTagRulesPropertiesInner();
+ }
+ this.innerProperties().withLogRules(logRules);
+ return this;
+ }
+
+ /**
+ * Get the metricRules property: Set of rules for sending metrics for the Monitor resource.
+ *
+ * @return the metricRules value.
+ */
+ public MetricRulesInner metricRules() {
+ return this.innerProperties() == null ? null : this.innerProperties().metricRules();
+ }
+
+ /**
+ * Set the metricRules property: Set of rules for sending metrics for the Monitor resource.
+ *
+ * @param metricRules the metricRules value to set.
+ * @return the TagRuleInner object itself.
+ */
+ public TagRuleInner withMetricRules(MetricRulesInner metricRules) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new MonitoringTagRulesPropertiesInner();
+ }
+ this.innerProperties().withMetricRules(metricRules);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property innerProperties in model TagRuleInner"));
+ } else {
+ innerProperties().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(TagRuleInner.class);
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleUpdateInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleUpdateInner.java
new file mode 100644
index 000000000000..f93fe77341ec
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleUpdateInner.java
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.LogRules;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The type used for update operations of the TagRule. */
+@Fluent
+public final class TagRuleUpdateInner {
+ /*
+ * The updatable properties of the TagRule.
+ */
+ @JsonProperty(value = "properties")
+ private TagRuleUpdatePropertiesInner innerProperties;
+
+ /** Creates an instance of TagRuleUpdateInner class. */
+ public TagRuleUpdateInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The updatable properties of the TagRule.
+ *
+ * @return the innerProperties value.
+ */
+ private TagRuleUpdatePropertiesInner innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the logRules property: Set of rules for sending logs for the Monitor resource.
+ *
+ * @return the logRules value.
+ */
+ public LogRules logRules() {
+ return this.innerProperties() == null ? null : this.innerProperties().logRules();
+ }
+
+ /**
+ * Set the logRules property: Set of rules for sending logs for the Monitor resource.
+ *
+ * @param logRules the logRules value to set.
+ * @return the TagRuleUpdateInner object itself.
+ */
+ public TagRuleUpdateInner withLogRules(LogRules logRules) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new TagRuleUpdatePropertiesInner();
+ }
+ this.innerProperties().withLogRules(logRules);
+ return this;
+ }
+
+ /**
+ * Get the metricRules property: Set of rules for sending metrics for the Monitor resource.
+ *
+ * @return the metricRules value.
+ */
+ public MetricRulesInner metricRules() {
+ return this.innerProperties() == null ? null : this.innerProperties().metricRules();
+ }
+
+ /**
+ * Set the metricRules property: Set of rules for sending metrics for the Monitor resource.
+ *
+ * @param metricRules the metricRules value to set.
+ * @return the TagRuleUpdateInner object itself.
+ */
+ public TagRuleUpdateInner withMetricRules(MetricRulesInner metricRules) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new TagRuleUpdatePropertiesInner();
+ }
+ this.innerProperties().withMetricRules(metricRules);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleUpdatePropertiesInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleUpdatePropertiesInner.java
new file mode 100644
index 000000000000..ab54e14f51f4
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/TagRuleUpdatePropertiesInner.java
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.newrelic.models.LogRules;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The updatable properties of the TagRule. */
+@Fluent
+public final class TagRuleUpdatePropertiesInner {
+ /*
+ * 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;
+
+ /** Creates an instance of TagRuleUpdatePropertiesInner class. */
+ public TagRuleUpdatePropertiesInner() {
+ }
+
+ /**
+ * Get the logRules property: Set of rules for sending logs for the Monitor resource.
+ *
+ * @return the logRules value.
+ */
+ public LogRules logRules() {
+ return this.logRules;
+ }
+
+ /**
+ * Set the logRules property: Set of rules for sending logs for the Monitor resource.
+ *
+ * @param logRules the logRules value to set.
+ * @return the TagRuleUpdatePropertiesInner object itself.
+ */
+ public TagRuleUpdatePropertiesInner withLogRules(LogRules logRules) {
+ this.logRules = logRules;
+ return this;
+ }
+
+ /**
+ * Get the metricRules property: Set of rules for sending metrics for the Monitor resource.
+ *
+ * @return the metricRules value.
+ */
+ public MetricRulesInner metricRules() {
+ return this.metricRules;
+ }
+
+ /**
+ * Set the metricRules property: Set of rules for sending metrics for the Monitor resource.
+ *
+ * @param metricRules the metricRules value to set.
+ * @return the TagRuleUpdatePropertiesInner object itself.
+ */
+ public TagRuleUpdatePropertiesInner withMetricRules(MetricRulesInner metricRules) {
+ this.metricRules = metricRules;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (logRules() != null) {
+ logRules().validate();
+ }
+ if (metricRules() != null) {
+ metricRules().validate();
+ }
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/VMExtensionPayloadInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/VMExtensionPayloadInner.java
new file mode 100644
index 000000000000..e43a6ac85013
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/VMExtensionPayloadInner.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Response of payload to be passed while installing VM agent. */
+@Fluent
+public final class VMExtensionPayloadInner {
+ /*
+ * Ingestion key of the account
+ */
+ @JsonProperty(value = "ingestionKey")
+ private String ingestionKey;
+
+ /** Creates an instance of VMExtensionPayloadInner class. */
+ public VMExtensionPayloadInner() {
+ }
+
+ /**
+ * Get the ingestionKey property: Ingestion key of the account.
+ *
+ * @return the ingestionKey value.
+ */
+ public String ingestionKey() {
+ return this.ingestionKey;
+ }
+
+ /**
+ * Set the ingestionKey property: Ingestion key of the account.
+ *
+ * @param ingestionKey the ingestionKey value to set.
+ * @return the VMExtensionPayloadInner object itself.
+ */
+ public VMExtensionPayloadInner withIngestionKey(String ingestionKey) {
+ this.ingestionKey = ingestionKey;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/VMInfoInner.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/VMInfoInner.java
new file mode 100644
index 000000000000..800456201043
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/VMInfoInner.java
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Details of VM Resource having NewRelic OneAgent installed. */
+@Fluent
+public final class VMInfoInner {
+ /*
+ * 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;
+
+ /** Creates an instance of VMInfoInner class. */
+ public VMInfoInner() {
+ }
+
+ /**
+ * Get the vmId property: Azure VM resource ID.
+ *
+ * @return the vmId value.
+ */
+ public String vmId() {
+ return this.vmId;
+ }
+
+ /**
+ * Set the vmId property: Azure VM resource ID.
+ *
+ * @param vmId the vmId value to set.
+ * @return the VMInfoInner object itself.
+ */
+ public VMInfoInner withVmId(String vmId) {
+ this.vmId = vmId;
+ return this;
+ }
+
+ /**
+ * Get the agentVersion property: Version of the NewRelic agent installed on the VM.
+ *
+ * @return the agentVersion value.
+ */
+ public String agentVersion() {
+ return this.agentVersion;
+ }
+
+ /**
+ * Set the agentVersion property: Version of the NewRelic agent installed on the VM.
+ *
+ * @param agentVersion the agentVersion value to set.
+ * @return the VMInfoInner object itself.
+ */
+ public VMInfoInner withAgentVersion(String agentVersion) {
+ this.agentVersion = agentVersion;
+ return this;
+ }
+
+ /**
+ * Get the agentStatus property: Status of the NewRelic agent installed on the VM.
+ *
+ * @return the agentStatus value.
+ */
+ public String agentStatus() {
+ return this.agentStatus;
+ }
+
+ /**
+ * Set the agentStatus property: Status of the NewRelic agent installed on the VM.
+ *
+ * @param agentStatus the agentStatus value to set.
+ * @return the VMInfoInner object itself.
+ */
+ public VMInfoInner withAgentStatus(String agentStatus) {
+ this.agentStatus = agentStatus;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/package-info.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/package-info.java
new file mode 100644
index 000000000000..4fa49947c0d5
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/models/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the inner data models for NewRelicObservability. null. */
+package com.azure.resourcemanager.newrelic.fluent.models;
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/package-info.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/package-info.java
new file mode 100644
index 000000000000..5af6b7519572
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/fluent/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the service clients for NewRelicObservability. null. */
+package com.azure.resourcemanager.newrelic.fluent;
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountResourceImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountResourceImpl.java
new file mode 100644
index 000000000000..ac6a149d97de
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountResourceImpl.java
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.newrelic.fluent.models.AccountResourceInner;
+import com.azure.resourcemanager.newrelic.models.AccountResource;
+
+public final class AccountResourceImpl implements AccountResource {
+ private AccountResourceInner innerObject;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ AccountResourceImpl(
+ AccountResourceInner innerObject, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String organizationId() {
+ return this.innerModel().organizationId();
+ }
+
+ public String accountId() {
+ return this.innerModel().accountId();
+ }
+
+ public String accountName() {
+ return this.innerModel().accountName();
+ }
+
+ public String region() {
+ return this.innerModel().region();
+ }
+
+ public AccountResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountsClientImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountsClientImpl.java
new file mode 100644
index 000000000000..8e3d12eade3b
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountsClientImpl.java
@@ -0,0 +1,332 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.newrelic.fluent.AccountsClient;
+import com.azure.resourcemanager.newrelic.fluent.models.AccountResourceInner;
+import com.azure.resourcemanager.newrelic.models.AccountsListResponse;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in AccountsClient. */
+public final class AccountsClientImpl implements AccountsClient {
+ /** The proxy service used to perform REST calls. */
+ private final AccountsService service;
+
+ /** The service client containing this operation class. */
+ private final NewRelicObservabilityImpl client;
+
+ /**
+ * Initializes an instance of AccountsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ AccountsClientImpl(NewRelicObservabilityImpl client) {
+ this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for NewRelicObservabilityAccounts to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "NewRelicObservabilit")
+ public interface AccountsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/accounts")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("userEmail") String userEmail,
+ @QueryParam("location") String location,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * List all the existing accounts.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String userEmail, String location) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (userEmail == null) {
+ return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null."));
+ }
+ if (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ userEmail,
+ location,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List all the existing accounts.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String userEmail, String location, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (userEmail == null) {
+ return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null."));
+ }
+ if (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ userEmail,
+ location,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List all the existing accounts.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String userEmail, String location) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(userEmail, location), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the existing accounts.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String userEmail, String location, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(userEmail, location, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List all the existing accounts.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String userEmail, String location) {
+ return new PagedIterable<>(listAsync(userEmail, location));
+ }
+
+ /**
+ * List all the existing accounts.
+ *
+ * @param userEmail User Email.
+ * @param location Location for NewRelic.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String userEmail, String location, Context context) {
+ return new PagedIterable<>(listAsync(userEmail, location, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of get all accounts Operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountsImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountsImpl.java
new file mode 100644
index 000000000000..f5b31fc40542
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AccountsImpl.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.newrelic.fluent.AccountsClient;
+import com.azure.resourcemanager.newrelic.fluent.models.AccountResourceInner;
+import com.azure.resourcemanager.newrelic.models.AccountResource;
+import com.azure.resourcemanager.newrelic.models.Accounts;
+
+public final class AccountsImpl implements Accounts {
+ private static final ClientLogger LOGGER = new ClientLogger(AccountsImpl.class);
+
+ private final AccountsClient innerClient;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ public AccountsImpl(AccountsClient innerClient, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String userEmail, String location) {
+ PagedIterable inner = this.serviceClient().list(userEmail, location);
+ return Utils.mapPage(inner, inner1 -> new AccountResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String userEmail, String location, Context context) {
+ PagedIterable inner = this.serviceClient().list(userEmail, location, context);
+ return Utils.mapPage(inner, inner1 -> new AccountResourceImpl(inner1, this.manager()));
+ }
+
+ private AccountsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AppServiceInfoImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AppServiceInfoImpl.java
new file mode 100644
index 000000000000..560bea515a3e
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/AppServiceInfoImpl.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.resourcemanager.newrelic.fluent.models.AppServiceInfoInner;
+import com.azure.resourcemanager.newrelic.models.AppServiceInfo;
+
+public final class AppServiceInfoImpl implements AppServiceInfo {
+ private AppServiceInfoInner innerObject;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ AppServiceInfoImpl(
+ AppServiceInfoInner innerObject, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String azureResourceId() {
+ return this.innerModel().azureResourceId();
+ }
+
+ public String agentVersion() {
+ return this.innerModel().agentVersion();
+ }
+
+ public String agentStatus() {
+ return this.innerModel().agentStatus();
+ }
+
+ public AppServiceInfoInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MetricRulesImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MetricRulesImpl.java
new file mode 100644
index 000000000000..8592f3ba2a7b
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MetricRulesImpl.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.resourcemanager.newrelic.fluent.models.MetricRulesInner;
+import com.azure.resourcemanager.newrelic.models.FilteringTag;
+import com.azure.resourcemanager.newrelic.models.MetricRules;
+import com.azure.resourcemanager.newrelic.models.SendMetricsStatus;
+import java.util.Collections;
+import java.util.List;
+
+public final class MetricRulesImpl implements MetricRules {
+ private MetricRulesInner innerObject;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ MetricRulesImpl(MetricRulesInner innerObject, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public SendMetricsStatus sendMetrics() {
+ return this.innerModel().sendMetrics();
+ }
+
+ public List filteringTags() {
+ List inner = this.innerModel().filteringTags();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public String userEmail() {
+ return this.innerModel().userEmail();
+ }
+
+ public MetricRulesInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MetricsStatusResponseImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MetricsStatusResponseImpl.java
new file mode 100644
index 000000000000..ce68c2e46990
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MetricsStatusResponseImpl.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.resourcemanager.newrelic.fluent.models.MetricsStatusResponseInner;
+import com.azure.resourcemanager.newrelic.models.MetricsStatusResponse;
+import java.util.Collections;
+import java.util.List;
+
+public final class MetricsStatusResponseImpl implements MetricsStatusResponse {
+ private MetricsStatusResponseInner innerObject;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ MetricsStatusResponseImpl(
+ MetricsStatusResponseInner innerObject, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public List azureResourceIds() {
+ List inner = this.innerModel().azureResourceIds();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public MetricsStatusResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitoredResourceImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitoredResourceImpl.java
new file mode 100644
index 000000000000..485ed23e56fc
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitoredResourceImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.resourcemanager.newrelic.fluent.models.MonitoredResourceInner;
+import com.azure.resourcemanager.newrelic.models.MonitoredResource;
+import com.azure.resourcemanager.newrelic.models.SendingLogsStatus;
+import com.azure.resourcemanager.newrelic.models.SendingMetricsStatus;
+
+public final class MonitoredResourceImpl implements MonitoredResource {
+ private MonitoredResourceInner innerObject;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ MonitoredResourceImpl(
+ MonitoredResourceInner innerObject, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public SendingMetricsStatus sendingMetrics() {
+ return this.innerModel().sendingMetrics();
+ }
+
+ public String reasonForMetricsStatus() {
+ return this.innerModel().reasonForMetricsStatus();
+ }
+
+ public SendingLogsStatus sendingLogs() {
+ return this.innerModel().sendingLogs();
+ }
+
+ public String reasonForLogsStatus() {
+ return this.innerModel().reasonForLogsStatus();
+ }
+
+ public MonitoredResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitoringTagRulesPropertiesImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitoringTagRulesPropertiesImpl.java
new file mode 100644
index 000000000000..82744be91fbe
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitoringTagRulesPropertiesImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.resourcemanager.newrelic.fluent.models.MetricRulesInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MonitoringTagRulesPropertiesInner;
+import com.azure.resourcemanager.newrelic.models.LogRules;
+import com.azure.resourcemanager.newrelic.models.MetricRules;
+import com.azure.resourcemanager.newrelic.models.MonitoringTagRulesProperties;
+import com.azure.resourcemanager.newrelic.models.ProvisioningState;
+
+public final class MonitoringTagRulesPropertiesImpl implements MonitoringTagRulesProperties {
+ private MonitoringTagRulesPropertiesInner innerObject;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ MonitoringTagRulesPropertiesImpl(
+ MonitoringTagRulesPropertiesInner innerObject,
+ com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public LogRules logRules() {
+ return this.innerModel().logRules();
+ }
+
+ public MetricRules metricRules() {
+ MetricRulesInner inner = this.innerModel().metricRules();
+ if (inner != null) {
+ return new MetricRulesImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public MonitoringTagRulesPropertiesInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitorsClientImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitorsClientImpl.java
new file mode 100644
index 000000000000..34de6556afbd
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitorsClientImpl.java
@@ -0,0 +1,3064 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.newrelic.fluent.MonitorsClient;
+import com.azure.resourcemanager.newrelic.fluent.models.AppServiceInfoInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MetricRulesInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MetricsStatusResponseInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MonitoredResourceInner;
+import com.azure.resourcemanager.newrelic.fluent.models.NewRelicMonitorResourceInner;
+import com.azure.resourcemanager.newrelic.fluent.models.VMExtensionPayloadInner;
+import com.azure.resourcemanager.newrelic.fluent.models.VMInfoInner;
+import com.azure.resourcemanager.newrelic.models.AppServicesGetRequest;
+import com.azure.resourcemanager.newrelic.models.AppServicesListResponse;
+import com.azure.resourcemanager.newrelic.models.HostsGetRequest;
+import com.azure.resourcemanager.newrelic.models.MetricsRequest;
+import com.azure.resourcemanager.newrelic.models.MetricsStatusRequest;
+import com.azure.resourcemanager.newrelic.models.MonitoredResourceListResponse;
+import com.azure.resourcemanager.newrelic.models.NewRelicMonitorResourceListResult;
+import com.azure.resourcemanager.newrelic.models.NewRelicMonitorResourceUpdate;
+import com.azure.resourcemanager.newrelic.models.SwitchBillingRequest;
+import com.azure.resourcemanager.newrelic.models.VMHostsListResponse;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in MonitorsClient. */
+public final class MonitorsClientImpl implements MonitorsClient {
+ /** The proxy service used to perform REST calls. */
+ private final MonitorsService service;
+
+ /** The service client containing this operation class. */
+ private final NewRelicObservabilityImpl client;
+
+ /**
+ * Initializes an instance of MonitorsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ MonitorsClientImpl(NewRelicObservabilityImpl client) {
+ this.service = RestProxy.create(MonitorsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for NewRelicObservabilityMonitors to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "NewRelicObservabilit")
+ public interface MonitorsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/NewRelic.Observability/monitors")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @BodyParam("application/json") NewRelicMonitorResourceInner resource,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @BodyParam("application/json") NewRelicMonitorResourceUpdate properties,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("userEmail") String userEmail,
+ @PathParam("monitorName") String monitorName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}/getMetricRules")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getMetricRules(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @BodyParam("application/json") MetricsRequest request,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}/getMetricStatus")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getMetricStatus(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @BodyParam("application/json") MetricsStatusRequest request,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}/listAppServices")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAppServices(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @BodyParam("application/json") AppServicesGetRequest request,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}/switchBilling")
+ @ExpectedResponses({204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> switchBilling(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @BodyParam("application/json") SwitchBillingRequest request,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}/listHosts")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listHosts(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @BodyParam("application/json") HostsGetRequest request,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}/monitoredResources")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listMonitoredResources(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability"
+ + "/monitors/{monitorName}/vmHostPayloads")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> vmHostPayload(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("monitorName") String monitorName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAppServicesNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listHostsNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listMonitoredResourcesNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by subscription ID.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by subscription ID.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by subscription ID.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(
+ String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * List NewRelicMonitorResource resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Get a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a NewRelicMonitorResource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String monitorName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a NewRelicMonitorResource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String monitorName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ accept,
+ context);
+ }
+
+ /**
+ * Get a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a NewRelicMonitorResource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String monitorName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a NewRelicMonitorResource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String monitorName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, monitorName, context).block();
+ }
+
+ /**
+ * Get a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a NewRelicMonitorResource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public NewRelicMonitorResourceInner getByResourceGroup(String resourceGroupName, String monitorName) {
+ return getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ resource,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ resource,
+ accept,
+ context);
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, NewRelicMonitorResourceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ NewRelicMonitorResourceInner.class,
+ NewRelicMonitorResourceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, NewRelicMonitorResourceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, monitorName, resource, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ NewRelicMonitorResourceInner.class,
+ NewRelicMonitorResourceInner.class,
+ context);
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, NewRelicMonitorResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, NewRelicMonitorResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource, context).getSyncPoller();
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, monitorName, resource, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public NewRelicMonitorResourceInner createOrUpdate(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource) {
+ return createOrUpdateAsync(resourceGroupName, monitorName, resource).block();
+ }
+
+ /**
+ * Create a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public NewRelicMonitorResourceInner createOrUpdate(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceInner resource, Context context) {
+ return createOrUpdateAsync(resourceGroupName, monitorName, resource, context).block();
+ }
+
+ /**
+ * Update a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ properties,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ properties,
+ accept,
+ context);
+ }
+
+ /**
+ * Update a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties) {
+ return updateWithResponseAsync(resourceGroupName, monitorName, properties)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Update a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties, Context context) {
+ return updateWithResponseAsync(resourceGroupName, monitorName, properties, context).block();
+ }
+
+ /**
+ * Update a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Monitor Resource by NewRelic.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public NewRelicMonitorResourceInner update(
+ String resourceGroupName, String monitorName, NewRelicMonitorResourceUpdate properties) {
+ return updateWithResponse(resourceGroupName, monitorName, properties, Context.NONE).getValue();
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String userEmail, String monitorName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (userEmail == null) {
+ return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ userEmail,
+ monitorName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String userEmail, String monitorName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (userEmail == null) {
+ return Mono.error(new IllegalArgumentException("Parameter userEmail is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ userEmail,
+ monitorName,
+ accept,
+ context);
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String userEmail, String monitorName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, userEmail, monitorName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String userEmail, String monitorName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, userEmail, monitorName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String userEmail, String monitorName) {
+ return this.beginDeleteAsync(resourceGroupName, userEmail, monitorName).getSyncPoller();
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String userEmail, String monitorName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, userEmail, monitorName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String userEmail, String monitorName) {
+ return beginDeleteAsync(resourceGroupName, userEmail, monitorName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String userEmail, String monitorName, Context context) {
+ return beginDeleteAsync(resourceGroupName, userEmail, monitorName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String userEmail, String monitorName) {
+ deleteAsync(resourceGroupName, userEmail, monitorName).block();
+ }
+
+ /**
+ * Delete a NewRelicMonitorResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param userEmail User Email.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String userEmail, String monitorName, Context context) {
+ deleteAsync(resourceGroupName, userEmail, monitorName, context).block();
+ }
+
+ /**
+ * Get metric rules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric rules along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getMetricRulesWithResponseAsync(
+ String resourceGroupName, String monitorName, MetricsRequest request) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getMetricRules(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get metric rules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric rules along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getMetricRulesWithResponseAsync(
+ String resourceGroupName, String monitorName, MetricsRequest request, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getMetricRules(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context);
+ }
+
+ /**
+ * Get metric rules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric rules on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getMetricRulesAsync(
+ String resourceGroupName, String monitorName, MetricsRequest request) {
+ return getMetricRulesWithResponseAsync(resourceGroupName, monitorName, request)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get metric rules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric rules along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getMetricRulesWithResponse(
+ String resourceGroupName, String monitorName, MetricsRequest request, Context context) {
+ return getMetricRulesWithResponseAsync(resourceGroupName, monitorName, request, context).block();
+ }
+
+ /**
+ * Get metric rules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric rules.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MetricRulesInner getMetricRules(String resourceGroupName, String monitorName, MetricsRequest request) {
+ return getMetricRulesWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue();
+ }
+
+ /**
+ * Get metric status.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric status along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getMetricStatusWithResponseAsync(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getMetricStatus(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get metric status.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric status along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getMetricStatusWithResponseAsync(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getMetricStatus(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context);
+ }
+
+ /**
+ * Get metric status.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric status on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getMetricStatusAsync(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request) {
+ return getMetricStatusWithResponseAsync(resourceGroupName, monitorName, request)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get metric status.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric status along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getMetricStatusWithResponse(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context) {
+ return getMetricStatusWithResponseAsync(resourceGroupName, monitorName, request, context).block();
+ }
+
+ /**
+ * Get metric status.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the get metrics status request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return metric status.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MetricsStatusResponseInner getMetricStatus(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request) {
+ return getMetricStatusWithResponse(resourceGroupName, monitorName, request, Context.NONE).getValue();
+ }
+
+ /**
+ * List the app service resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the app services get request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listAppServicesSinglePageAsync(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listAppServices(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the app service resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the app services get request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listAppServicesSinglePageAsync(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listAppServices(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List the app service resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the app services get request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAppServicesAsync(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request) {
+ return new PagedFlux<>(
+ () -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request),
+ nextLink -> listAppServicesNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the app service resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the app services get request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAppServicesAsync(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context) {
+ return new PagedFlux<>(
+ () -> listAppServicesSinglePageAsync(resourceGroupName, monitorName, request, context),
+ nextLink -> listAppServicesNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the app service resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the app services get request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAppServices(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request) {
+ return new PagedIterable<>(listAppServicesAsync(resourceGroupName, monitorName, request));
+ }
+
+ /**
+ * List the app service resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the app services get request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAppServices(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context) {
+ return new PagedIterable<>(listAppServicesAsync(resourceGroupName, monitorName, request, context));
+ }
+
+ /**
+ * Switches the billing for NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the switch billing request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> switchBillingWithResponseAsync(
+ String resourceGroupName, String monitorName, SwitchBillingRequest request) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .switchBilling(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Switches the billing for NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the switch billing request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> switchBillingWithResponseAsync(
+ String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .switchBilling(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context);
+ }
+
+ /**
+ * Switches the billing for NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the switch billing request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono switchBillingAsync(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
+ return switchBillingWithResponseAsync(resourceGroupName, monitorName, request).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Switches the billing for NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the switch billing request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response switchBillingWithResponse(
+ String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
+ return switchBillingWithResponseAsync(resourceGroupName, monitorName, request, context).block();
+ }
+
+ /**
+ * Switches the billing for NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the switch billing request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
+ switchBillingWithResponse(resourceGroupName, monitorName, request, Context.NONE);
+ }
+
+ /**
+ * List the compute vm resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the Hosts get request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listHostsSinglePageAsync(
+ String resourceGroupName, String monitorName, HostsGetRequest request) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listHosts(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the compute vm resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the Hosts get request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listHostsSinglePageAsync(
+ String resourceGroupName, String monitorName, HostsGetRequest request, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ if (request == null) {
+ return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
+ } else {
+ request.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listHosts(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ request,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List the compute vm resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the Hosts get request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listHostsAsync(
+ String resourceGroupName, String monitorName, HostsGetRequest request) {
+ return new PagedFlux<>(
+ () -> listHostsSinglePageAsync(resourceGroupName, monitorName, request),
+ nextLink -> listHostsNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the compute vm resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the Hosts get request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listHostsAsync(
+ String resourceGroupName, String monitorName, HostsGetRequest request, Context context) {
+ return new PagedFlux<>(
+ () -> listHostsSinglePageAsync(resourceGroupName, monitorName, request, context),
+ nextLink -> listHostsNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the compute vm resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the Hosts get request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) {
+ return new PagedIterable<>(listHostsAsync(resourceGroupName, monitorName, request));
+ }
+
+ /**
+ * List the compute vm resources currently being monitored by the NewRelic resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param request The details of the Hosts get request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listHosts(
+ String resourceGroupName, String monitorName, HostsGetRequest request, Context context) {
+ return new PagedIterable<>(listHostsAsync(resourceGroupName, monitorName, request, context));
+ }
+
+ /**
+ * List the resources currently being monitored by the NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listMonitoredResourcesSinglePageAsync(
+ String resourceGroupName, String monitorName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listMonitoredResources(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the resources currently being monitored by the NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listMonitoredResourcesSinglePageAsync(
+ String resourceGroupName, String monitorName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listMonitoredResources(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List the resources currently being monitored by the NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listMonitoredResourcesAsync(
+ String resourceGroupName, String monitorName) {
+ return new PagedFlux<>(
+ () -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName),
+ nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the resources currently being monitored by the NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listMonitoredResourcesAsync(
+ String resourceGroupName, String monitorName, Context context) {
+ return new PagedFlux<>(
+ () -> listMonitoredResourcesSinglePageAsync(resourceGroupName, monitorName, context),
+ nextLink -> listMonitoredResourcesNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the resources currently being monitored by the NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) {
+ return new PagedIterable<>(listMonitoredResourcesAsync(resourceGroupName, monitorName));
+ }
+
+ /**
+ * List the resources currently being monitored by the NewRelic monitor resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listMonitoredResources(
+ String resourceGroupName, String monitorName, Context context) {
+ return new PagedIterable<>(listMonitoredResourcesAsync(resourceGroupName, monitorName, context));
+ }
+
+ /**
+ * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of payload to be passed while installing VM agent along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> vmHostPayloadWithResponseAsync(
+ String resourceGroupName, String monitorName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .vmHostPayload(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of payload to be passed while installing VM agent along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> vmHostPayloadWithResponseAsync(
+ String resourceGroupName, String monitorName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (monitorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .vmHostPayload(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ monitorName,
+ accept,
+ context);
+ }
+
+ /**
+ * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of payload to be passed while installing VM agent on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono vmHostPayloadAsync(String resourceGroupName, String monitorName) {
+ return vmHostPayloadWithResponseAsync(resourceGroupName, monitorName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of payload to be passed while installing VM agent along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response vmHostPayloadWithResponse(
+ String resourceGroupName, String monitorName, Context context) {
+ return vmHostPayloadWithResponseAsync(resourceGroupName, monitorName, context).block();
+ }
+
+ /**
+ * Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param monitorName Name of the Monitors resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of payload to be passed while installing VM agent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public VMExtensionPayloadInner vmHostPayload(String resourceGroupName, String monitorName) {
+ return vmHostPayloadWithResponse(resourceGroupName, monitorName, Context.NONE).getValue();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a NewRelicMonitorResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listAppServicesNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listAppServicesNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list app services Operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listAppServicesNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listAppServicesNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listHostsNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listHostsNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response of a list VM Host Operation along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listHostsNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listHostsNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listMonitoredResourcesNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of all the resources being monitored by NewRelic monitor resource along with {@link PagedResponse}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listMonitoredResourcesNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listMonitoredResourcesNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitorsImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitorsImpl.java
new file mode 100644
index 000000000000..a52555879d4b
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/MonitorsImpl.java
@@ -0,0 +1,270 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.newrelic.fluent.MonitorsClient;
+import com.azure.resourcemanager.newrelic.fluent.models.AppServiceInfoInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MetricRulesInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MetricsStatusResponseInner;
+import com.azure.resourcemanager.newrelic.fluent.models.MonitoredResourceInner;
+import com.azure.resourcemanager.newrelic.fluent.models.NewRelicMonitorResourceInner;
+import com.azure.resourcemanager.newrelic.fluent.models.VMExtensionPayloadInner;
+import com.azure.resourcemanager.newrelic.fluent.models.VMInfoInner;
+import com.azure.resourcemanager.newrelic.models.AppServiceInfo;
+import com.azure.resourcemanager.newrelic.models.AppServicesGetRequest;
+import com.azure.resourcemanager.newrelic.models.HostsGetRequest;
+import com.azure.resourcemanager.newrelic.models.MetricRules;
+import com.azure.resourcemanager.newrelic.models.MetricsRequest;
+import com.azure.resourcemanager.newrelic.models.MetricsStatusRequest;
+import com.azure.resourcemanager.newrelic.models.MetricsStatusResponse;
+import com.azure.resourcemanager.newrelic.models.MonitoredResource;
+import com.azure.resourcemanager.newrelic.models.Monitors;
+import com.azure.resourcemanager.newrelic.models.NewRelicMonitorResource;
+import com.azure.resourcemanager.newrelic.models.SwitchBillingRequest;
+import com.azure.resourcemanager.newrelic.models.VMExtensionPayload;
+import com.azure.resourcemanager.newrelic.models.VMInfo;
+
+public final class MonitorsImpl implements Monitors {
+ private static final ClientLogger LOGGER = new ClientLogger(MonitorsImpl.class);
+
+ private final MonitorsClient innerClient;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ public MonitorsImpl(MonitorsClient innerClient, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new NewRelicMonitorResourceImpl(inner1, this.manager()));
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String monitorName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, monitorName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new NewRelicMonitorResourceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public NewRelicMonitorResource getByResourceGroup(String resourceGroupName, String monitorName) {
+ NewRelicMonitorResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, monitorName);
+ if (inner != null) {
+ return new NewRelicMonitorResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void delete(String resourceGroupName, String userEmail, String monitorName) {
+ this.serviceClient().delete(resourceGroupName, userEmail, monitorName);
+ }
+
+ public void delete(String resourceGroupName, String userEmail, String monitorName, Context context) {
+ this.serviceClient().delete(resourceGroupName, userEmail, monitorName, context);
+ }
+
+ public Response getMetricRulesWithResponse(
+ String resourceGroupName, String monitorName, MetricsRequest request, Context context) {
+ Response inner =
+ this.serviceClient().getMetricRulesWithResponse(resourceGroupName, monitorName, request, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new MetricRulesImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public MetricRules getMetricRules(String resourceGroupName, String monitorName, MetricsRequest request) {
+ MetricRulesInner inner = this.serviceClient().getMetricRules(resourceGroupName, monitorName, request);
+ if (inner != null) {
+ return new MetricRulesImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getMetricStatusWithResponse(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request, Context context) {
+ Response inner =
+ this.serviceClient().getMetricStatusWithResponse(resourceGroupName, monitorName, request, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new MetricsStatusResponseImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public MetricsStatusResponse getMetricStatus(
+ String resourceGroupName, String monitorName, MetricsStatusRequest request) {
+ MetricsStatusResponseInner inner =
+ this.serviceClient().getMetricStatus(resourceGroupName, monitorName, request);
+ if (inner != null) {
+ return new MetricsStatusResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public PagedIterable listAppServices(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request) {
+ PagedIterable inner =
+ this.serviceClient().listAppServices(resourceGroupName, monitorName, request);
+ return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listAppServices(
+ String resourceGroupName, String monitorName, AppServicesGetRequest request, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listAppServices(resourceGroupName, monitorName, request, context);
+ return Utils.mapPage(inner, inner1 -> new AppServiceInfoImpl(inner1, this.manager()));
+ }
+
+ public Response switchBillingWithResponse(
+ String resourceGroupName, String monitorName, SwitchBillingRequest request, Context context) {
+ return this.serviceClient().switchBillingWithResponse(resourceGroupName, monitorName, request, context);
+ }
+
+ public void switchBilling(String resourceGroupName, String monitorName, SwitchBillingRequest request) {
+ this.serviceClient().switchBilling(resourceGroupName, monitorName, request);
+ }
+
+ public PagedIterable listHosts(String resourceGroupName, String monitorName, HostsGetRequest request) {
+ PagedIterable inner = this.serviceClient().listHosts(resourceGroupName, monitorName, request);
+ return Utils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listHosts(
+ String resourceGroupName, String monitorName, HostsGetRequest request, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listHosts(resourceGroupName, monitorName, request, context);
+ return Utils.mapPage(inner, inner1 -> new VMInfoImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listMonitoredResources(String resourceGroupName, String monitorName) {
+ PagedIterable inner =
+ this.serviceClient().listMonitoredResources(resourceGroupName, monitorName);
+ return Utils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listMonitoredResources(
+ String resourceGroupName, String monitorName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listMonitoredResources(resourceGroupName, monitorName, context);
+ return Utils.mapPage(inner, inner1 -> new MonitoredResourceImpl(inner1, this.manager()));
+ }
+
+ public Response vmHostPayloadWithResponse(
+ String resourceGroupName, String monitorName, Context context) {
+ Response inner =
+ this.serviceClient().vmHostPayloadWithResponse(resourceGroupName, monitorName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new VMExtensionPayloadImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public VMExtensionPayload vmHostPayload(String resourceGroupName, String monitorName) {
+ VMExtensionPayloadInner inner = this.serviceClient().vmHostPayload(resourceGroupName, monitorName);
+ if (inner != null) {
+ return new VMExtensionPayloadImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public NewRelicMonitorResource getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String monitorName = Utils.getValueFromIdByName(id, "monitors");
+ if (monitorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String monitorName = Utils.getValueFromIdByName(id, "monitors");
+ if (monitorName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'monitors'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, monitorName, context);
+ }
+
+ private MonitorsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+
+ public NewRelicMonitorResourceImpl define(String name) {
+ return new NewRelicMonitorResourceImpl(name, this.manager());
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicMonitorResourceImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicMonitorResourceImpl.java
new file mode 100644
index 000000000000..6ed07166197f
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicMonitorResourceImpl.java
@@ -0,0 +1,370 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.newrelic.fluent.models.NewRelicMonitorResourceInner;
+import com.azure.resourcemanager.newrelic.models.AccountCreationSource;
+import com.azure.resourcemanager.newrelic.models.AppServiceInfo;
+import com.azure.resourcemanager.newrelic.models.AppServicesGetRequest;
+import com.azure.resourcemanager.newrelic.models.HostsGetRequest;
+import com.azure.resourcemanager.newrelic.models.LiftrResourceCategories;
+import com.azure.resourcemanager.newrelic.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.newrelic.models.MarketplaceSubscriptionStatus;
+import com.azure.resourcemanager.newrelic.models.MetricRules;
+import com.azure.resourcemanager.newrelic.models.MetricsRequest;
+import com.azure.resourcemanager.newrelic.models.MetricsStatusRequest;
+import com.azure.resourcemanager.newrelic.models.MetricsStatusResponse;
+import com.azure.resourcemanager.newrelic.models.MonitoredResource;
+import com.azure.resourcemanager.newrelic.models.MonitoringStatus;
+import com.azure.resourcemanager.newrelic.models.NewRelicAccountProperties;
+import com.azure.resourcemanager.newrelic.models.NewRelicMonitorResource;
+import com.azure.resourcemanager.newrelic.models.NewRelicMonitorResourceUpdate;
+import com.azure.resourcemanager.newrelic.models.OrgCreationSource;
+import com.azure.resourcemanager.newrelic.models.PlanData;
+import com.azure.resourcemanager.newrelic.models.ProvisioningState;
+import com.azure.resourcemanager.newrelic.models.SwitchBillingRequest;
+import com.azure.resourcemanager.newrelic.models.UserInfo;
+import com.azure.resourcemanager.newrelic.models.VMExtensionPayload;
+import com.azure.resourcemanager.newrelic.models.VMInfo;
+import java.util.Collections;
+import java.util.Map;
+
+public final class NewRelicMonitorResourceImpl
+ implements NewRelicMonitorResource, NewRelicMonitorResource.Definition, NewRelicMonitorResource.Update {
+ private NewRelicMonitorResourceInner innerObject;
+
+ private final com.azure.resourcemanager.newrelic.NewRelicManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public ManagedServiceIdentity identity() {
+ return this.innerModel().identity();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public MonitoringStatus monitoringStatus() {
+ return this.innerModel().monitoringStatus();
+ }
+
+ public MarketplaceSubscriptionStatus marketplaceSubscriptionStatus() {
+ return this.innerModel().marketplaceSubscriptionStatus();
+ }
+
+ public String marketplaceSubscriptionId() {
+ return this.innerModel().marketplaceSubscriptionId();
+ }
+
+ public NewRelicAccountProperties newRelicAccountProperties() {
+ return this.innerModel().newRelicAccountProperties();
+ }
+
+ public UserInfo userInfo() {
+ return this.innerModel().userInfo();
+ }
+
+ public PlanData planData() {
+ return this.innerModel().planData();
+ }
+
+ public LiftrResourceCategories liftrResourceCategory() {
+ return this.innerModel().liftrResourceCategory();
+ }
+
+ public Integer liftrResourcePreference() {
+ return this.innerModel().liftrResourcePreference();
+ }
+
+ public OrgCreationSource orgCreationSource() {
+ return this.innerModel().orgCreationSource();
+ }
+
+ public AccountCreationSource accountCreationSource() {
+ return this.innerModel().accountCreationSource();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public NewRelicMonitorResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.newrelic.NewRelicManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String monitorName;
+
+ private NewRelicMonitorResourceUpdate updateProperties;
+
+ public NewRelicMonitorResourceImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public NewRelicMonitorResource create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMonitors()
+ .createOrUpdate(resourceGroupName, monitorName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public NewRelicMonitorResource create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMonitors()
+ .createOrUpdate(resourceGroupName, monitorName, this.innerModel(), context);
+ return this;
+ }
+
+ NewRelicMonitorResourceImpl(String name, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerObject = new NewRelicMonitorResourceInner();
+ this.serviceManager = serviceManager;
+ this.monitorName = name;
+ }
+
+ public NewRelicMonitorResourceImpl update() {
+ this.updateProperties = new NewRelicMonitorResourceUpdate();
+ return this;
+ }
+
+ public NewRelicMonitorResource apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMonitors()
+ .updateWithResponse(resourceGroupName, monitorName, updateProperties, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public NewRelicMonitorResource apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMonitors()
+ .updateWithResponse(resourceGroupName, monitorName, updateProperties, context)
+ .getValue();
+ return this;
+ }
+
+ NewRelicMonitorResourceImpl(
+ NewRelicMonitorResourceInner innerObject, com.azure.resourcemanager.newrelic.NewRelicManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.monitorName = Utils.getValueFromIdByName(innerObject.id(), "monitors");
+ }
+
+ public NewRelicMonitorResource refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMonitors()
+ .getByResourceGroupWithResponse(resourceGroupName, monitorName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public NewRelicMonitorResource refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getMonitors()
+ .getByResourceGroupWithResponse(resourceGroupName, monitorName, context)
+ .getValue();
+ return this;
+ }
+
+ public Response getMetricRulesWithResponse(MetricsRequest request, Context context) {
+ return serviceManager.monitors().getMetricRulesWithResponse(resourceGroupName, monitorName, request, context);
+ }
+
+ public MetricRules getMetricRules(MetricsRequest request) {
+ return serviceManager.monitors().getMetricRules(resourceGroupName, monitorName, request);
+ }
+
+ public Response getMetricStatusWithResponse(MetricsStatusRequest request, Context context) {
+ return serviceManager.monitors().getMetricStatusWithResponse(resourceGroupName, monitorName, request, context);
+ }
+
+ public MetricsStatusResponse getMetricStatus(MetricsStatusRequest request) {
+ return serviceManager.monitors().getMetricStatus(resourceGroupName, monitorName, request);
+ }
+
+ public PagedIterable listAppServices(AppServicesGetRequest request) {
+ return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request);
+ }
+
+ public PagedIterable listAppServices(AppServicesGetRequest request, Context context) {
+ return serviceManager.monitors().listAppServices(resourceGroupName, monitorName, request, context);
+ }
+
+ public Response switchBillingWithResponse(SwitchBillingRequest request, Context context) {
+ return serviceManager.monitors().switchBillingWithResponse(resourceGroupName, monitorName, request, context);
+ }
+
+ public void switchBilling(SwitchBillingRequest request) {
+ serviceManager.monitors().switchBilling(resourceGroupName, monitorName, request);
+ }
+
+ public PagedIterable listHosts(HostsGetRequest request) {
+ return serviceManager.monitors().listHosts(resourceGroupName, monitorName, request);
+ }
+
+ public PagedIterable listHosts(HostsGetRequest request, Context context) {
+ return serviceManager.monitors().listHosts(resourceGroupName, monitorName, request, context);
+ }
+
+ public PagedIterable listMonitoredResources() {
+ return serviceManager.monitors().listMonitoredResources(resourceGroupName, monitorName);
+ }
+
+ public PagedIterable listMonitoredResources(Context context) {
+ return serviceManager.monitors().listMonitoredResources(resourceGroupName, monitorName, context);
+ }
+
+ public Response vmHostPayloadWithResponse(Context context) {
+ return serviceManager.monitors().vmHostPayloadWithResponse(resourceGroupName, monitorName, context);
+ }
+
+ public VMExtensionPayload vmHostPayload() {
+ return serviceManager.monitors().vmHostPayload(resourceGroupName, monitorName);
+ }
+
+ public NewRelicMonitorResourceImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public NewRelicMonitorResourceImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public NewRelicMonitorResourceImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateProperties.withTags(tags);
+ return this;
+ }
+ }
+
+ public NewRelicMonitorResourceImpl withIdentity(ManagedServiceIdentity identity) {
+ if (isInCreateMode()) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ } else {
+ this.updateProperties.withIdentity(identity);
+ return this;
+ }
+ }
+
+ public NewRelicMonitorResourceImpl withNewRelicAccountProperties(
+ NewRelicAccountProperties newRelicAccountProperties) {
+ if (isInCreateMode()) {
+ this.innerModel().withNewRelicAccountProperties(newRelicAccountProperties);
+ return this;
+ } else {
+ this.updateProperties.withNewRelicAccountProperties(newRelicAccountProperties);
+ return this;
+ }
+ }
+
+ public NewRelicMonitorResourceImpl withUserInfo(UserInfo userInfo) {
+ if (isInCreateMode()) {
+ this.innerModel().withUserInfo(userInfo);
+ return this;
+ } else {
+ this.updateProperties.withUserInfo(userInfo);
+ return this;
+ }
+ }
+
+ public NewRelicMonitorResourceImpl withPlanData(PlanData planData) {
+ if (isInCreateMode()) {
+ this.innerModel().withPlanData(planData);
+ return this;
+ } else {
+ this.updateProperties.withPlanData(planData);
+ return this;
+ }
+ }
+
+ public NewRelicMonitorResourceImpl withOrgCreationSource(OrgCreationSource orgCreationSource) {
+ if (isInCreateMode()) {
+ this.innerModel().withOrgCreationSource(orgCreationSource);
+ return this;
+ } else {
+ this.updateProperties.withOrgCreationSource(orgCreationSource);
+ return this;
+ }
+ }
+
+ public NewRelicMonitorResourceImpl withAccountCreationSource(AccountCreationSource accountCreationSource) {
+ if (isInCreateMode()) {
+ this.innerModel().withAccountCreationSource(accountCreationSource);
+ return this;
+ } else {
+ this.updateProperties.withAccountCreationSource(accountCreationSource);
+ return this;
+ }
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicObservabilityBuilder.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicObservabilityBuilder.java
new file mode 100644
index 000000000000..8fa21fb73309
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicObservabilityBuilder.java
@@ -0,0 +1,144 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/** A builder for creating a new instance of the NewRelicObservabilityImpl type. */
+@ServiceClientBuilder(serviceClients = {NewRelicObservabilityImpl.class})
+public final class NewRelicObservabilityBuilder {
+ /*
+ * The ID of the target subscription.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the NewRelicObservabilityBuilder.
+ */
+ public NewRelicObservabilityBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the NewRelicObservabilityBuilder.
+ */
+ public NewRelicObservabilityBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the NewRelicObservabilityBuilder.
+ */
+ public NewRelicObservabilityBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through
+ */
+ private HttpPipeline pipeline;
+
+ /**
+ * Sets The HTTP pipeline to send requests through.
+ *
+ * @param pipeline the pipeline value.
+ * @return the NewRelicObservabilityBuilder.
+ */
+ public NewRelicObservabilityBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The default poll interval for long-running operation
+ */
+ private Duration defaultPollInterval;
+
+ /**
+ * Sets The default poll interval for long-running operation.
+ *
+ * @param defaultPollInterval the defaultPollInterval value.
+ * @return the NewRelicObservabilityBuilder.
+ */
+ public NewRelicObservabilityBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /*
+ * The serializer to serialize an object into a string
+ */
+ private SerializerAdapter serializerAdapter;
+
+ /**
+ * Sets The serializer to serialize an object into a string.
+ *
+ * @param serializerAdapter the serializerAdapter value.
+ * @return the NewRelicObservabilityBuilder.
+ */
+ public NewRelicObservabilityBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of NewRelicObservabilityImpl with the provided parameters.
+ *
+ * @return an instance of NewRelicObservabilityImpl.
+ */
+ public NewRelicObservabilityImpl buildClient() {
+ String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
+ AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
+ HttpPipeline localPipeline =
+ (pipeline != null)
+ ? pipeline
+ : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ Duration localDefaultPollInterval =
+ (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
+ SerializerAdapter localSerializerAdapter =
+ (serializerAdapter != null)
+ ? serializerAdapter
+ : SerializerFactory.createDefaultManagementSerializerAdapter();
+ NewRelicObservabilityImpl client =
+ new NewRelicObservabilityImpl(
+ localPipeline,
+ localSerializerAdapter,
+ localDefaultPollInterval,
+ localEnvironment,
+ subscriptionId,
+ localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicObservabilityImpl.java b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicObservabilityImpl.java
new file mode 100644
index 000000000000..d9bed053c17a
--- /dev/null
+++ b/sdk/newrelic/azure-resourcemanager-newrelic/src/main/java/com/azure/resourcemanager/newrelic/implementation/NewRelicObservabilityImpl.java
@@ -0,0 +1,360 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.newrelic.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.newrelic.fluent.AccountsClient;
+import com.azure.resourcemanager.newrelic.fluent.MonitorsClient;
+import com.azure.resourcemanager.newrelic.fluent.NewRelicObservability;
+import com.azure.resourcemanager.newrelic.fluent.OperationsClient;
+import com.azure.resourcemanager.newrelic.fluent.OrganizationsClient;
+import com.azure.resourcemanager.newrelic.fluent.PlansClient;
+import com.azure.resourcemanager.newrelic.fluent.TagRulesClient;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** Initializes a new instance of the NewRelicObservabilityImpl type. */
+@ServiceClient(builder = NewRelicObservabilityBuilder.class)
+public final class NewRelicObservabilityImpl implements NewRelicObservability {
+ /** The ID of the target subscription. */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /** The serializer to serialize an object into a string. */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /** The default poll interval for long-running operation. */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /** The OperationsClient object to access its operations. */
+ private final OperationsClient operations;
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ public OperationsClient getOperations() {
+ return this.operations;
+ }
+
+ /** The AccountsClient object to access its operations. */
+ private final AccountsClient accounts;
+
+ /**
+ * Gets the AccountsClient object to access its operations.
+ *
+ * @return the AccountsClient object.
+ */
+ public AccountsClient getAccounts() {
+ return this.accounts;
+ }
+
+ /** The MonitorsClient object to access its operations. */
+ private final MonitorsClient monitors;
+
+ /**
+ * Gets the MonitorsClient object to access its operations.
+ *
+ * @return the MonitorsClient object.
+ */
+ public MonitorsClient getMonitors() {
+ return this.monitors;
+ }
+
+ /** The OrganizationsClient object to access its operations. */
+ private final OrganizationsClient organizations;
+
+ /**
+ * Gets the OrganizationsClient object to access its operations.
+ *
+ * @return the OrganizationsClient object.
+ */
+ public OrganizationsClient getOrganizations() {
+ return this.organizations;
+ }
+
+ /** The PlansClient object to access its operations. */
+ private final PlansClient plans;
+
+ /**
+ * Gets the PlansClient object to access its operations.
+ *
+ * @return the PlansClient object.
+ */
+ public PlansClient getPlans() {
+ return this.plans;
+ }
+
+ /** The TagRulesClient object to access its operations. */
+ private final TagRulesClient tagRules;
+
+ /**
+ * Gets the TagRulesClient object to access its operations.
+ *
+ * @return the TagRulesClient object.
+ */
+ public TagRulesClient getTagRules() {
+ return this.tagRules;
+ }
+
+ /**
+ * Initializes an instance of NewRelicObservability client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId The ID of the target subscription.
+ * @param endpoint server parameter.
+ */
+ NewRelicObservabilityImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String subscriptionId,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2022-07-01-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.accounts = new AccountsClientImpl(this);
+ this.monitors = new MonitorsClientImpl(this);
+ this.organizations = new OrganizationsClientImpl(this);
+ this.plans = new PlansClientImpl(this);
+ this.tagRules = new TagRulesClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ return CoreUtils.mergeContexts(this.getContext(), context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param httpPipeline the http pipeline.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return poller flux for poll result and final result.
+ */
+ public PollerFlux, U> getLroResult(
+ Mono>> activationResponse,
+ HttpPipeline httpPipeline,
+ Type pollResultType,
+ Type finalResultType,
+ Context context) {
+ return PollerFactory
+ .create(
+ serializerAdapter,
+ httpPipeline,
+ pollResultType,
+ finalResultType,
+ defaultPollInterval,
+ activationResponse,
+ context);
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @param response the last async poll response.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result, or an error.
+ */
+ public