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 impact service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the impact service API instance.
+ */
+ public ImpactManager 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.impact")
+ .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 ImpactManager(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 Connectors. It manages Connector.
+ *
+ * @return Resource collection API of Connectors.
+ */
+ public Connectors connectors() {
+ if (this.connectors == null) {
+ this.connectors = new ConnectorsImpl(clientObject.getConnectors(), this);
+ }
+ return connectors;
+ }
+
+ /**
+ * Gets the resource collection API of ImpactCategories.
+ *
+ * @return Resource collection API of ImpactCategories.
+ */
+ public ImpactCategories impactCategories() {
+ if (this.impactCategories == null) {
+ this.impactCategories = new ImpactCategoriesImpl(clientObject.getImpactCategories(), this);
+ }
+ return impactCategories;
+ }
+
+ /**
+ * Gets the resource collection API of WorkloadImpacts. It manages WorkloadImpact.
+ *
+ * @return Resource collection API of WorkloadImpacts.
+ */
+ public WorkloadImpacts workloadImpacts() {
+ if (this.workloadImpacts == null) {
+ this.workloadImpacts = new WorkloadImpactsImpl(clientObject.getWorkloadImpacts(), this);
+ }
+ return workloadImpacts;
+ }
+
+ /**
+ * Gets the resource collection API of Insights. It manages Insight.
+ *
+ * @return Resource collection API of Insights.
+ */
+ public Insights insights() {
+ if (this.insights == null) {
+ this.insights = new InsightsImpl(clientObject.getInsights(), this);
+ }
+ return insights;
+ }
+
+ /**
+ * Gets wrapped service client MicrosoftImpact providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client MicrosoftImpact.
+ */
+ public MicrosoftImpact serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/ConnectorsClient.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/ConnectorsClient.java
new file mode 100644
index 0000000000000..c37e1edffbb44
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/ConnectorsClient.java
@@ -0,0 +1,180 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.impact.fluent.models.ConnectorInner;
+import com.azure.resourcemanager.impact.models.ConnectorUpdate;
+
+/**
+ * An instance of this class provides access to all the operations defined in ConnectorsClient.
+ */
+public interface ConnectorsClient {
+ /**
+ * List Connector 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 Connector list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List Connector 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 Connector list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Get a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 Connector along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String connectorName, Context context);
+
+ /**
+ * Get a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Connector.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ConnectorInner get(String connectorName);
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report
+ * impacts against workloads in Azure to Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ConnectorInner> beginCreateOrUpdate(String connectorName,
+ ConnectorInner resource);
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report
+ * impacts against workloads in Azure to Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ConnectorInner> beginCreateOrUpdate(String connectorName,
+ ConnectorInner resource, Context context);
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ConnectorInner createOrUpdate(String connectorName, ConnectorInner resource);
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ConnectorInner createOrUpdate(String connectorName, ConnectorInner resource, Context context);
+
+ /**
+ * Update a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(String connectorName, ConnectorUpdate properties, Context context);
+
+ /**
+ * Update a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ConnectorInner update(String connectorName, ConnectorUpdate properties);
+
+ /**
+ * Delete a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 deleteWithResponse(String connectorName, Context context);
+
+ /**
+ * Delete a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.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 connectorName);
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/ImpactCategoriesClient.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/ImpactCategoriesClient.java
new file mode 100644
index 0000000000000..eab0b3367ae3a
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/ImpactCategoriesClient.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.util.Context;
+import com.azure.resourcemanager.impact.fluent.models.ImpactCategoryInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in ImpactCategoriesClient.
+ */
+public interface ImpactCategoriesClient {
+ /**
+ * List ImpactCategory resources by subscription.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a ImpactCategory list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List ImpactCategory resources by subscription.
+ *
+ * @param categoryName Filter by category name.
+ * @param resourceType Filter by resource type.
+ * @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 ImpactCategory list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String categoryName, String resourceType, Context context);
+
+ /**
+ * Get a ImpactCategory.
+ *
+ * @param impactCategoryName Name of the impact category.
+ * @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 ImpactCategory along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String impactCategoryName, Context context);
+
+ /**
+ * Get a ImpactCategory.
+ *
+ * @param impactCategoryName Name of the impact category.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ImpactCategory.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ImpactCategoryInner get(String impactCategoryName);
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/InsightsClient.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/InsightsClient.java
new file mode 100644
index 0000000000000..d3a94a3cbcec1
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/InsightsClient.java
@@ -0,0 +1,125 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.util.Context;
+import com.azure.resourcemanager.impact.fluent.models.InsightInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in InsightsClient.
+ */
+public interface InsightsClient {
+ /**
+ * List Insight resources by workloadImpactName.
+ *
+ * @param workloadImpactName workloadImpact 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 Insight list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listBySubscription(String workloadImpactName);
+
+ /**
+ * List Insight resources by workloadImpactName.
+ *
+ * @param workloadImpactName workloadImpact 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 Insight list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listBySubscription(String workloadImpactName, Context context);
+
+ /**
+ * Get Insight resources by workloadImpactName and insightName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 insight resources by workloadImpactName and insightName along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String workloadImpactName, String insightName, Context context);
+
+ /**
+ * Get Insight resources by workloadImpactName and insightName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return insight resources by workloadImpactName and insightName.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ InsightInner get(String workloadImpactName, String insightName);
+
+ /**
+ * Create Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 insight resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response createWithResponse(String workloadImpactName, String insightName, InsightInner resource,
+ Context context);
+
+ /**
+ * Create Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 insight resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ InsightInner create(String workloadImpactName, String insightName, InsightInner resource);
+
+ /**
+ * Delete Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 deleteWithResponse(String workloadImpactName, String insightName, Context context);
+
+ /**
+ * Delete Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.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 workloadImpactName, String insightName);
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/MicrosoftImpact.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/MicrosoftImpact.java
new file mode 100644
index 0000000000000..4443001611de4
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/MicrosoftImpact.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.impact.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for MicrosoftImpact class.
+ */
+public interface MicrosoftImpact {
+ /**
+ * 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 ConnectorsClient object to access its operations.
+ *
+ * @return the ConnectorsClient object.
+ */
+ ConnectorsClient getConnectors();
+
+ /**
+ * Gets the ImpactCategoriesClient object to access its operations.
+ *
+ * @return the ImpactCategoriesClient object.
+ */
+ ImpactCategoriesClient getImpactCategories();
+
+ /**
+ * Gets the WorkloadImpactsClient object to access its operations.
+ *
+ * @return the WorkloadImpactsClient object.
+ */
+ WorkloadImpactsClient getWorkloadImpacts();
+
+ /**
+ * Gets the InsightsClient object to access its operations.
+ *
+ * @return the InsightsClient object.
+ */
+ InsightsClient getInsights();
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/OperationsClient.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..09079da3d92fd
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/OperationsClient.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.impact.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.impact.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/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/WorkloadImpactsClient.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/WorkloadImpactsClient.java
new file mode 100644
index 0000000000000..12fff22641140
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/WorkloadImpactsClient.java
@@ -0,0 +1,146 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.impact.fluent.models.WorkloadImpactInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in WorkloadImpactsClient.
+ */
+public interface WorkloadImpactsClient {
+ /**
+ * List WorkloadImpact 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 WorkloadImpact list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List WorkloadImpact 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 WorkloadImpact list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Get a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 WorkloadImpact along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String workloadImpactName, Context context);
+
+ /**
+ * Get a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 WorkloadImpact.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ WorkloadImpactInner get(String workloadImpactName);
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, WorkloadImpactInner> beginCreate(String workloadImpactName,
+ WorkloadImpactInner resource);
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, WorkloadImpactInner> beginCreate(String workloadImpactName,
+ WorkloadImpactInner resource, Context context);
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ WorkloadImpactInner create(String workloadImpactName, WorkloadImpactInner resource);
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ WorkloadImpactInner create(String workloadImpactName, WorkloadImpactInner resource, Context context);
+
+ /**
+ * Delete a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String workloadImpactName, Context context);
+
+ /**
+ * Delete a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workloadImpactName);
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/ConnectorInner.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/ConnectorInner.java
new file mode 100644
index 0000000000000..6734c2c98743a
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/ConnectorInner.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.impact.models.ConnectorProperties;
+import java.io.IOException;
+
+/**
+ * A connector is a resource that can be used to proactively report impacts against workloads in Azure to Microsoft.
+ */
+@Fluent
+public final class ConnectorInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private ConnectorProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of ConnectorInner class.
+ */
+ public ConnectorInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public ConnectorProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the ConnectorInner object itself.
+ */
+ public ConnectorInner withProperties(ConnectorProperties properties) {
+ this.properties = properties;
+ 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;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ConnectorInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ConnectorInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ConnectorInner.
+ */
+ public static ConnectorInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ConnectorInner deserializedConnectorInner = new ConnectorInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedConnectorInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedConnectorInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedConnectorInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedConnectorInner.properties = ConnectorProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedConnectorInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedConnectorInner;
+ });
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/ImpactCategoryInner.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/ImpactCategoryInner.java
new file mode 100644
index 0000000000000..3dcec3eb27c68
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/ImpactCategoryInner.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.impact.models.ImpactCategoryProperties;
+import java.io.IOException;
+
+/**
+ * ImpactCategory resource.
+ */
+@Fluent
+public final class ImpactCategoryInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private ImpactCategoryProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of ImpactCategoryInner class.
+ */
+ public ImpactCategoryInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public ImpactCategoryProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the ImpactCategoryInner object itself.
+ */
+ public ImpactCategoryInner withProperties(ImpactCategoryProperties properties) {
+ this.properties = properties;
+ 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;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ImpactCategoryInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ImpactCategoryInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ImpactCategoryInner.
+ */
+ public static ImpactCategoryInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ImpactCategoryInner deserializedImpactCategoryInner = new ImpactCategoryInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedImpactCategoryInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedImpactCategoryInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedImpactCategoryInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedImpactCategoryInner.properties = ImpactCategoryProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedImpactCategoryInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedImpactCategoryInner;
+ });
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/InsightInner.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/InsightInner.java
new file mode 100644
index 0000000000000..6a7e745e55735
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/InsightInner.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.impact.models.InsightProperties;
+import java.io.IOException;
+
+/**
+ * Insight resource.
+ */
+@Fluent
+public final class InsightInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private InsightProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of InsightInner class.
+ */
+ public InsightInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public InsightProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the InsightInner object itself.
+ */
+ public InsightInner withProperties(InsightProperties properties) {
+ this.properties = properties;
+ 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;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of InsightInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of InsightInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the InsightInner.
+ */
+ public static InsightInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ InsightInner deserializedInsightInner = new InsightInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedInsightInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedInsightInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedInsightInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedInsightInner.properties = InsightProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedInsightInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedInsightInner;
+ });
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/OperationInner.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/OperationInner.java
new file mode 100644
index 0000000000000..f5eb83bc1ba17
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/OperationInner.java
@@ -0,0 +1,172 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.impact.models.ActionType;
+import com.azure.resourcemanager.impact.models.OperationDisplay;
+import com.azure.resourcemanager.impact.models.Origin;
+import java.io.IOException;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Fluent
+public final class OperationInner implements JsonSerializable {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for
+ * ARM/control-plane operations.
+ */
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ 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"
+ */
+ private Origin origin;
+
+ /*
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ 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();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("display", this.display);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationInner.
+ */
+ public static OperationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationInner deserializedOperationInner = new OperationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedOperationInner.name = reader.getString();
+ } else if ("isDataAction".equals(fieldName)) {
+ deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
+ } else if ("display".equals(fieldName)) {
+ deserializedOperationInner.display = OperationDisplay.fromJson(reader);
+ } else if ("origin".equals(fieldName)) {
+ deserializedOperationInner.origin = Origin.fromString(reader.getString());
+ } else if ("actionType".equals(fieldName)) {
+ deserializedOperationInner.actionType = ActionType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationInner;
+ });
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/WorkloadImpactInner.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/WorkloadImpactInner.java
new file mode 100644
index 0000000000000..c8e31bb77914b
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/WorkloadImpactInner.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.impact.models.WorkloadImpactProperties;
+import java.io.IOException;
+
+/**
+ * Workload Impact properties.
+ */
+@Fluent
+public final class WorkloadImpactInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private WorkloadImpactProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of WorkloadImpactInner class.
+ */
+ public WorkloadImpactInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public WorkloadImpactProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the WorkloadImpactInner object itself.
+ */
+ public WorkloadImpactInner withProperties(WorkloadImpactProperties properties) {
+ this.properties = properties;
+ 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;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of WorkloadImpactInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of WorkloadImpactInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the WorkloadImpactInner.
+ */
+ public static WorkloadImpactInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ WorkloadImpactInner deserializedWorkloadImpactInner = new WorkloadImpactInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedWorkloadImpactInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedWorkloadImpactInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedWorkloadImpactInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedWorkloadImpactInner.properties = WorkloadImpactProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedWorkloadImpactInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedWorkloadImpactInner;
+ });
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/package-info.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/package-info.java
new file mode 100644
index 0000000000000..5adc9cfeda58b
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/models/package-info.java
@@ -0,0 +1,9 @@
+// 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 MicrosoftImpact.
+ * null.
+ */
+package com.azure.resourcemanager.impact.fluent.models;
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/package-info.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/package-info.java
new file mode 100644
index 0000000000000..a3410daa4502c
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/fluent/package-info.java
@@ -0,0 +1,9 @@
+// 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 MicrosoftImpact.
+ * null.
+ */
+package com.azure.resourcemanager.impact.fluent;
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorImpl.java
new file mode 100644
index 0000000000000..78137f485fd5e
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorImpl.java
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.impact.fluent.models.ConnectorInner;
+import com.azure.resourcemanager.impact.models.Connector;
+import com.azure.resourcemanager.impact.models.ConnectorProperties;
+import com.azure.resourcemanager.impact.models.ConnectorPropertiesUpdate;
+import com.azure.resourcemanager.impact.models.ConnectorUpdate;
+
+public final class ConnectorImpl implements Connector, Connector.Definition, Connector.Update {
+ private ConnectorInner innerObject;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public ConnectorProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ConnectorInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+
+ private String connectorName;
+
+ private ConnectorUpdate updateProperties;
+
+ public Connector create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getConnectors()
+ .createOrUpdate(connectorName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public Connector create(Context context) {
+ this.innerObject
+ = serviceManager.serviceClient().getConnectors().createOrUpdate(connectorName, this.innerModel(), context);
+ return this;
+ }
+
+ ConnectorImpl(String name, com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerObject = new ConnectorInner();
+ this.serviceManager = serviceManager;
+ this.connectorName = name;
+ }
+
+ public ConnectorImpl update() {
+ this.updateProperties = new ConnectorUpdate();
+ return this;
+ }
+
+ public Connector apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getConnectors()
+ .updateWithResponse(connectorName, updateProperties, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public Connector apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getConnectors()
+ .updateWithResponse(connectorName, updateProperties, context)
+ .getValue();
+ return this;
+ }
+
+ ConnectorImpl(ConnectorInner innerObject, com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.connectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connectors");
+ }
+
+ public Connector refresh() {
+ this.innerObject
+ = serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, Context.NONE).getValue();
+ return this;
+ }
+
+ public Connector refresh(Context context) {
+ this.innerObject
+ = serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, context).getValue();
+ return this;
+ }
+
+ public ConnectorImpl withProperties(ConnectorProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+
+ public ConnectorImpl withProperties(ConnectorPropertiesUpdate properties) {
+ this.updateProperties.withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorsClientImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorsClientImpl.java
new file mode 100644
index 0000000000000..e630212d45418
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorsClientImpl.java
@@ -0,0 +1,831 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.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.impact.fluent.ConnectorsClient;
+import com.azure.resourcemanager.impact.fluent.models.ConnectorInner;
+import com.azure.resourcemanager.impact.models.ConnectorListResult;
+import com.azure.resourcemanager.impact.models.ConnectorUpdate;
+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 ConnectorsClient.
+ */
+public final class ConnectorsClientImpl implements ConnectorsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final ConnectorsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final MicrosoftImpactImpl client;
+
+ /**
+ * Initializes an instance of ConnectorsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ConnectorsClientImpl(MicrosoftImpactImpl client) {
+ this.service
+ = RestProxy.create(ConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftImpactConnectors to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftImpactConne")
+ public interface ConnectorsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors")
+ @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}/providers/Microsoft.Impact/connectors/{connectorName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("connectorName") String connectorName, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("connectorName") String connectorName, @BodyParam("application/json") ConnectorInner resource,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("connectorName") String connectorName, @BodyParam("application/json") ConnectorUpdate properties,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/connectors/{connectorName}")
+ @ExpectedResponses({ 200, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId, @PathParam("connectorName") String connectorName,
+ @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);
+ }
+
+ /**
+ * List Connector 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 Connector 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 Connector 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 Connector 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 Connector 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 Connector list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Connector 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 Connector 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 Connector 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 Connector list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List Connector 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 Connector list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Connector along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String connectorName) {
+ 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 (connectorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), connectorName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Connector along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String connectorName, 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 (connectorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ connectorName, accept, context);
+ }
+
+ /**
+ * Get a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Connector on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String connectorName) {
+ return getWithResponseAsync(connectorName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Connector along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String connectorName, Context context) {
+ return getWithResponseAsync(connectorName, context).block();
+ }
+
+ /**
+ * Get a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Connector.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ConnectorInner get(String connectorName) {
+ return getWithResponse(connectorName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String connectorName,
+ ConnectorInner 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 (connectorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter connectorName 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(), connectorName, resource, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String connectorName,
+ ConnectorInner 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 (connectorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter connectorName 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(), connectorName, resource, accept, context);
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report
+ * impacts against workloads in Azure to Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ConnectorInner> beginCreateOrUpdateAsync(String connectorName,
+ ConnectorInner resource) {
+ Mono>> mono = createOrUpdateWithResponseAsync(connectorName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ ConnectorInner.class, ConnectorInner.class, this.client.getContext());
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report
+ * impacts against workloads in Azure to Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ConnectorInner> beginCreateOrUpdateAsync(String connectorName,
+ ConnectorInner resource, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = createOrUpdateWithResponseAsync(connectorName, resource, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ ConnectorInner.class, ConnectorInner.class, context);
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report
+ * impacts against workloads in Azure to Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ConnectorInner> beginCreateOrUpdate(String connectorName,
+ ConnectorInner resource) {
+ return this.beginCreateOrUpdateAsync(connectorName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report
+ * impacts against workloads in Azure to Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ConnectorInner> beginCreateOrUpdate(String connectorName,
+ ConnectorInner resource, Context context) {
+ return this.beginCreateOrUpdateAsync(connectorName, resource, context).getSyncPoller();
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String connectorName, ConnectorInner resource) {
+ return beginCreateOrUpdateAsync(connectorName, resource).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String connectorName, ConnectorInner resource, Context context) {
+ return beginCreateOrUpdateAsync(connectorName, resource, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ConnectorInner createOrUpdate(String connectorName, ConnectorInner resource) {
+ return createOrUpdateAsync(connectorName, resource).block();
+ }
+
+ /**
+ * Create a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ConnectorInner createOrUpdate(String connectorName, ConnectorInner resource, Context context) {
+ return createOrUpdateAsync(connectorName, resource, context).block();
+ }
+
+ /**
+ * Update a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(String connectorName, ConnectorUpdate 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 (connectorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter connectorName 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(), connectorName, properties, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(String connectorName, ConnectorUpdate 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 (connectorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter connectorName 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(),
+ connectorName, properties, accept, context);
+ }
+
+ /**
+ * Update a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String connectorName, ConnectorUpdate properties) {
+ return updateWithResponseAsync(connectorName, properties).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Update a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(String connectorName, ConnectorUpdate properties,
+ Context context) {
+ return updateWithResponseAsync(connectorName, properties, context).block();
+ }
+
+ /**
+ * Update a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @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 connector is a resource that can be used to proactively report impacts against workloads in Azure to
+ * Microsoft.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ConnectorInner update(String connectorName, ConnectorUpdate properties) {
+ return updateWithResponse(connectorName, properties, Context.NONE).getValue();
+ }
+
+ /**
+ * Delete a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 connectorName) {
+ 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 (connectorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter connectorName 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(), connectorName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 connectorName, 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 (connectorName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter connectorName 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(),
+ connectorName, accept, context);
+ }
+
+ /**
+ * Delete a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 connectorName) {
+ return deleteWithResponseAsync(connectorName).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Delete a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 deleteWithResponse(String connectorName, Context context) {
+ return deleteWithResponseAsync(connectorName, context).block();
+ }
+
+ /**
+ * Delete a Connector.
+ *
+ * @param connectorName The name of the connector.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 connectorName) {
+ deleteWithResponse(connectorName, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Connector 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 Connector 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));
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorsImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorsImpl.java
new file mode 100644
index 0000000000000..a3515f0eac91b
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ConnectorsImpl.java
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.impact.fluent.ConnectorsClient;
+import com.azure.resourcemanager.impact.fluent.models.ConnectorInner;
+import com.azure.resourcemanager.impact.models.Connector;
+import com.azure.resourcemanager.impact.models.Connectors;
+
+public final class ConnectorsImpl implements Connectors {
+ private static final ClientLogger LOGGER = new ClientLogger(ConnectorsImpl.class);
+
+ private final ConnectorsClient innerClient;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ public ConnectorsImpl(ConnectorsClient innerClient, com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectorImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectorImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(String connectorName, Context context) {
+ Response inner = this.serviceClient().getWithResponse(connectorName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new ConnectorImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Connector get(String connectorName) {
+ ConnectorInner inner = this.serviceClient().get(connectorName);
+ if (inner != null) {
+ return new ConnectorImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteWithResponse(String connectorName, Context context) {
+ return this.serviceClient().deleteWithResponse(connectorName, context);
+ }
+
+ public void delete(String connectorName) {
+ this.serviceClient().delete(connectorName);
+ }
+
+ public Connector getById(String id) {
+ String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors");
+ if (connectorName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id)));
+ }
+ return this.getWithResponse(connectorName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors");
+ if (connectorName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id)));
+ }
+ return this.getWithResponse(connectorName, context);
+ }
+
+ public void deleteById(String id) {
+ String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors");
+ if (connectorName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id)));
+ }
+ this.deleteWithResponse(connectorName, Context.NONE);
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String connectorName = ResourceManagerUtils.getValueFromIdByName(id, "connectors");
+ if (connectorName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id)));
+ }
+ return this.deleteWithResponse(connectorName, context);
+ }
+
+ private ConnectorsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+
+ public ConnectorImpl define(String name) {
+ return new ConnectorImpl(name, this.manager());
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoriesClientImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoriesClientImpl.java
new file mode 100644
index 0000000000000..dd9ae39ba9018
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoriesClientImpl.java
@@ -0,0 +1,390 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.impact.fluent.ImpactCategoriesClient;
+import com.azure.resourcemanager.impact.fluent.models.ImpactCategoryInner;
+import com.azure.resourcemanager.impact.models.ImpactCategoryListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in ImpactCategoriesClient.
+ */
+public final class ImpactCategoriesClientImpl implements ImpactCategoriesClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final ImpactCategoriesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final MicrosoftImpactImpl client;
+
+ /**
+ * Initializes an instance of ImpactCategoriesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ImpactCategoriesClientImpl(MicrosoftImpactImpl client) {
+ this.service
+ = RestProxy.create(ImpactCategoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftImpactImpactCategories to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftImpactImpac")
+ public interface ImpactCategoriesService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("categoryName") String categoryName, @QueryParam("resourceType") String resourceType,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/impactCategories/{impactCategoryName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("impactCategoryName") String impactCategoryName, @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);
+ }
+
+ /**
+ * List ImpactCategory resources by subscription.
+ *
+ * @param categoryName Filter by category name.
+ * @param resourceType Filter by resource type.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 ImpactCategory list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String categoryName, String resourceType) {
+ 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(), categoryName, resourceType, 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 ImpactCategory resources by subscription.
+ *
+ * @param categoryName Filter by category name.
+ * @param resourceType Filter by resource type.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 ImpactCategory list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String categoryName, String resourceType,
+ 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(), categoryName,
+ resourceType, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List ImpactCategory resources by subscription.
+ *
+ * @param categoryName Filter by category name.
+ * @param resourceType Filter by resource type.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 ImpactCategory list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String categoryName, String resourceType) {
+ return new PagedFlux<>(() -> listSinglePageAsync(categoryName, resourceType),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List ImpactCategory resources by subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a ImpactCategory list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ final String categoryName = null;
+ final String resourceType = null;
+ return new PagedFlux<>(() -> listSinglePageAsync(categoryName, resourceType),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List ImpactCategory resources by subscription.
+ *
+ * @param categoryName Filter by category name.
+ * @param resourceType Filter by resource type.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 ImpactCategory list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String categoryName, String resourceType, Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(categoryName, resourceType, context),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List ImpactCategory resources by subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a ImpactCategory list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ final String categoryName = null;
+ final String resourceType = null;
+ return new PagedIterable<>(listAsync(categoryName, resourceType));
+ }
+
+ /**
+ * List ImpactCategory resources by subscription.
+ *
+ * @param categoryName Filter by category name.
+ * @param resourceType Filter by resource type.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 ImpactCategory list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String categoryName, String resourceType, Context context) {
+ return new PagedIterable<>(listAsync(categoryName, resourceType, context));
+ }
+
+ /**
+ * Get a ImpactCategory.
+ *
+ * @param impactCategoryName Name of the impact category.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ImpactCategory along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String impactCategoryName) {
+ 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 (impactCategoryName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter impactCategoryName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), impactCategoryName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a ImpactCategory.
+ *
+ * @param impactCategoryName Name of the impact category.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ImpactCategory along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String impactCategoryName, 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 (impactCategoryName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter impactCategoryName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ impactCategoryName, accept, context);
+ }
+
+ /**
+ * Get a ImpactCategory.
+ *
+ * @param impactCategoryName Name of the impact category.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ImpactCategory on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String impactCategoryName) {
+ return getWithResponseAsync(impactCategoryName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a ImpactCategory.
+ *
+ * @param impactCategoryName Name of the impact category.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ImpactCategory along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String impactCategoryName, Context context) {
+ return getWithResponseAsync(impactCategoryName, context).block();
+ }
+
+ /**
+ * Get a ImpactCategory.
+ *
+ * @param impactCategoryName Name of the impact category.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ImpactCategory.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ImpactCategoryInner get(String impactCategoryName) {
+ return getWithResponse(impactCategoryName, Context.NONE).getValue();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a ImpactCategory 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 ImpactCategory 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));
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoriesImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoriesImpl.java
new file mode 100644
index 0000000000000..54449d036bd7f
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoriesImpl.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.impact.fluent.ImpactCategoriesClient;
+import com.azure.resourcemanager.impact.fluent.models.ImpactCategoryInner;
+import com.azure.resourcemanager.impact.models.ImpactCategories;
+import com.azure.resourcemanager.impact.models.ImpactCategory;
+
+public final class ImpactCategoriesImpl implements ImpactCategories {
+ private static final ClientLogger LOGGER = new ClientLogger(ImpactCategoriesImpl.class);
+
+ private final ImpactCategoriesClient innerClient;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ public ImpactCategoriesImpl(ImpactCategoriesClient innerClient,
+ com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ImpactCategoryImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String categoryName, String resourceType, Context context) {
+ PagedIterable inner = this.serviceClient().list(categoryName, resourceType, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new ImpactCategoryImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(String impactCategoryName, Context context) {
+ Response inner = this.serviceClient().getWithResponse(impactCategoryName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new ImpactCategoryImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ImpactCategory get(String impactCategoryName) {
+ ImpactCategoryInner inner = this.serviceClient().get(impactCategoryName);
+ if (inner != null) {
+ return new ImpactCategoryImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private ImpactCategoriesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoryImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoryImpl.java
new file mode 100644
index 0000000000000..649a2e469062b
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ImpactCategoryImpl.java
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.impact.fluent.models.ImpactCategoryInner;
+import com.azure.resourcemanager.impact.models.ImpactCategory;
+import com.azure.resourcemanager.impact.models.ImpactCategoryProperties;
+
+public final class ImpactCategoryImpl implements ImpactCategory {
+ private ImpactCategoryInner innerObject;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ ImpactCategoryImpl(ImpactCategoryInner innerObject, com.azure.resourcemanager.impact.ImpactManager 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 ImpactCategoryProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ImpactCategoryInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightImpl.java
new file mode 100644
index 0000000000000..2fe8c2a8e6037
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightImpl.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.impact.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.impact.fluent.models.InsightInner;
+import com.azure.resourcemanager.impact.models.Insight;
+import com.azure.resourcemanager.impact.models.InsightProperties;
+
+public final class InsightImpl implements Insight, Insight.Definition {
+ private InsightInner innerObject;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ InsightImpl(InsightInner innerObject, com.azure.resourcemanager.impact.ImpactManager 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 InsightProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public InsightInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+
+ private String workloadImpactName;
+
+ private String insightName;
+
+ public InsightImpl withExistingWorkloadImpact(String workloadImpactName) {
+ this.workloadImpactName = workloadImpactName;
+ return this;
+ }
+
+ public Insight create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getInsights()
+ .createWithResponse(workloadImpactName, insightName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public Insight create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getInsights()
+ .createWithResponse(workloadImpactName, insightName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ InsightImpl(String name, com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerObject = new InsightInner();
+ this.serviceManager = serviceManager;
+ this.insightName = name;
+ }
+
+ public Insight refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getInsights()
+ .getWithResponse(workloadImpactName, insightName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public Insight refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getInsights()
+ .getWithResponse(workloadImpactName, insightName, context)
+ .getValue();
+ return this;
+ }
+
+ public InsightImpl withProperties(InsightProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightsClientImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightsClientImpl.java
new file mode 100644
index 0000000000000..73a36a9c3c7c1
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightsClientImpl.java
@@ -0,0 +1,659 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.impact.fluent.InsightsClient;
+import com.azure.resourcemanager.impact.fluent.models.InsightInner;
+import com.azure.resourcemanager.impact.models.InsightListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in InsightsClient.
+ */
+public final class InsightsClientImpl implements InsightsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final InsightsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final MicrosoftImpactImpl client;
+
+ /**
+ * Initializes an instance of InsightsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ InsightsClientImpl(MicrosoftImpactImpl client) {
+ this.service = RestProxy.create(InsightsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftImpactInsights to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftImpactInsig")
+ public interface InsightsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySubscription(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("workloadImpactName") String workloadImpactName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("workloadImpactName") String workloadImpactName, @PathParam("insightName") String insightName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> create(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("workloadImpactName") String workloadImpactName, @PathParam("insightName") String insightName,
+ @BodyParam("application/json") InsightInner resource, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}/insights/{insightName}")
+ @ExpectedResponses({ 200, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("workloadImpactName") String workloadImpactName, @PathParam("insightName") String insightName,
+ @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);
+ }
+
+ /**
+ * List Insight resources by workloadImpactName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Insight list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionSinglePageAsync(String workloadImpactName) {
+ 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), workloadImpactName, 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 Insight resources by workloadImpactName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Insight list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionSinglePageAsync(String workloadImpactName,
+ 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ workloadImpactName, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List Insight resources by workloadImpactName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Insight list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listBySubscriptionAsync(String workloadImpactName) {
+ return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(workloadImpactName),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Insight resources by workloadImpactName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Insight list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listBySubscriptionAsync(String workloadImpactName, Context context) {
+ return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(workloadImpactName, context),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List Insight resources by workloadImpactName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Insight list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listBySubscription(String workloadImpactName) {
+ return new PagedIterable<>(listBySubscriptionAsync(workloadImpactName));
+ }
+
+ /**
+ * List Insight resources by workloadImpactName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Insight list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listBySubscription(String workloadImpactName, Context context) {
+ return new PagedIterable<>(listBySubscriptionAsync(workloadImpactName, context));
+ }
+
+ /**
+ * Get Insight resources by workloadImpactName and insightName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return insight resources by workloadImpactName and insightName along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String workloadImpactName, String insightName) {
+ 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ if (insightName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter insightName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), workloadImpactName, insightName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get Insight resources by workloadImpactName and insightName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return insight resources by workloadImpactName and insightName along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String workloadImpactName, String insightName,
+ 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ if (insightName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter insightName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ workloadImpactName, insightName, accept, context);
+ }
+
+ /**
+ * Get Insight resources by workloadImpactName and insightName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return insight resources by workloadImpactName and insightName on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String workloadImpactName, String insightName) {
+ return getWithResponseAsync(workloadImpactName, insightName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get Insight resources by workloadImpactName and insightName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return insight resources by workloadImpactName and insightName along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String workloadImpactName, String insightName, Context context) {
+ return getWithResponseAsync(workloadImpactName, insightName, context).block();
+ }
+
+ /**
+ * Get Insight resources by workloadImpactName and insightName.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return insight resources by workloadImpactName and insightName.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public InsightInner get(String workloadImpactName, String insightName) {
+ return getWithResponse(workloadImpactName, insightName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 insight resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createWithResponseAsync(String workloadImpactName, String insightName,
+ InsightInner 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ if (insightName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter insightName 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.create(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), workloadImpactName, insightName, resource, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 insight resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createWithResponseAsync(String workloadImpactName, String insightName,
+ InsightInner 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ if (insightName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter insightName 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.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ workloadImpactName, insightName, resource, accept, context);
+ }
+
+ /**
+ * Create Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 insight resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(String workloadImpactName, String insightName, InsightInner resource) {
+ return createWithResponseAsync(workloadImpactName, insightName, resource)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Create Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 insight resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createWithResponse(String workloadImpactName, String insightName,
+ InsightInner resource, Context context) {
+ return createWithResponseAsync(workloadImpactName, insightName, resource, context).block();
+ }
+
+ /**
+ * Create Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @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 insight resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public InsightInner create(String workloadImpactName, String insightName, InsightInner resource) {
+ return createWithResponse(workloadImpactName, insightName, resource, Context.NONE).getValue();
+ }
+
+ /**
+ * Delete Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 workloadImpactName, String insightName) {
+ 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ if (insightName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter insightName 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(), workloadImpactName, insightName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 workloadImpactName, String insightName,
+ 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ if (insightName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter insightName 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(),
+ workloadImpactName, insightName, accept, context);
+ }
+
+ /**
+ * Delete Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 workloadImpactName, String insightName) {
+ return deleteWithResponseAsync(workloadImpactName, insightName).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Delete Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 deleteWithResponse(String workloadImpactName, String insightName, Context context) {
+ return deleteWithResponseAsync(workloadImpactName, insightName, context).block();
+ }
+
+ /**
+ * Delete Insight resource, This is Admin only operation.
+ *
+ * @param workloadImpactName workloadImpact resource.
+ * @param insightName Name of the insight.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 workloadImpactName, String insightName) {
+ deleteWithResponse(workloadImpactName, insightName, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Insight 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 Insight 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));
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightsImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightsImpl.java
new file mode 100644
index 0000000000000..5dfc3211a5d42
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/InsightsImpl.java
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.impact.fluent.InsightsClient;
+import com.azure.resourcemanager.impact.fluent.models.InsightInner;
+import com.azure.resourcemanager.impact.models.Insight;
+import com.azure.resourcemanager.impact.models.Insights;
+
+public final class InsightsImpl implements Insights {
+ private static final ClientLogger LOGGER = new ClientLogger(InsightsImpl.class);
+
+ private final InsightsClient innerClient;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ public InsightsImpl(InsightsClient innerClient, com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listBySubscription(String workloadImpactName) {
+ PagedIterable inner = this.serviceClient().listBySubscription(workloadImpactName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new InsightImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listBySubscription(String workloadImpactName, Context context) {
+ PagedIterable inner = this.serviceClient().listBySubscription(workloadImpactName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new InsightImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(String workloadImpactName, String insightName, Context context) {
+ Response inner = this.serviceClient().getWithResponse(workloadImpactName, insightName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new InsightImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Insight get(String workloadImpactName, String insightName) {
+ InsightInner inner = this.serviceClient().get(workloadImpactName, insightName);
+ if (inner != null) {
+ return new InsightImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteByResourceGroupWithResponse(String workloadImpactName, String insightName,
+ Context context) {
+ return this.serviceClient().deleteWithResponse(workloadImpactName, insightName, context);
+ }
+
+ public void deleteByResourceGroup(String workloadImpactName, String insightName) {
+ this.serviceClient().delete(workloadImpactName, insightName);
+ }
+
+ public Insight getById(String id) {
+ String workloadImpactName = ResourceManagerUtils.getValueFromIdByName(id, "workloadImpacts");
+ if (workloadImpactName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workloadImpacts'.", id)));
+ }
+ String insightName = ResourceManagerUtils.getValueFromIdByName(id, "insights");
+ if (insightName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'insights'.", id)));
+ }
+ return this.getWithResponse(workloadImpactName, insightName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String workloadImpactName = ResourceManagerUtils.getValueFromIdByName(id, "workloadImpacts");
+ if (workloadImpactName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workloadImpacts'.", id)));
+ }
+ String insightName = ResourceManagerUtils.getValueFromIdByName(id, "insights");
+ if (insightName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'insights'.", id)));
+ }
+ return this.getWithResponse(workloadImpactName, insightName, context);
+ }
+
+ public void deleteById(String id) {
+ String workloadImpactName = ResourceManagerUtils.getValueFromIdByName(id, "workloadImpacts");
+ if (workloadImpactName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workloadImpacts'.", id)));
+ }
+ String insightName = ResourceManagerUtils.getValueFromIdByName(id, "insights");
+ if (insightName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'insights'.", id)));
+ }
+ this.deleteByResourceGroupWithResponse(workloadImpactName, insightName, Context.NONE);
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String workloadImpactName = ResourceManagerUtils.getValueFromIdByName(id, "workloadImpacts");
+ if (workloadImpactName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'workloadImpacts'.", id)));
+ }
+ String insightName = ResourceManagerUtils.getValueFromIdByName(id, "insights");
+ if (insightName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'insights'.", id)));
+ }
+ return this.deleteByResourceGroupWithResponse(workloadImpactName, insightName, context);
+ }
+
+ private InsightsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+
+ public InsightImpl define(String name) {
+ return new InsightImpl(name, this.manager());
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/MicrosoftImpactBuilder.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/MicrosoftImpactBuilder.java
new file mode 100644
index 0000000000000..416c52d6ee8a6
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/MicrosoftImpactBuilder.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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 MicrosoftImpactImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { MicrosoftImpactImpl.class })
+public final class MicrosoftImpactBuilder {
+ /*
+ * The ID of the target subscription.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the MicrosoftImpactBuilder.
+ */
+ public MicrosoftImpactBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the MicrosoftImpactBuilder.
+ */
+ public MicrosoftImpactBuilder 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 MicrosoftImpactBuilder.
+ */
+ public MicrosoftImpactBuilder 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 MicrosoftImpactBuilder.
+ */
+ public MicrosoftImpactBuilder 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 MicrosoftImpactBuilder.
+ */
+ public MicrosoftImpactBuilder 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 MicrosoftImpactBuilder.
+ */
+ public MicrosoftImpactBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of MicrosoftImpactImpl with the provided parameters.
+ *
+ * @return an instance of MicrosoftImpactImpl.
+ */
+ public MicrosoftImpactImpl 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();
+ MicrosoftImpactImpl client = new MicrosoftImpactImpl(localPipeline, localSerializerAdapter,
+ localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/MicrosoftImpactImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/MicrosoftImpactImpl.java
new file mode 100644
index 0000000000000..c5a5d9da9bc03
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/MicrosoftImpactImpl.java
@@ -0,0 +1,352 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+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.impact.fluent.ConnectorsClient;
+import com.azure.resourcemanager.impact.fluent.ImpactCategoriesClient;
+import com.azure.resourcemanager.impact.fluent.InsightsClient;
+import com.azure.resourcemanager.impact.fluent.MicrosoftImpact;
+import com.azure.resourcemanager.impact.fluent.OperationsClient;
+import com.azure.resourcemanager.impact.fluent.WorkloadImpactsClient;
+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 MicrosoftImpactImpl type.
+ */
+@ServiceClient(builder = MicrosoftImpactBuilder.class)
+public final class MicrosoftImpactImpl implements MicrosoftImpact {
+ /**
+ * 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 ConnectorsClient object to access its operations.
+ */
+ private final ConnectorsClient connectors;
+
+ /**
+ * Gets the ConnectorsClient object to access its operations.
+ *
+ * @return the ConnectorsClient object.
+ */
+ public ConnectorsClient getConnectors() {
+ return this.connectors;
+ }
+
+ /**
+ * The ImpactCategoriesClient object to access its operations.
+ */
+ private final ImpactCategoriesClient impactCategories;
+
+ /**
+ * Gets the ImpactCategoriesClient object to access its operations.
+ *
+ * @return the ImpactCategoriesClient object.
+ */
+ public ImpactCategoriesClient getImpactCategories() {
+ return this.impactCategories;
+ }
+
+ /**
+ * The WorkloadImpactsClient object to access its operations.
+ */
+ private final WorkloadImpactsClient workloadImpacts;
+
+ /**
+ * Gets the WorkloadImpactsClient object to access its operations.
+ *
+ * @return the WorkloadImpactsClient object.
+ */
+ public WorkloadImpactsClient getWorkloadImpacts() {
+ return this.workloadImpacts;
+ }
+
+ /**
+ * The InsightsClient object to access its operations.
+ */
+ private final InsightsClient insights;
+
+ /**
+ * Gets the InsightsClient object to access its operations.
+ *
+ * @return the InsightsClient object.
+ */
+ public InsightsClient getInsights() {
+ return this.insights;
+ }
+
+ /**
+ * Initializes an instance of MicrosoftImpact 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.
+ */
+ MicrosoftImpactImpl(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 = "2024-05-01-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.connectors = new ConnectorsClientImpl(this);
+ this.impactCategories = new ImpactCategoriesClientImpl(this);
+ this.workloadImpacts = new WorkloadImpactsClientImpl(this);
+ this.insights = new InsightsClientImpl(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 Mono getLroFinalResultOrError(AsyncPollResponse, U> response) {
+ if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ PollResult.Error lroError = response.getValue().getError();
+ if (lroError != null) {
+ errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(),
+ lroError.getResponseBody());
+
+ errorMessage = response.getValue().getError().getMessage();
+ String errorBody = response.getValue().getError().getResponseBody();
+ if (errorBody != null) {
+ // try to deserialize error body to ManagementError
+ try {
+ managementError = this.getSerializerAdapter()
+ .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ if (managementError.getCode() == null || managementError.getMessage() == null) {
+ managementError = null;
+ }
+ } catch (IOException | RuntimeException ioe) {
+ LOGGER.logThrowableAsWarning(ioe);
+ }
+ }
+ } else {
+ // fallback to default error message
+ errorMessage = "Long running operation failed.";
+ }
+ if (managementError == null) {
+ // fallback to default ManagementError
+ managementError = new ManagementError(response.getStatus().toString(), errorMessage);
+ }
+ return Mono.error(new ManagementException(errorMessage, errorResponse, managementError));
+ } else {
+ return response.getFinalResult();
+ }
+ }
+
+ private static final class HttpResponseImpl extends HttpResponse {
+ private final int statusCode;
+
+ private final byte[] responseBody;
+
+ private final HttpHeaders httpHeaders;
+
+ HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) {
+ super(null);
+ this.statusCode = statusCode;
+ this.httpHeaders = httpHeaders;
+ this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(HttpHeaderName.fromString(s));
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(MicrosoftImpactImpl.class);
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationImpl.java
new file mode 100644
index 0000000000000..153ac50e5ed26
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationImpl.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.impact.implementation;
+
+import com.azure.resourcemanager.impact.fluent.models.OperationInner;
+import com.azure.resourcemanager.impact.models.ActionType;
+import com.azure.resourcemanager.impact.models.Operation;
+import com.azure.resourcemanager.impact.models.OperationDisplay;
+import com.azure.resourcemanager.impact.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ OperationImpl(OperationInner innerObject, com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public Origin origin() {
+ return this.innerModel().origin();
+ }
+
+ public ActionType actionType() {
+ return this.innerModel().actionType();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationsClientImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..fada5bac0bb52
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationsClientImpl.java
@@ -0,0 +1,235 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.impact.fluent.OperationsClient;
+import com.azure.resourcemanager.impact.fluent.models.OperationInner;
+import com.azure.resourcemanager.impact.models.OperationListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public final class OperationsClientImpl implements OperationsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final OperationsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final MicrosoftImpactImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(MicrosoftImpactImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftImpactOperations to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftImpactOpera")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.Impact/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @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/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationsImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationsImpl.java
new file mode 100644
index 0000000000000..371d300d2b84d
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/OperationsImpl.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.impact.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.impact.fluent.OperationsClient;
+import com.azure.resourcemanager.impact.fluent.models.OperationInner;
+import com.azure.resourcemanager.impact.models.Operation;
+import com.azure.resourcemanager.impact.models.Operations;
+
+public final class OperationsImpl implements Operations {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ResourceManagerUtils.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ResourceManagerUtils.java
new file mode 100644
index 0000000000000..dd5f8caf8012f
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/ResourceManagerUtils.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.implementation;
+
+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.util.CoreUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class ResourceManagerUtils {
+ private ResourceManagerUtils() {
+ }
+
+ static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterator itr = Arrays.stream(id.split("/")).iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && !part.trim().isEmpty()) {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null) {
+ return null;
+ }
+ String parameterNameParentheses = "{" + parameterName + "}";
+ List idSegmentsReverted = Arrays.asList(id.split("/"));
+ List pathSegments = Arrays.asList(pathTemplate.split("/"));
+ Collections.reverse(idSegmentsReverted);
+ Iterator idItrReverted = idSegmentsReverted.iterator();
+ int pathIndex = pathSegments.size();
+ while (idItrReverted.hasNext() && pathIndex > 0) {
+ String idSegment = idItrReverted.next();
+ String pathSegment = pathSegments.get(--pathIndex);
+ if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) {
+ if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) {
+ if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) {
+ List segments = new ArrayList<>();
+ segments.add(idSegment);
+ idItrReverted.forEachRemaining(segments::add);
+ Collections.reverse(segments);
+ if (!segments.isEmpty() && segments.get(0).isEmpty()) {
+ segments.remove(0);
+ }
+ return String.join("/", segments);
+ } else {
+ return idSegment;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl<>(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse> pageMapper;
+
+ private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
+ super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux
+ .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ this.pagedIterable = pagedIterable;
+ this.mapper = mapper;
+ this.pageMapper = getPageMapper(mapper);
+ }
+
+ private static Function, PagedResponse> getPageMapper(Function mapper) {
+ return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(),
+ null);
+ }
+
+ @Override
+ public Stream stream() {
+ return pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(iterable.iterator(), mapper);
+ }
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactImpl.java
new file mode 100644
index 0000000000000..8a2af52f978e6
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactImpl.java
@@ -0,0 +1,93 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.impact.fluent.models.WorkloadImpactInner;
+import com.azure.resourcemanager.impact.models.WorkloadImpact;
+import com.azure.resourcemanager.impact.models.WorkloadImpactProperties;
+
+public final class WorkloadImpactImpl implements WorkloadImpact, WorkloadImpact.Definition {
+ private WorkloadImpactInner innerObject;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ WorkloadImpactImpl(WorkloadImpactInner innerObject, com.azure.resourcemanager.impact.ImpactManager 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 WorkloadImpactProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public WorkloadImpactInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.impact.ImpactManager manager() {
+ return this.serviceManager;
+ }
+
+ private String workloadImpactName;
+
+ public WorkloadImpact create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getWorkloadImpacts()
+ .create(workloadImpactName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public WorkloadImpact create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getWorkloadImpacts()
+ .create(workloadImpactName, this.innerModel(), context);
+ return this;
+ }
+
+ WorkloadImpactImpl(String name, com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerObject = new WorkloadImpactInner();
+ this.serviceManager = serviceManager;
+ this.workloadImpactName = name;
+ }
+
+ public WorkloadImpact refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getWorkloadImpacts()
+ .getWithResponse(workloadImpactName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public WorkloadImpact refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getWorkloadImpacts()
+ .getWithResponse(workloadImpactName, context)
+ .getValue();
+ return this;
+ }
+
+ public WorkloadImpactImpl withProperties(WorkloadImpactProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactsClientImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactsClientImpl.java
new file mode 100644
index 0000000000000..20fdfe57972ff
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactsClientImpl.java
@@ -0,0 +1,697 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.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.impact.fluent.WorkloadImpactsClient;
+import com.azure.resourcemanager.impact.fluent.models.WorkloadImpactInner;
+import com.azure.resourcemanager.impact.models.WorkloadImpactListResult;
+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 WorkloadImpactsClient.
+ */
+public final class WorkloadImpactsClientImpl implements WorkloadImpactsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final WorkloadImpactsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final MicrosoftImpactImpl client;
+
+ /**
+ * Initializes an instance of WorkloadImpactsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ WorkloadImpactsClientImpl(MicrosoftImpactImpl client) {
+ this.service
+ = RestProxy.create(WorkloadImpactsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftImpactWorkloadImpacts to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftImpactWorkl")
+ public interface WorkloadImpactsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts")
+ @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}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("workloadImpactName") String workloadImpactName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> create(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("workloadImpactName") String workloadImpactName,
+ @BodyParam("application/json") WorkloadImpactInner resource, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Impact/workloadImpacts/{workloadImpactName}")
+ @ExpectedResponses({ 200, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("workloadImpactName") String workloadImpactName, @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);
+ }
+
+ /**
+ * List WorkloadImpact 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 WorkloadImpact 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 WorkloadImpact 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 WorkloadImpact 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 WorkloadImpact 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 WorkloadImpact list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List WorkloadImpact 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 WorkloadImpact 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 WorkloadImpact 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 WorkloadImpact list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List WorkloadImpact 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 WorkloadImpact list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 WorkloadImpact along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String workloadImpactName) {
+ 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), workloadImpactName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 WorkloadImpact along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String workloadImpactName, 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ workloadImpactName, accept, context);
+ }
+
+ /**
+ * Get a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 WorkloadImpact on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String workloadImpactName) {
+ return getWithResponseAsync(workloadImpactName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 WorkloadImpact along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String workloadImpactName, Context context) {
+ return getWithResponseAsync(workloadImpactName, context).block();
+ }
+
+ /**
+ * Get a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 WorkloadImpact.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public WorkloadImpactInner get(String workloadImpactName) {
+ return getWithResponse(workloadImpactName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(String workloadImpactName,
+ WorkloadImpactInner 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName 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.create(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), workloadImpactName, resource, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(String workloadImpactName,
+ WorkloadImpactInner 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName 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.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ workloadImpactName, resource, accept, context);
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, WorkloadImpactInner> beginCreateAsync(String workloadImpactName,
+ WorkloadImpactInner resource) {
+ Mono>> mono = createWithResponseAsync(workloadImpactName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ WorkloadImpactInner.class, WorkloadImpactInner.class, this.client.getContext());
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, WorkloadImpactInner> beginCreateAsync(String workloadImpactName,
+ WorkloadImpactInner resource, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = createWithResponseAsync(workloadImpactName, resource, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ WorkloadImpactInner.class, WorkloadImpactInner.class, context);
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, WorkloadImpactInner> beginCreate(String workloadImpactName,
+ WorkloadImpactInner resource) {
+ return this.beginCreateAsync(workloadImpactName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, WorkloadImpactInner> beginCreate(String workloadImpactName,
+ WorkloadImpactInner resource, Context context) {
+ return this.beginCreateAsync(workloadImpactName, resource, context).getSyncPoller();
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(String workloadImpactName, WorkloadImpactInner resource) {
+ return beginCreateAsync(workloadImpactName, resource).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(String workloadImpactName, WorkloadImpactInner resource,
+ Context context) {
+ return beginCreateAsync(workloadImpactName, resource, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public WorkloadImpactInner create(String workloadImpactName, WorkloadImpactInner resource) {
+ return createAsync(workloadImpactName, resource).block();
+ }
+
+ /**
+ * Create a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workload Impact properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public WorkloadImpactInner create(String workloadImpactName, WorkloadImpactInner resource, Context context) {
+ return createAsync(workloadImpactName, resource, context).block();
+ }
+
+ /**
+ * Delete a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workloadImpactName) {
+ 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName 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(), workloadImpactName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workloadImpactName, 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 (workloadImpactName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter workloadImpactName 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(),
+ workloadImpactName, accept, context);
+ }
+
+ /**
+ * Delete a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workloadImpactName) {
+ return deleteWithResponseAsync(workloadImpactName).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Delete a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(String workloadImpactName, Context context) {
+ return deleteWithResponseAsync(workloadImpactName, context).block();
+ }
+
+ /**
+ * Delete a WorkloadImpact.
+ *
+ * @param workloadImpactName workloadImpact 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 workloadImpactName) {
+ deleteWithResponse(workloadImpactName, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a WorkloadImpact 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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 WorkloadImpact 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));
+ }
+}
diff --git a/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactsImpl.java b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactsImpl.java
new file mode 100644
index 0000000000000..85c09e1d254b4
--- /dev/null
+++ b/sdk/impact/azure-resourcemanager-impact/src/main/java/com/azure/resourcemanager/impact/implementation/WorkloadImpactsImpl.java
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.impact.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.impact.fluent.WorkloadImpactsClient;
+import com.azure.resourcemanager.impact.fluent.models.WorkloadImpactInner;
+import com.azure.resourcemanager.impact.models.WorkloadImpact;
+import com.azure.resourcemanager.impact.models.WorkloadImpacts;
+
+public final class WorkloadImpactsImpl implements WorkloadImpacts {
+ private static final ClientLogger LOGGER = new ClientLogger(WorkloadImpactsImpl.class);
+
+ private final WorkloadImpactsClient innerClient;
+
+ private final com.azure.resourcemanager.impact.ImpactManager serviceManager;
+
+ public WorkloadImpactsImpl(WorkloadImpactsClient innerClient,
+ com.azure.resourcemanager.impact.ImpactManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadImpactImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable