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 SaaS service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the SaaS service API instance.
+ */
+ public SaaSManager 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.saas")
+ .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 SaaSManager(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 Applications.
+ *
+ * @return Resource collection API of Applications.
+ */
+ public Applications applications() {
+ if (this.applications == null) {
+ this.applications = new ApplicationsImpl(clientObject.getApplications(), this);
+ }
+ return applications;
+ }
+
+ /**
+ * Gets the resource collection API of SaaS.
+ *
+ * @return Resource collection API of SaaS.
+ */
+ public SaaS saaS() {
+ if (this.saaS == null) {
+ this.saaS = new SaaSImpl(clientObject.getSaaS(), this);
+ }
+ return saaS;
+ }
+
+ /**
+ * Gets the resource collection API of SaasResources.
+ *
+ * @return Resource collection API of SaasResources.
+ */
+ public SaasResources saasResources() {
+ if (this.saasResources == null) {
+ this.saasResources = new SaasResourcesImpl(clientObject.getSaasResources(), this);
+ }
+ return saasResources;
+ }
+
+ /**
+ * Gets the resource collection API of ResourceProviders.
+ *
+ * @return Resource collection API of ResourceProviders.
+ */
+ public ResourceProviders resourceProviders() {
+ if (this.resourceProviders == null) {
+ this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this);
+ }
+ return resourceProviders;
+ }
+
+ /**
+ * Gets the resource collection API of SaasSubscriptionLevels. It manages SaasResource.
+ *
+ * @return Resource collection API of SaasSubscriptionLevels.
+ */
+ public SaasSubscriptionLevels saasSubscriptionLevels() {
+ if (this.saasSubscriptionLevels == null) {
+ this.saasSubscriptionLevels =
+ new SaasSubscriptionLevelsImpl(clientObject.getSaasSubscriptionLevels(), this);
+ }
+ return saasSubscriptionLevels;
+ }
+
+ /**
+ * Gets the resource collection API of SaaSOperations.
+ *
+ * @return Resource collection API of SaaSOperations.
+ */
+ public SaaSOperations saaSOperations() {
+ if (this.saaSOperations == null) {
+ this.saaSOperations = new SaaSOperationsImpl(clientObject.getSaaSOperations(), this);
+ }
+ return saaSOperations;
+ }
+
+ /**
+ * @return Wrapped service client SaaSManagementClient providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ */
+ public SaaSManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/ApplicationsClient.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/ApplicationsClient.java
new file mode 100644
index 000000000000..1a3657fb6274
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/ApplicationsClient.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.saas.fluent.models.SaasAppInner;
+
+/** An instance of this class provides access to all the operations defined in ApplicationsClient. */
+public interface ApplicationsClient {
+ /**
+ * Gets all SaaS resources by subscription id and resource group name.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 all SaaS resources by subscription id and resource group name as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Gets all SaaS resources by subscription id and resource group name.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 all SaaS resources by subscription id and resource group name as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/OperationsClient.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/OperationsClient.java
new file mode 100644
index 000000000000..53a37318c2bd
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/OperationsClient.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.saas.fluent.models.SaasAppOperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Gets all SaaS app operations.
+ *
+ * @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 all SaaS app operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets all SaaS app operations.
+ *
+ * @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 all SaaS app operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/ResourceProvidersClient.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/ResourceProvidersClient.java
new file mode 100644
index 000000000000..2810e8ebb308
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/ResourceProvidersClient.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.saas.fluent.models.AccessTokenResultInner;
+
+/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */
+public interface ResourceProvidersClient {
+ /**
+ * Gets the ISV access token for a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @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 ISV access token for a SaaS resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response saasResourceListAccessTokenWithResponse(String resourceId, Context context);
+
+ /**
+ * Gets the ISV access token for a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @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 ISV access token for a SaaS resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AccessTokenResultInner saasResourceListAccessToken(String resourceId);
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSClient.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSClient.java
new file mode 100644
index 000000000000..156f85a059b8
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSClient.java
@@ -0,0 +1,212 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+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.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.DeleteOptions;
+import com.azure.resourcemanager.saas.models.SaasResourceCreation;
+
+/** An instance of this class provides access to all the operations defined in SaaSClient. */
+public interface SaaSClient {
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceId, DeleteOptions parameters);
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceId, DeleteOptions parameters, Context context);
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceId, DeleteOptions parameters);
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceId, DeleteOptions parameters, Context context);
+
+ /**
+ * Gets information about the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @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 information about the specified SaaS along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getResourceWithResponse(String resourceId, Context context);
+
+ /**
+ * Gets information about the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @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 information about the specified SaaS.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner getResource(String resourceId);
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginUpdateResource(
+ String resourceId, SaasResourceCreation parameters);
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginUpdateResource(
+ String resourceId, SaasResourceCreation parameters, Context context);
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner updateResource(String resourceId, SaasResourceCreation parameters);
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner updateResource(String resourceId, SaasResourceCreation parameters, Context context);
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginCreateResource(SaasResourceCreation parameters);
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginCreateResource(
+ SaasResourceCreation parameters, Context context);
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner createResource(SaasResourceCreation parameters);
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner createResource(SaasResourceCreation parameters, Context context);
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSManagementClient.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSManagementClient.java
new file mode 100644
index 000000000000..8adc10ccdcb4
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSManagementClient.java
@@ -0,0 +1,95 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for SaaSManagementClient class. */
+public interface SaaSManagementClient {
+ /**
+ * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ *
+ * @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 ApplicationsClient object to access its operations.
+ *
+ * @return the ApplicationsClient object.
+ */
+ ApplicationsClient getApplications();
+
+ /**
+ * Gets the SaaSClient object to access its operations.
+ *
+ * @return the SaaSClient object.
+ */
+ SaaSClient getSaaS();
+
+ /**
+ * Gets the SaasResourcesClient object to access its operations.
+ *
+ * @return the SaasResourcesClient object.
+ */
+ SaasResourcesClient getSaasResources();
+
+ /**
+ * Gets the ResourceProvidersClient object to access its operations.
+ *
+ * @return the ResourceProvidersClient object.
+ */
+ ResourceProvidersClient getResourceProviders();
+
+ /**
+ * Gets the SaasSubscriptionLevelsClient object to access its operations.
+ *
+ * @return the SaasSubscriptionLevelsClient object.
+ */
+ SaasSubscriptionLevelsClient getSaasSubscriptionLevels();
+
+ /**
+ * Gets the SaaSOperationsClient object to access its operations.
+ *
+ * @return the SaaSOperationsClient object.
+ */
+ SaaSOperationsClient getSaaSOperations();
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSOperationsClient.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSOperationsClient.java
new file mode 100644
index 000000000000..111c8739892d
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaaSOperationsClient.java
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+
+/** An instance of this class provides access to all the operations defined in SaaSOperationsClient. */
+public interface SaaSOperationsClient {
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginGet(String operationId);
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginGet(String operationId, Context context);
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner get(String operationId);
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner get(String operationId, Context context);
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaasResourcesClient.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaasResourcesClient.java
new file mode 100644
index 000000000000..c248b65ed805
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaasResourcesClient.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.saas.fluent.models.SaasResourceInner;
+
+/** An instance of this class provides access to all the operations defined in SaasResourcesClient. */
+public interface SaasResourcesClient {
+ /**
+ * Get All Resources.
+ *
+ * @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 all Resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Get All Resources.
+ *
+ * @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 all Resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaasSubscriptionLevelsClient.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaasSubscriptionLevelsClient.java
new file mode 100644
index 000000000000..422e6b57809c
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/SaasSubscriptionLevelsClient.java
@@ -0,0 +1,440 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.saas.fluent.models.AccessTokenResultInner;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.DeleteOptions;
+import com.azure.resourcemanager.saas.models.MoveResource;
+import com.azure.resourcemanager.saas.models.SaasResourceCreation;
+
+/** An instance of this class provides access to all the operations defined in SaasSubscriptionLevelsClient. */
+public interface SaasSubscriptionLevelsClient {
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain Azure 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 information about all the Subscription Level SaaS in a certain Azure subscription as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain Azure subscription.
+ *
+ * @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 information about all the Subscription Level SaaS in a certain Azure subscription as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 information about all the Subscription Level SaaS in a certain resource group as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 information about all the Subscription Level SaaS in a certain resource group as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Gets information about the specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 information about the specified Subscription Level SaaS along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String resourceName, Context context);
+
+ /**
+ * Gets information about the specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 information about the specified Subscription Level SaaS.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner getByResourceGroup(String resourceGroupName, String resourceName);
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters);
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context);
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner createOrUpdate(String resourceGroupName, String resourceName, SaasResourceCreation parameters);
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner createOrUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context);
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters);
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SaasResourceInner> beginUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context);
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner update(String resourceGroupName, String resourceName, SaasResourceCreation parameters);
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SaasResourceInner update(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context);
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName);
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context);
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String resourceName);
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String resourceName, Context context);
+
+ /**
+ * Unsubscribe from a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to unsubscribe saas operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginUpdateToUnsubscribed(
+ String resourceGroupName, String resourceName, DeleteOptions parameters);
+
+ /**
+ * Unsubscribe from a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to unsubscribe saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginUpdateToUnsubscribed(
+ String resourceGroupName, String resourceName, DeleteOptions parameters, Context context);
+
+ /**
+ * Unsubscribe from a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to unsubscribe saas operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void updateToUnsubscribed(String resourceGroupName, String resourceName, DeleteOptions parameters);
+
+ /**
+ * Unsubscribe from a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to unsubscribe saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void updateToUnsubscribed(String resourceGroupName, String resourceName, DeleteOptions parameters, Context context);
+
+ /**
+ * Gets the ISV access token for a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 ISV access token for a specified Subscription Level SaaS along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listAccessTokenWithResponse(
+ String resourceGroupName, String resourceName, Context context);
+
+ /**
+ * Gets the ISV access token for a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 ISV access token for a specified Subscription Level SaaS.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AccessTokenResultInner listAccessToken(String resourceGroupName, String resourceName);
+
+ /**
+ * Validate whether a specified Subscription Level SaaS can be moved.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param moveResourceParameter Object that represents the resources to move.
+ * @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 validateMoveResourcesWithResponse(
+ String resourceGroupName, MoveResource moveResourceParameter, Context context);
+
+ /**
+ * Validate whether a specified Subscription Level SaaS can be moved.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param moveResourceParameter Object that represents the resources to move.
+ * @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 validateMoveResources(String resourceGroupName, MoveResource moveResourceParameter);
+
+ /**
+ * Move a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param moveResourceParameter Object that represents the resources to move.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginMoveResources(String resourceGroupName, MoveResource moveResourceParameter);
+
+ /**
+ * Move a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param moveResourceParameter Object that represents the resources to move.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginMoveResources(
+ String resourceGroupName, MoveResource moveResourceParameter, Context context);
+
+ /**
+ * Move a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param moveResourceParameter Object that represents the resources to move.
+ * @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 moveResources(String resourceGroupName, MoveResource moveResourceParameter);
+
+ /**
+ * Move a specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param moveResourceParameter Object that represents the resources to move.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void moveResources(String resourceGroupName, MoveResource moveResourceParameter, Context context);
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/AccessTokenResultInner.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/AccessTokenResultInner.java
new file mode 100644
index 000000000000..305e04ef2d41
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/AccessTokenResultInner.java
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** the ISV access token result response. */
+@Fluent
+public final class AccessTokenResultInner {
+ /*
+ * The Publisher Offer Base Uri
+ */
+ @JsonProperty(value = "publisherOfferBaseUri")
+ private String publisherOfferBaseUri;
+
+ /*
+ * The generated token
+ */
+ @JsonProperty(value = "token")
+ private String token;
+
+ /** Creates an instance of AccessTokenResultInner class. */
+ public AccessTokenResultInner() {
+ }
+
+ /**
+ * Get the publisherOfferBaseUri property: The Publisher Offer Base Uri.
+ *
+ * @return the publisherOfferBaseUri value.
+ */
+ public String publisherOfferBaseUri() {
+ return this.publisherOfferBaseUri;
+ }
+
+ /**
+ * Set the publisherOfferBaseUri property: The Publisher Offer Base Uri.
+ *
+ * @param publisherOfferBaseUri the publisherOfferBaseUri value to set.
+ * @return the AccessTokenResultInner object itself.
+ */
+ public AccessTokenResultInner withPublisherOfferBaseUri(String publisherOfferBaseUri) {
+ this.publisherOfferBaseUri = publisherOfferBaseUri;
+ return this;
+ }
+
+ /**
+ * Get the token property: The generated token.
+ *
+ * @return the token value.
+ */
+ public String token() {
+ return this.token;
+ }
+
+ /**
+ * Set the token property: The generated token.
+ *
+ * @param token the token value to set.
+ * @return the AccessTokenResultInner object itself.
+ */
+ public AccessTokenResultInner withToken(String token) {
+ this.token = token;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasAppInner.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasAppInner.java
new file mode 100644
index 000000000000..f25d8e9c8b7e
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasAppInner.java
@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.saas.models.SaasAppProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
+/** the saasApp resource. */
+@Fluent
+public final class SaasAppInner {
+ /*
+ * the resource Id.
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /*
+ * the resource location.
+ */
+ @JsonProperty(value = "location")
+ private String location;
+
+ /*
+ * the resource name.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * the resource type.
+ */
+ @JsonProperty(value = "type")
+ private String type;
+
+ /*
+ * the resource properties.
+ */
+ @JsonProperty(value = "properties")
+ private SaasAppProperties properties;
+
+ /*
+ * the resource tags.
+ */
+ @JsonProperty(value = "tags")
+ @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
+ private Map tags;
+
+ /** Creates an instance of SaasAppInner class. */
+ public SaasAppInner() {
+ }
+
+ /**
+ * Get the id property: the resource Id.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the location property: the resource location.
+ *
+ * @return the location value.
+ */
+ public String location() {
+ return this.location;
+ }
+
+ /**
+ * Set the location property: the resource location.
+ *
+ * @param location the location value to set.
+ * @return the SaasAppInner object itself.
+ */
+ public SaasAppInner withLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ /**
+ * Get the name property: the resource name.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: the resource name.
+ *
+ * @param name the name value to set.
+ * @return the SaasAppInner object itself.
+ */
+ public SaasAppInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the type property: the resource type.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set the type property: the resource type.
+ *
+ * @param type the type value to set.
+ * @return the SaasAppInner object itself.
+ */
+ public SaasAppInner withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get the properties property: the resource properties.
+ *
+ * @return the properties value.
+ */
+ public SaasAppProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: the resource properties.
+ *
+ * @param properties the properties value to set.
+ * @return the SaasAppInner object itself.
+ */
+ public SaasAppInner withProperties(SaasAppProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the tags property: the resource tags.
+ *
+ * @return the tags value.
+ */
+ public Map tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags property: the resource tags.
+ *
+ * @param tags the tags value to set.
+ * @return the SaasAppInner object itself.
+ */
+ public SaasAppInner withTags(Map tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasAppOperationInner.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasAppOperationInner.java
new file mode 100644
index 000000000000..a5859474f316
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasAppOperationInner.java
@@ -0,0 +1,132 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.saas.models.SaasAppOperationDisplay;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** saas app operations. */
+@Fluent
+public final class SaasAppOperationInner {
+ /*
+ * the operation name
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * the operation display
+ */
+ @JsonProperty(value = "display")
+ private SaasAppOperationDisplay display;
+
+ /*
+ * the operation origin
+ */
+ @JsonProperty(value = "origin")
+ private String origin;
+
+ /*
+ * whether the operation is a data action or not.
+ */
+ @JsonProperty(value = "isDataAction")
+ private Boolean isDataAction;
+
+ /** Creates an instance of SaasAppOperationInner class. */
+ public SaasAppOperationInner() {
+ }
+
+ /**
+ * Get the name property: the operation name.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: the operation name.
+ *
+ * @param name the name value to set.
+ * @return the SaasAppOperationInner object itself.
+ */
+ public SaasAppOperationInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the display property: the operation display.
+ *
+ * @return the display value.
+ */
+ public SaasAppOperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: the operation display.
+ *
+ * @param display the display value to set.
+ * @return the SaasAppOperationInner object itself.
+ */
+ public SaasAppOperationInner withDisplay(SaasAppOperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: the operation origin.
+ *
+ * @return the origin value.
+ */
+ public String origin() {
+ return this.origin;
+ }
+
+ /**
+ * Set the origin property: the operation origin.
+ *
+ * @param origin the origin value to set.
+ * @return the SaasAppOperationInner object itself.
+ */
+ public SaasAppOperationInner withOrigin(String origin) {
+ this.origin = origin;
+ return this;
+ }
+
+ /**
+ * Get the isDataAction property: whether the operation is a data action or not.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Set the isDataAction property: whether the operation is a data action or not.
+ *
+ * @param isDataAction the isDataAction value to set.
+ * @return the SaasAppOperationInner object itself.
+ */
+ public SaasAppOperationInner withIsDataAction(Boolean isDataAction) {
+ this.isDataAction = isDataAction;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasResourceInner.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasResourceInner.java
new file mode 100644
index 000000000000..b8fab78e8d66
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/SaasResourceInner.java
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.resourcemanager.saas.models.SaasResourceProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
+/** SaaS REST API resource definition. */
+@Fluent
+public final class SaasResourceInner extends ProxyResource {
+ /*
+ * saas properties
+ */
+ @JsonProperty(value = "properties")
+ private SaasResourceProperties properties;
+
+ /*
+ * the resource tags.
+ */
+ @JsonProperty(value = "tags")
+ @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
+ private Map tags;
+
+ /** Creates an instance of SaasResourceInner class. */
+ public SaasResourceInner() {
+ }
+
+ /**
+ * Get the properties property: saas properties.
+ *
+ * @return the properties value.
+ */
+ public SaasResourceProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: saas properties.
+ *
+ * @param properties the properties value to set.
+ * @return the SaasResourceInner object itself.
+ */
+ public SaasResourceInner withProperties(SaasResourceProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the tags property: the resource tags.
+ *
+ * @return the tags value.
+ */
+ public Map tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags property: the resource tags.
+ *
+ * @param tags the tags value to set.
+ * @return the SaasResourceInner object itself.
+ */
+ public SaasResourceInner withTags(Map tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/package-info.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/package-info.java
new file mode 100644
index 000000000000..c2a4e2c8f596
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/models/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the inner data models for SaaSManagementClient. REST APIs for Azure Marketplace SaaS Offers. */
+package com.azure.resourcemanager.saas.fluent.models;
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/package-info.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/package-info.java
new file mode 100644
index 000000000000..380ba414189b
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/fluent/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the service clients for SaaSManagementClient. REST APIs for Azure Marketplace SaaS Offers. */
+package com.azure.resourcemanager.saas.fluent;
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/AccessTokenResultImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/AccessTokenResultImpl.java
new file mode 100644
index 000000000000..cc2958a54865
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/AccessTokenResultImpl.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.resourcemanager.saas.fluent.models.AccessTokenResultInner;
+import com.azure.resourcemanager.saas.models.AccessTokenResult;
+
+public final class AccessTokenResultImpl implements AccessTokenResult {
+ private AccessTokenResultInner innerObject;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ AccessTokenResultImpl(
+ AccessTokenResultInner innerObject, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String publisherOfferBaseUri() {
+ return this.innerModel().publisherOfferBaseUri();
+ }
+
+ public String token() {
+ return this.innerModel().token();
+ }
+
+ public AccessTokenResultInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ApplicationsClientImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ApplicationsClientImpl.java
new file mode 100644
index 000000000000..7238b13e4a97
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ApplicationsClientImpl.java
@@ -0,0 +1,324 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.saas.fluent.ApplicationsClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasAppInner;
+import com.azure.resourcemanager.saas.models.SaasAppResponseWithContinuation;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ApplicationsClient. */
+public final class ApplicationsClientImpl implements ApplicationsClient {
+ /** The proxy service used to perform REST calls. */
+ private final ApplicationsService service;
+
+ /** The service client containing this operation class. */
+ private final SaaSManagementClientImpl client;
+
+ /**
+ * Initializes an instance of ApplicationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ApplicationsClientImpl(SaaSManagementClientImpl client) {
+ this.service =
+ RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SaaSManagementClientApplications to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SaaSManagementClient")
+ public interface ApplicationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SaaS/applications")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @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);
+ }
+
+ /**
+ * Gets all SaaS resources by subscription id and resource group name.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all SaaS resources by subscription id and resource group name along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ 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()));
+ }
+
+ /**
+ * Gets all SaaS resources by subscription id and resource group name.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 all SaaS resources by subscription id and resource group name along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets all SaaS resources by subscription id and resource group name.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all SaaS resources by subscription id and resource group name as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets all SaaS resources by subscription id and resource group name.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 all SaaS resources by subscription id and resource group name as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all SaaS resources by subscription id and resource group name.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all SaaS resources by subscription id and resource group name as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Gets all SaaS resources by subscription id and resource group name.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 all SaaS resources by subscription id and resource group name as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saas app response with continuation along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saas app response with continuation 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/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ApplicationsImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ApplicationsImpl.java
new file mode 100644
index 000000000000..d711c5c2d0f2
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ApplicationsImpl.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.saas.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.saas.fluent.ApplicationsClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasAppInner;
+import com.azure.resourcemanager.saas.models.Applications;
+import com.azure.resourcemanager.saas.models.SaasApp;
+
+public final class ApplicationsImpl implements Applications {
+ private static final ClientLogger LOGGER = new ClientLogger(ApplicationsImpl.class);
+
+ private final ApplicationsClient innerClient;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ public ApplicationsImpl(ApplicationsClient innerClient, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new SaasAppImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new SaasAppImpl(inner1, this.manager()));
+ }
+
+ private ApplicationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/OperationsClientImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/OperationsClientImpl.java
new file mode 100644
index 000000000000..ec755135f5fe
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/OperationsClientImpl.java
@@ -0,0 +1,270 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.saas.fluent.OperationsClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasAppOperationInner;
+import com.azure.resourcemanager.saas.models.SaasAppOperationsResponseWithContinuation;
+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 SaaSManagementClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(SaaSManagementClientImpl client) {
+ this.service =
+ RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SaaSManagementClientOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SaaSManagementClient")
+ public interface OperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.SaaS/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);
+ }
+
+ /**
+ * Gets all SaaS app operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all SaaS app operations 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()));
+ }
+
+ /**
+ * Gets all SaaS app operations.
+ *
+ * @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 all SaaS app operations 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));
+ }
+
+ /**
+ * Gets all SaaS app operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all SaaS app operations as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets all SaaS app operations.
+ *
+ * @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 all SaaS app operations as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all SaaS app operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all SaaS app operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Gets all SaaS app operations.
+ *
+ * @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 all SaaS app operations 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
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saas app operation response with continuation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saas app operation response with continuation 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/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/OperationsImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/OperationsImpl.java
new file mode 100644
index 000000000000..fd7bc874cad4
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/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.saas.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.saas.fluent.OperationsClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasAppOperationInner;
+import com.azure.resourcemanager.saas.models.Operations;
+import com.azure.resourcemanager.saas.models.SaasAppOperation;
+
+public final class OperationsImpl implements Operations {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new SaasAppOperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new SaasAppOperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ResourceProvidersClientImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ResourceProvidersClientImpl.java
new file mode 100644
index 000000000000..585595ebdc35
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ResourceProvidersClientImpl.java
@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.saas.fluent.ResourceProvidersClient;
+import com.azure.resourcemanager.saas.fluent.models.AccessTokenResultInner;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */
+public final class ResourceProvidersClientImpl implements ResourceProvidersClient {
+ /** The proxy service used to perform REST calls. */
+ private final ResourceProvidersService service;
+
+ /** The service client containing this operation class. */
+ private final SaaSManagementClientImpl client;
+
+ /**
+ * Initializes an instance of ResourceProvidersClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ResourceProvidersClientImpl(SaaSManagementClientImpl client) {
+ this.service =
+ RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SaaSManagementClientResourceProviders to be used by the proxy service
+ * to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SaaSManagementClient")
+ public interface ResourceProvidersService {
+ @Headers({"Content-Type: application/json"})
+ @Post("/providers/Microsoft.SaaS/saasresources/{resourceId}/listAccessToken")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> saasResourceListAccessToken(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceId") String resourceId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets the ISV access token for a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the ISV access token for a SaaS resource along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> saasResourceListAccessTokenWithResponseAsync(String resourceId) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .saasResourceListAccessToken(
+ this.client.getEndpoint(), resourceId, this.client.getApiVersion(), accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the ISV access token for a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @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 ISV access token for a SaaS resource along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> saasResourceListAccessTokenWithResponseAsync(
+ String resourceId, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .saasResourceListAccessToken(
+ this.client.getEndpoint(), resourceId, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Gets the ISV access token for a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the ISV access token for a SaaS resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono saasResourceListAccessTokenAsync(String resourceId) {
+ return saasResourceListAccessTokenWithResponseAsync(resourceId)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets the ISV access token for a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @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 ISV access token for a SaaS resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response saasResourceListAccessTokenWithResponse(
+ String resourceId, Context context) {
+ return saasResourceListAccessTokenWithResponseAsync(resourceId, context).block();
+ }
+
+ /**
+ * Gets the ISV access token for a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the ISV access token for a SaaS resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AccessTokenResultInner saasResourceListAccessToken(String resourceId) {
+ return saasResourceListAccessTokenWithResponse(resourceId, Context.NONE).getValue();
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ResourceProvidersImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ResourceProvidersImpl.java
new file mode 100644
index 000000000000..879234aa7c4c
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/ResourceProvidersImpl.java
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.saas.fluent.ResourceProvidersClient;
+import com.azure.resourcemanager.saas.fluent.models.AccessTokenResultInner;
+import com.azure.resourcemanager.saas.models.AccessTokenResult;
+import com.azure.resourcemanager.saas.models.ResourceProviders;
+
+public final class ResourceProvidersImpl implements ResourceProviders {
+ private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class);
+
+ private final ResourceProvidersClient innerClient;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ public ResourceProvidersImpl(
+ ResourceProvidersClient innerClient, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response saasResourceListAccessTokenWithResponse(String resourceId, Context context) {
+ Response inner =
+ this.serviceClient().saasResourceListAccessTokenWithResponse(resourceId, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new AccessTokenResultImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public AccessTokenResult saasResourceListAccessToken(String resourceId) {
+ AccessTokenResultInner inner = this.serviceClient().saasResourceListAccessToken(resourceId);
+ if (inner != null) {
+ return new AccessTokenResultImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private ResourceProvidersClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSClientImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSClientImpl.java
new file mode 100644
index 000000000000..c51b2c9ed1a3
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSClientImpl.java
@@ -0,0 +1,859 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.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.saas.fluent.SaaSClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.DeleteOptions;
+import com.azure.resourcemanager.saas.models.SaasResourceCreation;
+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 SaaSClient. */
+public final class SaaSClientImpl implements SaaSClient {
+ /** The proxy service used to perform REST calls. */
+ private final SaaSService service;
+
+ /** The service client containing this operation class. */
+ private final SaaSManagementClientImpl client;
+
+ /**
+ * Initializes an instance of SaaSClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ SaaSClientImpl(SaaSManagementClientImpl client) {
+ this.service = RestProxy.create(SaaSService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SaaSManagementClientSaaS to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SaaSManagementClient")
+ public interface SaaSService {
+ @Headers({"Content-Type: application/json"})
+ @Delete("/providers/Microsoft.SaaS/saasresources/{resourceId}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceId") String resourceId,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") DeleteOptions parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.SaaS/saasresources/{resourceId}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getResource(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceId") String resourceId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch("/providers/Microsoft.SaaS/saasresources/{resourceId}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> updateResource(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceId") String resourceId,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") SaasResourceCreation parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put("/providers/Microsoft.SaaS/saasresources")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createResource(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") SaasResourceCreation parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas 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 resourceId, DeleteOptions parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ resourceId,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @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 resourceId, DeleteOptions parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(this.client.getEndpoint(), resourceId, this.client.getApiVersion(), parameters, accept, context);
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceId, DeleteOptions parameters) {
+ Mono>> mono = deleteWithResponseAsync(resourceId, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceId, DeleteOptions parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceId, parameters, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceId, DeleteOptions parameters) {
+ return this.beginDeleteAsync(resourceId, parameters).getSyncPoller();
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceId, DeleteOptions parameters, Context context) {
+ return this.beginDeleteAsync(resourceId, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceId, DeleteOptions parameters) {
+ return beginDeleteAsync(resourceId, parameters).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceId, DeleteOptions parameters, Context context) {
+ return beginDeleteAsync(resourceId, parameters, context).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceId, DeleteOptions parameters) {
+ deleteAsync(resourceId, parameters).block();
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to delete saas operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceId, DeleteOptions parameters, Context context) {
+ deleteAsync(resourceId, parameters, context).block();
+ }
+
+ /**
+ * Gets information about the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified SaaS along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getResourceWithResponseAsync(String resourceId) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getResource(
+ this.client.getEndpoint(), resourceId, this.client.getApiVersion(), accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets information about the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @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 information about the specified SaaS along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getResourceWithResponseAsync(String resourceId, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.getResource(this.client.getEndpoint(), resourceId, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Gets information about the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified SaaS on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getResourceAsync(String resourceId) {
+ return getResourceWithResponseAsync(resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets information about the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @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 information about the specified SaaS along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getResourceWithResponse(String resourceId, Context context) {
+ return getResourceWithResponseAsync(resourceId, context).block();
+ }
+
+ /**
+ * Gets information about the specified SaaS.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified SaaS.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner getResource(String resourceId) {
+ return getResourceWithResponse(resourceId, Context.NONE).getValue();
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateResourceWithResponseAsync(
+ String resourceId, SaasResourceCreation parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .updateResource(
+ this.client.getEndpoint(),
+ resourceId,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateResourceWithResponseAsync(
+ String resourceId, SaasResourceCreation parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .updateResource(
+ this.client.getEndpoint(), resourceId, this.client.getApiVersion(), parameters, accept, context);
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginUpdateResourceAsync(
+ String resourceId, SaasResourceCreation parameters) {
+ Mono>> mono = updateResourceWithResponseAsync(resourceId, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ SaasResourceInner.class,
+ SaasResourceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginUpdateResourceAsync(
+ String resourceId, SaasResourceCreation parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = updateResourceWithResponseAsync(resourceId, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), SaasResourceInner.class, SaasResourceInner.class, context);
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginUpdateResource(
+ String resourceId, SaasResourceCreation parameters) {
+ return this.beginUpdateResourceAsync(resourceId, parameters).getSyncPoller();
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginUpdateResource(
+ String resourceId, SaasResourceCreation parameters, Context context) {
+ return this.beginUpdateResourceAsync(resourceId, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateResourceAsync(String resourceId, SaasResourceCreation parameters) {
+ return beginUpdateResourceAsync(resourceId, parameters).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateResourceAsync(
+ String resourceId, SaasResourceCreation parameters, Context context) {
+ return beginUpdateResourceAsync(resourceId, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner updateResource(String resourceId, SaasResourceCreation parameters) {
+ return updateResourceAsync(resourceId, parameters).block();
+ }
+
+ /**
+ * Updates a SaaS resource.
+ *
+ * @param resourceId The Saas resource ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner updateResource(String resourceId, SaasResourceCreation parameters, Context context) {
+ return updateResourceAsync(resourceId, parameters, context).block();
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas 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 saaS REST API resource definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createResourceWithResponseAsync(SaasResourceCreation parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createResource(
+ this.client.getEndpoint(), this.client.getApiVersion(), parameters, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas operation.
+ * @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 saaS REST API resource definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createResourceWithResponseAsync(
+ SaasResourceCreation parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createResource(this.client.getEndpoint(), this.client.getApiVersion(), parameters, accept, context);
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginCreateResourceAsync(
+ SaasResourceCreation parameters) {
+ Mono>> mono = createResourceWithResponseAsync(parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ SaasResourceInner.class,
+ SaasResourceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginCreateResourceAsync(
+ SaasResourceCreation parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = createResourceWithResponseAsync(parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), SaasResourceInner.class, SaasResourceInner.class, context);
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginCreateResource(
+ SaasResourceCreation parameters) {
+ return this.beginCreateResourceAsync(parameters).getSyncPoller();
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginCreateResource(
+ SaasResourceCreation parameters, Context context) {
+ return this.beginCreateResourceAsync(parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas 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 saaS REST API resource definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createResourceAsync(SaasResourceCreation parameters) {
+ return beginCreateResourceAsync(parameters).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas operation.
+ * @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 saaS REST API resource definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createResourceAsync(SaasResourceCreation parameters, Context context) {
+ return beginCreateResourceAsync(parameters, context).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner createResource(SaasResourceCreation parameters) {
+ return createResourceAsync(parameters).block();
+ }
+
+ /**
+ * Creates a SaaS resource.
+ *
+ * @param parameters Parameters supplied to the create saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner createResource(SaasResourceCreation parameters, Context context) {
+ return createResourceAsync(parameters, context).block();
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSImpl.java
new file mode 100644
index 000000000000..fe0989efc60e
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSImpl.java
@@ -0,0 +1,103 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.saas.fluent.SaaSClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.DeleteOptions;
+import com.azure.resourcemanager.saas.models.SaaS;
+import com.azure.resourcemanager.saas.models.SaasResource;
+import com.azure.resourcemanager.saas.models.SaasResourceCreation;
+
+public final class SaaSImpl implements SaaS {
+ private static final ClientLogger LOGGER = new ClientLogger(SaaSImpl.class);
+
+ private final SaaSClient innerClient;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ public SaaSImpl(SaaSClient innerClient, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public void delete(String resourceId, DeleteOptions parameters) {
+ this.serviceClient().delete(resourceId, parameters);
+ }
+
+ public void delete(String resourceId, DeleteOptions parameters, Context context) {
+ this.serviceClient().delete(resourceId, parameters, context);
+ }
+
+ public Response getResourceWithResponse(String resourceId, Context context) {
+ Response inner = this.serviceClient().getResourceWithResponse(resourceId, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new SaasResourceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public SaasResource getResource(String resourceId) {
+ SaasResourceInner inner = this.serviceClient().getResource(resourceId);
+ if (inner != null) {
+ return new SaasResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public SaasResource updateResource(String resourceId, SaasResourceCreation parameters) {
+ SaasResourceInner inner = this.serviceClient().updateResource(resourceId, parameters);
+ if (inner != null) {
+ return new SaasResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public SaasResource updateResource(String resourceId, SaasResourceCreation parameters, Context context) {
+ SaasResourceInner inner = this.serviceClient().updateResource(resourceId, parameters, context);
+ if (inner != null) {
+ return new SaasResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public SaasResource createResource(SaasResourceCreation parameters) {
+ SaasResourceInner inner = this.serviceClient().createResource(parameters);
+ if (inner != null) {
+ return new SaasResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public SaasResource createResource(SaasResourceCreation parameters, Context context) {
+ SaasResourceInner inner = this.serviceClient().createResource(parameters, context);
+ if (inner != null) {
+ return new SaasResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private SaaSClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSManagementClientBuilder.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSManagementClientBuilder.java
new file mode 100644
index 000000000000..54abbbe96148
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSManagementClientBuilder.java
@@ -0,0 +1,144 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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 SaaSManagementClientImpl type. */
+@ServiceClientBuilder(serviceClients = {SaaSManagementClientImpl.class})
+public final class SaaSManagementClientBuilder {
+ /*
+ * The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the SaaSManagementClientBuilder.
+ */
+ public SaaSManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the SaaSManagementClientBuilder.
+ */
+ public SaaSManagementClientBuilder 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 SaaSManagementClientBuilder.
+ */
+ public SaaSManagementClientBuilder 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 SaaSManagementClientBuilder.
+ */
+ public SaaSManagementClientBuilder 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 SaaSManagementClientBuilder.
+ */
+ public SaaSManagementClientBuilder 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 SaaSManagementClientBuilder.
+ */
+ public SaaSManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of SaaSManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of SaaSManagementClientImpl.
+ */
+ public SaaSManagementClientImpl 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();
+ SaaSManagementClientImpl client =
+ new SaaSManagementClientImpl(
+ localPipeline,
+ localSerializerAdapter,
+ localDefaultPollInterval,
+ localEnvironment,
+ subscriptionId,
+ localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSManagementClientImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSManagementClientImpl.java
new file mode 100644
index 000000000000..3da9ef76ffb4
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSManagementClientImpl.java
@@ -0,0 +1,375 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.saas.fluent.ApplicationsClient;
+import com.azure.resourcemanager.saas.fluent.OperationsClient;
+import com.azure.resourcemanager.saas.fluent.ResourceProvidersClient;
+import com.azure.resourcemanager.saas.fluent.SaaSClient;
+import com.azure.resourcemanager.saas.fluent.SaaSManagementClient;
+import com.azure.resourcemanager.saas.fluent.SaaSOperationsClient;
+import com.azure.resourcemanager.saas.fluent.SaasResourcesClient;
+import com.azure.resourcemanager.saas.fluent.SaasSubscriptionLevelsClient;
+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 SaaSManagementClientImpl type. */
+@ServiceClient(builder = SaaSManagementClientBuilder.class)
+public final class SaaSManagementClientImpl implements SaaSManagementClient {
+ /** The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */
+ private final String subscriptionId;
+
+ /**
+ * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ *
+ * @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 ApplicationsClient object to access its operations. */
+ private final ApplicationsClient applications;
+
+ /**
+ * Gets the ApplicationsClient object to access its operations.
+ *
+ * @return the ApplicationsClient object.
+ */
+ public ApplicationsClient getApplications() {
+ return this.applications;
+ }
+
+ /** The SaaSClient object to access its operations. */
+ private final SaaSClient saaS;
+
+ /**
+ * Gets the SaaSClient object to access its operations.
+ *
+ * @return the SaaSClient object.
+ */
+ public SaaSClient getSaaS() {
+ return this.saaS;
+ }
+
+ /** The SaasResourcesClient object to access its operations. */
+ private final SaasResourcesClient saasResources;
+
+ /**
+ * Gets the SaasResourcesClient object to access its operations.
+ *
+ * @return the SaasResourcesClient object.
+ */
+ public SaasResourcesClient getSaasResources() {
+ return this.saasResources;
+ }
+
+ /** The ResourceProvidersClient object to access its operations. */
+ private final ResourceProvidersClient resourceProviders;
+
+ /**
+ * Gets the ResourceProvidersClient object to access its operations.
+ *
+ * @return the ResourceProvidersClient object.
+ */
+ public ResourceProvidersClient getResourceProviders() {
+ return this.resourceProviders;
+ }
+
+ /** The SaasSubscriptionLevelsClient object to access its operations. */
+ private final SaasSubscriptionLevelsClient saasSubscriptionLevels;
+
+ /**
+ * Gets the SaasSubscriptionLevelsClient object to access its operations.
+ *
+ * @return the SaasSubscriptionLevelsClient object.
+ */
+ public SaasSubscriptionLevelsClient getSaasSubscriptionLevels() {
+ return this.saasSubscriptionLevels;
+ }
+
+ /** The SaaSOperationsClient object to access its operations. */
+ private final SaaSOperationsClient saaSOperations;
+
+ /**
+ * Gets the SaaSOperationsClient object to access its operations.
+ *
+ * @return the SaaSOperationsClient object.
+ */
+ public SaaSOperationsClient getSaaSOperations() {
+ return this.saaSOperations;
+ }
+
+ /**
+ * Initializes an instance of SaaSManagementClient 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 Azure subscription ID. This is a GUID-formatted string (e.g.
+ * 00000000-0000-0000-0000-000000000000).
+ * @param endpoint server parameter.
+ */
+ SaaSManagementClientImpl(
+ 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 = "2018-03-01-beta";
+ this.operations = new OperationsClientImpl(this);
+ this.applications = new ApplicationsClientImpl(this);
+ this.saaS = new SaaSClientImpl(this);
+ this.saasResources = new SaasResourcesClientImpl(this);
+ this.resourceProviders = new ResourceProvidersClientImpl(this);
+ this.saasSubscriptionLevels = new SaasSubscriptionLevelsClientImpl(this);
+ this.saaSOperations = new SaaSOperationsClientImpl(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(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(SaaSManagementClientImpl.class);
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSOperationsClientImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSOperationsClientImpl.java
new file mode 100644
index 000000000000..e60bd8f595cf
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSOperationsClientImpl.java
@@ -0,0 +1,256 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.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.saas.fluent.SaaSOperationsClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+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 SaaSOperationsClient. */
+public final class SaaSOperationsClientImpl implements SaaSOperationsClient {
+ /** The proxy service used to perform REST calls. */
+ private final SaaSOperationsService service;
+
+ /** The service client containing this operation class. */
+ private final SaaSManagementClientImpl client;
+
+ /**
+ * Initializes an instance of SaaSOperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ SaaSOperationsClientImpl(SaaSManagementClientImpl client) {
+ this.service =
+ RestProxy.create(SaaSOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SaaSManagementClientSaaSOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SaaSManagementClient")
+ public interface SaaSOperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.SaaS/operationResults/{operationId}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("operationId") String operationId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified operation progress along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> getWithResponseAsync(String operationId) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (operationId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service.get(this.client.getEndpoint(), operationId, this.client.getApiVersion(), accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified operation progress along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> getWithResponseAsync(String operationId, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (operationId == null) {
+ return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), operationId, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginGetAsync(String operationId) {
+ Mono>> mono = getWithResponseAsync(operationId);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ SaasResourceInner.class,
+ SaasResourceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginGetAsync(
+ String operationId, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = getWithResponseAsync(operationId, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), SaasResourceInner.class, SaasResourceInner.class, context);
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginGet(String operationId) {
+ return this.beginGetAsync(operationId).getSyncPoller();
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginGet(String operationId, Context context) {
+ return this.beginGetAsync(operationId, context).getSyncPoller();
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified operation progress on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String operationId) {
+ return beginGetAsync(operationId).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified operation progress on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String operationId, Context context) {
+ return beginGetAsync(operationId, context).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner get(String operationId) {
+ return getAsync(operationId).block();
+ }
+
+ /**
+ * Gets information about the specified operation progress.
+ *
+ * @param operationId the operation Id parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about the specified operation progress.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner get(String operationId, Context context) {
+ return getAsync(operationId, context).block();
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSOperationsImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSOperationsImpl.java
new file mode 100644
index 000000000000..00dedda3d0ac
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaaSOperationsImpl.java
@@ -0,0 +1,52 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.saas.fluent.SaaSOperationsClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.SaaSOperations;
+import com.azure.resourcemanager.saas.models.SaasResource;
+
+public final class SaaSOperationsImpl implements SaaSOperations {
+ private static final ClientLogger LOGGER = new ClientLogger(SaaSOperationsImpl.class);
+
+ private final SaaSOperationsClient innerClient;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ public SaaSOperationsImpl(
+ SaaSOperationsClient innerClient, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public SaasResource get(String operationId) {
+ SaasResourceInner inner = this.serviceClient().get(operationId);
+ if (inner != null) {
+ return new SaasResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public SaasResource get(String operationId, Context context) {
+ SaasResourceInner inner = this.serviceClient().get(operationId, context);
+ if (inner != null) {
+ return new SaasResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private SaaSOperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasAppImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasAppImpl.java
new file mode 100644
index 000000000000..ecb3590558a8
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasAppImpl.java
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.resourcemanager.saas.fluent.models.SaasAppInner;
+import com.azure.resourcemanager.saas.models.SaasApp;
+import com.azure.resourcemanager.saas.models.SaasAppProperties;
+import java.util.Collections;
+import java.util.Map;
+
+public final class SaasAppImpl implements SaasApp {
+ private SaasAppInner innerObject;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ SaasAppImpl(SaasAppInner innerObject, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SaasAppProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public SaasAppInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasAppOperationImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasAppOperationImpl.java
new file mode 100644
index 000000000000..1afeb41ef7c6
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasAppOperationImpl.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.saas.implementation;
+
+import com.azure.resourcemanager.saas.fluent.models.SaasAppOperationInner;
+import com.azure.resourcemanager.saas.models.SaasAppOperation;
+import com.azure.resourcemanager.saas.models.SaasAppOperationDisplay;
+
+public final class SaasAppOperationImpl implements SaasAppOperation {
+ private SaasAppOperationInner innerObject;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ SaasAppOperationImpl(SaasAppOperationInner innerObject, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public SaasAppOperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public String origin() {
+ return this.innerModel().origin();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public SaasAppOperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourceImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourceImpl.java
new file mode 100644
index 000000000000..f35eb7738176
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourceImpl.java
@@ -0,0 +1,218 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.Region;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.AccessTokenResult;
+import com.azure.resourcemanager.saas.models.DeleteOptions;
+import com.azure.resourcemanager.saas.models.SaasCreationProperties;
+import com.azure.resourcemanager.saas.models.SaasResource;
+import com.azure.resourcemanager.saas.models.SaasResourceCreation;
+import com.azure.resourcemanager.saas.models.SaasResourceProperties;
+import java.util.Collections;
+import java.util.Map;
+
+public final class SaasResourceImpl implements SaasResource, SaasResource.Definition, SaasResource.Update {
+ private SaasResourceInner innerObject;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SaasResourceProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public SaasResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String resourceName;
+
+ private SaasResourceCreation createParameters;
+
+ private SaasResourceCreation updateParameters;
+
+ public SaasResourceImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public SaasResource create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getSaasSubscriptionLevels()
+ .createOrUpdate(resourceGroupName, resourceName, createParameters, Context.NONE);
+ return this;
+ }
+
+ public SaasResource create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getSaasSubscriptionLevels()
+ .createOrUpdate(resourceGroupName, resourceName, createParameters, context);
+ return this;
+ }
+
+ SaasResourceImpl(String name, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerObject = new SaasResourceInner();
+ this.serviceManager = serviceManager;
+ this.resourceName = name;
+ this.createParameters = new SaasResourceCreation();
+ }
+
+ public SaasResourceImpl update() {
+ this.updateParameters = new SaasResourceCreation();
+ return this;
+ }
+
+ public SaasResource apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getSaasSubscriptionLevels()
+ .update(resourceGroupName, resourceName, updateParameters, Context.NONE);
+ return this;
+ }
+
+ public SaasResource apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getSaasSubscriptionLevels()
+ .update(resourceGroupName, resourceName, updateParameters, context);
+ return this;
+ }
+
+ SaasResourceImpl(SaasResourceInner innerObject, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "resources");
+ }
+
+ public SaasResource refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getSaasSubscriptionLevels()
+ .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public SaasResource refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getSaasSubscriptionLevels()
+ .getByResourceGroupWithResponse(resourceGroupName, resourceName, context)
+ .getValue();
+ return this;
+ }
+
+ public void updateToUnsubscribed(DeleteOptions parameters) {
+ serviceManager.saasSubscriptionLevels().updateToUnsubscribed(resourceGroupName, resourceName, parameters);
+ }
+
+ public void updateToUnsubscribed(DeleteOptions parameters, Context context) {
+ serviceManager
+ .saasSubscriptionLevels()
+ .updateToUnsubscribed(resourceGroupName, resourceName, parameters, context);
+ }
+
+ public Response listAccessTokenWithResponse(Context context) {
+ return serviceManager
+ .saasSubscriptionLevels()
+ .listAccessTokenWithResponse(resourceGroupName, resourceName, context);
+ }
+
+ public AccessTokenResult listAccessToken() {
+ return serviceManager.saasSubscriptionLevels().listAccessToken(resourceGroupName, resourceName);
+ }
+
+ public SaasResourceImpl withRegion(Region location) {
+ this.createParameters.withLocation(location.toString());
+ return this;
+ }
+
+ public SaasResourceImpl withRegion(String location) {
+ this.createParameters.withLocation(location);
+ return this;
+ }
+
+ public SaasResourceImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.createParameters.withTags(tags);
+ return this;
+ } else {
+ this.updateParameters.withTags(tags);
+ return this;
+ }
+ }
+
+ public SaasResourceImpl withName(String name) {
+ if (isInCreateMode()) {
+ this.createParameters.withName(name);
+ return this;
+ } else {
+ this.updateParameters.withName(name);
+ return this;
+ }
+ }
+
+ public SaasResourceImpl withProperties(SaasCreationProperties properties) {
+ if (isInCreateMode()) {
+ this.createParameters.withProperties(properties);
+ return this;
+ } else {
+ this.updateParameters.withProperties(properties);
+ return this;
+ }
+ }
+
+ public SaasResourceImpl withLocation(String location) {
+ this.updateParameters.withLocation(location);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourcesClientImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourcesClientImpl.java
new file mode 100644
index 000000000000..d4475151740c
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourcesClientImpl.java
@@ -0,0 +1,270 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.saas.fluent.SaasResourcesClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.SaasResourceResponseWithContinuation;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in SaasResourcesClient. */
+public final class SaasResourcesClientImpl implements SaasResourcesClient {
+ /** The proxy service used to perform REST calls. */
+ private final SaasResourcesService service;
+
+ /** The service client containing this operation class. */
+ private final SaaSManagementClientImpl client;
+
+ /**
+ * Initializes an instance of SaasResourcesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ SaasResourcesClientImpl(SaaSManagementClientImpl client) {
+ this.service =
+ RestProxy.create(SaasResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SaaSManagementClientSaasResources to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SaaSManagementClient")
+ public interface SaasResourcesService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.SaaS/saasresources")
+ @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);
+ }
+
+ /**
+ * Get All Resources.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all Resources 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()));
+ }
+
+ /**
+ * Get All Resources.
+ *
+ * @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 all Resources 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));
+ }
+
+ /**
+ * Get All Resources.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all Resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Get All Resources.
+ *
+ * @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 all Resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Get All Resources.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all Resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Get All Resources.
+ *
+ * @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 all Resources 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
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saas resources response with continuation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return saas resources response with continuation 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/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourcesImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourcesImpl.java
new file mode 100644
index 000000000000..e423e3330b3d
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasResourcesImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.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.saas.fluent.SaasResourcesClient;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.SaasResource;
+import com.azure.resourcemanager.saas.models.SaasResources;
+
+public final class SaasResourcesImpl implements SaasResources {
+ private static final ClientLogger LOGGER = new ClientLogger(SaasResourcesImpl.class);
+
+ private final SaasResourcesClient innerClient;
+
+ private final com.azure.resourcemanager.saas.SaaSManager serviceManager;
+
+ public SaasResourcesImpl(
+ SaasResourcesClient innerClient, com.azure.resourcemanager.saas.SaaSManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new SaasResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new SaasResourceImpl(inner1, this.manager()));
+ }
+
+ private SaasResourcesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.saas.SaaSManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasSubscriptionLevelsClientImpl.java b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasSubscriptionLevelsClientImpl.java
new file mode 100644
index 000000000000..282a2b5b6711
--- /dev/null
+++ b/sdk/saas/azure-resourcemanager-saas/src/main/java/com/azure/resourcemanager/saas/implementation/SaasSubscriptionLevelsClientImpl.java
@@ -0,0 +1,2397 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.saas.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.saas.fluent.SaasSubscriptionLevelsClient;
+import com.azure.resourcemanager.saas.fluent.models.AccessTokenResultInner;
+import com.azure.resourcemanager.saas.fluent.models.SaasResourceInner;
+import com.azure.resourcemanager.saas.models.DeleteOptions;
+import com.azure.resourcemanager.saas.models.MoveResource;
+import com.azure.resourcemanager.saas.models.SaasResourceCreation;
+import com.azure.resourcemanager.saas.models.SaasResourceResponseWithContinuation;
+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 SaasSubscriptionLevelsClient. */
+public final class SaasSubscriptionLevelsClientImpl implements SaasSubscriptionLevelsClient {
+ /** The proxy service used to perform REST calls. */
+ private final SaasSubscriptionLevelsService service;
+
+ /** The service client containing this operation class. */
+ private final SaaSManagementClientImpl client;
+
+ /**
+ * Initializes an instance of SaasSubscriptionLevelsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ SaasSubscriptionLevelsClientImpl(SaaSManagementClientImpl client) {
+ this.service =
+ RestProxy
+ .create(SaasSubscriptionLevelsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SaaSManagementClientSaasSubscriptionLevels to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SaaSManagementClient")
+ public interface SaasSubscriptionLevelsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.SaaS/resources")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SaaS/resources")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SaaS/resources/{resourceName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("resourceName") String resourceName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SaaS/resources/{resourceName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("resourceName") String resourceName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") SaasResourceCreation parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SaaS/resources/{resourceName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("resourceName") String resourceName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") SaasResourceCreation parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SaaS/resources/{resourceName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("resourceName") String resourceName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SaaS/resources/{resourceName}/unsubscribe")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> updateToUnsubscribed(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("resourceName") String resourceName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") DeleteOptions parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SaaS/resources/{resourceName}/listAccessToken")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAccessToken(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("resourceName") String resourceName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> validateMoveResources(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") MoveResource moveResourceParameter,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> moveResources(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") MoveResource moveResourceParameter,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByAzureSubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain Azure 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 information about all the Subscription Level SaaS in a certain Azure subscription 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.getSubscriptionId(),
+ 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()));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain Azure subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about all the Subscription Level SaaS in a certain Azure subscription 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.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain Azure 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 information about all the Subscription Level SaaS in a certain Azure subscription as paginated response
+ * with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listByAzureSubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain Azure subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about all the Subscription Level SaaS in a certain Azure subscription as paginated response
+ * with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context),
+ nextLink -> listByAzureSubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain Azure 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 information about all the Subscription Level SaaS in a certain Azure subscription as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain Azure subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about all the Subscription Level SaaS in a certain Azure subscription as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about all the Subscription Level SaaS in a certain resource group along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ 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()));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 information about all the Subscription Level SaaS in a certain resource group along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about all the Subscription Level SaaS in a certain resource group as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 information about all the Subscription Level SaaS in a certain resource group as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return information about all the Subscription Level SaaS in a certain resource group as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Gets information about all the Subscription Level SaaS in a certain resource group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 information about all the Subscription Level SaaS in a certain resource group as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Gets information about the specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 information about the specified Subscription Level SaaS along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String resourceName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ resourceName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets information about the specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 information about the specified Subscription Level SaaS along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String resourceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ resourceName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Gets information about the specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 information about the specified Subscription Level SaaS on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets information about the specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 information about the specified Subscription Level SaaS along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String resourceName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block();
+ }
+
+ /**
+ * Gets information about the specified Subscription Level SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the 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 information about the specified Subscription Level SaaS.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner getByResourceGroup(String resourceGroupName, String resourceName) {
+ return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue();
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas 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 saaS REST API resource definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ resourceName,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas operation.
+ * @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 saaS REST API resource definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ resourceName,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ SaasResourceInner.class,
+ SaasResourceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), SaasResourceInner.class, SaasResourceInner.class, context);
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas 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 saaS REST API resource definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas operation.
+ * @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 saaS REST API resource definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner createOrUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block();
+ }
+
+ /**
+ * Creates or updates a SaaS resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the create or update subscription level saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner createOrUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block();
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ resourceName,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ resourceName,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginUpdateAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ SaasResourceInner.class,
+ SaasResourceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SaasResourceInner> beginUpdateAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, resourceName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), SaasResourceInner.class, SaasResourceInner.class, context);
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ return this.beginUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SaasResourceInner> beginUpdate(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ return beginUpdateAsync(resourceGroupName, resourceName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ return beginUpdateAsync(resourceGroupName, resourceName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas 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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner update(String resourceGroupName, String resourceName, SaasResourceCreation parameters) {
+ return updateAsync(resourceGroupName, resourceName, parameters).block();
+ }
+
+ /**
+ * Updates a SaaS Subscription Level resource.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param parameters Parameters supplied to the update saas operation.
+ * @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 saaS REST API resource definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SaasResourceInner update(
+ String resourceGroupName, String resourceName, SaasResourceCreation parameters, Context context) {
+ return updateAsync(resourceGroupName, resourceName, parameters, context).block();
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ resourceName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String resourceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (resourceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ resourceName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes the specified SaaS.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param resourceName The name of the resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) {
+ Mono