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 voiceservices service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the voiceservices service API instance.
+ */
+ public VoiceservicesManager 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.voiceservices")
+ .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 VoiceservicesManager(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 CommunicationsGateways. It manages CommunicationsGateway.
+ *
+ * @return Resource collection API of CommunicationsGateways.
+ */
+ public CommunicationsGateways communicationsGateways() {
+ if (this.communicationsGateways == null) {
+ this.communicationsGateways =
+ new CommunicationsGatewaysImpl(clientObject.getCommunicationsGateways(), this);
+ }
+ return communicationsGateways;
+ }
+
+ /**
+ * Gets the resource collection API of NameAvailabilities.
+ *
+ * @return Resource collection API of NameAvailabilities.
+ */
+ public NameAvailabilities nameAvailabilities() {
+ if (this.nameAvailabilities == null) {
+ this.nameAvailabilities = new NameAvailabilitiesImpl(clientObject.getNameAvailabilities(), this);
+ }
+ return nameAvailabilities;
+ }
+
+ /**
+ * Gets the resource collection API of TestLines. It manages TestLine.
+ *
+ * @return Resource collection API of TestLines.
+ */
+ public TestLines testLines() {
+ if (this.testLines == null) {
+ this.testLines = new TestLinesImpl(clientObject.getTestLines(), this);
+ }
+ return testLines;
+ }
+
+ /**
+ * @return Wrapped service client MicrosoftVoiceServices providing direct access to the underlying auto-generated
+ * API implementation, based on Azure REST API.
+ */
+ public MicrosoftVoiceServices serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/CommunicationsGatewaysClient.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/CommunicationsGatewaysClient.java
new file mode 100644
index 0000000000000..5661f283f3297
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/CommunicationsGatewaysClient.java
@@ -0,0 +1,248 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.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.voiceservices.fluent.models.CommunicationsGatewayInner;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsGatewayUpdate;
+
+/** An instance of this class provides access to all the operations defined in CommunicationsGatewaysClient. */
+public interface CommunicationsGatewaysClient {
+ /**
+ * List CommunicationsGateway resources by subscription ID.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List CommunicationsGateway resources by subscription ID.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * List CommunicationsGateway resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List CommunicationsGateway resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Get a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String communicationsGatewayName, Context context);
+
+ /**
+ * Get a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CommunicationsGatewayInner getByResourceGroup(String resourceGroupName, String communicationsGatewayName);
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CommunicationsGatewayInner> beginCreateOrUpdate(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayInner resource);
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, CommunicationsGatewayInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayInner resource,
+ Context context);
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CommunicationsGatewayInner createOrUpdate(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayInner resource);
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CommunicationsGatewayInner createOrUpdate(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayInner resource,
+ Context context);
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @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 communicationsGatewayName);
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @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 communicationsGatewayName, Context context);
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @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 communicationsGatewayName);
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @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 communicationsGatewayName, Context context);
+
+ /**
+ * Update a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayUpdate properties,
+ Context context);
+
+ /**
+ * Update a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CommunicationsGatewayInner update(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayUpdate properties);
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/MicrosoftVoiceServices.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/MicrosoftVoiceServices.java
new file mode 100644
index 0000000000000..c237a38e9851b
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/MicrosoftVoiceServices.java
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for MicrosoftVoiceServices class. */
+public interface MicrosoftVoiceServices {
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the CommunicationsGatewaysClient object to access its operations.
+ *
+ * @return the CommunicationsGatewaysClient object.
+ */
+ CommunicationsGatewaysClient getCommunicationsGateways();
+
+ /**
+ * Gets the NameAvailabilitiesClient object to access its operations.
+ *
+ * @return the NameAvailabilitiesClient object.
+ */
+ NameAvailabilitiesClient getNameAvailabilities();
+
+ /**
+ * Gets the TestLinesClient object to access its operations.
+ *
+ * @return the TestLinesClient object.
+ */
+ TestLinesClient getTestLines();
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/NameAvailabilitiesClient.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/NameAvailabilitiesClient.java
new file mode 100644
index 0000000000000..d50fac2cb9b83
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/NameAvailabilitiesClient.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.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.voiceservices.fluent.models.CheckNameAvailabilityResponseInner;
+import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityRequest;
+
+/** An instance of this class provides access to all the operations defined in NameAvailabilitiesClient. */
+public interface NameAvailabilitiesClient {
+ /**
+ * Check whether the resource name is available in the given region.
+ *
+ * @param location The location in which uniqueness will be verified.
+ * @param body The check availability request body.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response checkLocalWithResponse(
+ String location, CheckNameAvailabilityRequest body, Context context);
+
+ /**
+ * Check whether the resource name is available in the given region.
+ *
+ * @param location The location in which uniqueness will be verified.
+ * @param body The check availability request body.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CheckNameAvailabilityResponseInner checkLocal(String location, CheckNameAvailabilityRequest body);
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/OperationsClient.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..3c69c73d23c9e
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/OperationsClient.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.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.voiceservices.fluent.models.OperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * List the operations for the provider.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/TestLinesClient.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/TestLinesClient.java
new file mode 100644
index 0000000000000..c4b45c92ddbea
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/TestLinesClient.java
@@ -0,0 +1,246 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.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.voiceservices.fluent.models.TestLineInner;
+import com.azure.resourcemanager.voiceservices.models.TestLineUpdate;
+
+/** An instance of this class provides access to all the operations defined in TestLinesClient. */
+public interface TestLinesClient {
+ /**
+ * List TestLine resources by CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByCommunicationsGateway(
+ String resourceGroupName, String communicationsGatewayName);
+
+ /**
+ * List TestLine resources by CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByCommunicationsGateway(
+ String resourceGroupName, String communicationsGatewayName, Context context);
+
+ /**
+ * Get a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, Context context);
+
+ /**
+ * Get a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TestLineInner get(String resourceGroupName, String communicationsGatewayName, String testLineName);
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, TestLineInner> beginCreateOrUpdate(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineInner resource);
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, TestLineInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineInner resource,
+ Context context);
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TestLineInner createOrUpdate(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineInner resource);
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TestLineInner createOrUpdate(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineInner resource,
+ Context context);
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @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 communicationsGatewayName, String testLineName);
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @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 communicationsGatewayName, String testLineName, Context context);
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @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 communicationsGatewayName, String testLineName);
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @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 communicationsGatewayName, String testLineName, Context context);
+
+ /**
+ * Update a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineUpdate properties,
+ Context context);
+
+ /**
+ * Update a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TestLineInner update(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineUpdate properties);
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CheckNameAvailabilityResponseInner.java
new file mode 100644
index 0000000000000..a5a90a62f2c30
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CheckNameAvailabilityResponseInner.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.voiceservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityReason;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The check availability result. */
+@Fluent
+public final class CheckNameAvailabilityResponseInner {
+ /*
+ * Indicates if the resource name is available.
+ */
+ @JsonProperty(value = "nameAvailable")
+ private Boolean nameAvailable;
+
+ /*
+ * The reason why the given name is not available.
+ */
+ @JsonProperty(value = "reason")
+ private CheckNameAvailabilityReason reason;
+
+ /*
+ * Detailed reason why the given name is not available.
+ */
+ @JsonProperty(value = "message")
+ private String message;
+
+ /** Creates an instance of CheckNameAvailabilityResponseInner class. */
+ public CheckNameAvailabilityResponseInner() {
+ }
+
+ /**
+ * Get the nameAvailable property: Indicates if the resource name is available.
+ *
+ * @return the nameAvailable value.
+ */
+ public Boolean nameAvailable() {
+ return this.nameAvailable;
+ }
+
+ /**
+ * Set the nameAvailable property: Indicates if the resource name is available.
+ *
+ * @param nameAvailable the nameAvailable value to set.
+ * @return the CheckNameAvailabilityResponseInner object itself.
+ */
+ public CheckNameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) {
+ this.nameAvailable = nameAvailable;
+ return this;
+ }
+
+ /**
+ * Get the reason property: The reason why the given name is not available.
+ *
+ * @return the reason value.
+ */
+ public CheckNameAvailabilityReason reason() {
+ return this.reason;
+ }
+
+ /**
+ * Set the reason property: The reason why the given name is not available.
+ *
+ * @param reason the reason value to set.
+ * @return the CheckNameAvailabilityResponseInner object itself.
+ */
+ public CheckNameAvailabilityResponseInner withReason(CheckNameAvailabilityReason reason) {
+ this.reason = reason;
+ return this;
+ }
+
+ /**
+ * Get the message property: Detailed reason why the given name is not available.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message property: Detailed reason why the given name is not available.
+ *
+ * @param message the message value to set.
+ * @return the CheckNameAvailabilityResponseInner object itself.
+ */
+ public CheckNameAvailabilityResponseInner withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayInner.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayInner.java
new file mode 100644
index 0000000000000..1d947a3f802e4
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayInner.java
@@ -0,0 +1,346 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.voiceservices.models.AutoGeneratedDomainNameLabelScope;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsPlatform;
+import com.azure.resourcemanager.voiceservices.models.Connectivity;
+import com.azure.resourcemanager.voiceservices.models.E911Type;
+import com.azure.resourcemanager.voiceservices.models.ProvisioningState;
+import com.azure.resourcemanager.voiceservices.models.ServiceRegionProperties;
+import com.azure.resourcemanager.voiceservices.models.Status;
+import com.azure.resourcemanager.voiceservices.models.TeamsCodecs;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/** A CommunicationsGateway resource. */
+@Fluent
+public final class CommunicationsGatewayInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private CommunicationsGatewayProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of CommunicationsGatewayInner class. */
+ public CommunicationsGatewayInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private CommunicationsGatewayProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public CommunicationsGatewayInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public CommunicationsGatewayInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: Resource provisioning state.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the status property: The current status of the deployment.
+ *
+ * @return the status value.
+ */
+ public Status status() {
+ return this.innerProperties() == null ? null : this.innerProperties().status();
+ }
+
+ /**
+ * Get the serviceLocations property: The regions in which to deploy the resources needed for Teams Calling.
+ *
+ * @return the serviceLocations value.
+ */
+ public List serviceLocations() {
+ return this.innerProperties() == null ? null : this.innerProperties().serviceLocations();
+ }
+
+ /**
+ * Set the serviceLocations property: The regions in which to deploy the resources needed for Teams Calling.
+ *
+ * @param serviceLocations the serviceLocations value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withServiceLocations(List serviceLocations) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withServiceLocations(serviceLocations);
+ return this;
+ }
+
+ /**
+ * Get the connectivity property: How to connect back to the operator network, e.g. MAPS.
+ *
+ * @return the connectivity value.
+ */
+ public Connectivity connectivity() {
+ return this.innerProperties() == null ? null : this.innerProperties().connectivity();
+ }
+
+ /**
+ * Set the connectivity property: How to connect back to the operator network, e.g. MAPS.
+ *
+ * @param connectivity the connectivity value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withConnectivity(Connectivity connectivity) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withConnectivity(connectivity);
+ return this;
+ }
+
+ /**
+ * Get the codecs property: Voice codecs to support.
+ *
+ * @return the codecs value.
+ */
+ public List codecs() {
+ return this.innerProperties() == null ? null : this.innerProperties().codecs();
+ }
+
+ /**
+ * Set the codecs property: Voice codecs to support.
+ *
+ * @param codecs the codecs value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withCodecs(List codecs) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withCodecs(codecs);
+ return this;
+ }
+
+ /**
+ * Get the e911Type property: How to handle 911 calls.
+ *
+ * @return the e911Type value.
+ */
+ public E911Type e911Type() {
+ return this.innerProperties() == null ? null : this.innerProperties().e911Type();
+ }
+
+ /**
+ * Set the e911Type property: How to handle 911 calls.
+ *
+ * @param e911Type the e911Type value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withE911Type(E911Type e911Type) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withE911Type(e911Type);
+ return this;
+ }
+
+ /**
+ * Get the platforms property: What platforms to support.
+ *
+ * @return the platforms value.
+ */
+ public List platforms() {
+ return this.innerProperties() == null ? null : this.innerProperties().platforms();
+ }
+
+ /**
+ * Set the platforms property: What platforms to support.
+ *
+ * @param platforms the platforms value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withPlatforms(List platforms) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withPlatforms(platforms);
+ return this;
+ }
+
+ /**
+ * Get the apiBridge property: Details of API bridge functionality, if required.
+ *
+ * @return the apiBridge value.
+ */
+ public Object apiBridge() {
+ return this.innerProperties() == null ? null : this.innerProperties().apiBridge();
+ }
+
+ /**
+ * Set the apiBridge property: Details of API bridge functionality, if required.
+ *
+ * @param apiBridge the apiBridge value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withApiBridge(Object apiBridge) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withApiBridge(apiBridge);
+ return this;
+ }
+
+ /**
+ * Get the autoGeneratedDomainNameLabelScope property: The scope at which the auto-generated domain name can be
+ * re-used.
+ *
+ * @return the autoGeneratedDomainNameLabelScope value.
+ */
+ public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() {
+ return this.innerProperties() == null ? null : this.innerProperties().autoGeneratedDomainNameLabelScope();
+ }
+
+ /**
+ * Set the autoGeneratedDomainNameLabelScope property: The scope at which the auto-generated domain name can be
+ * re-used.
+ *
+ * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withAutoGeneratedDomainNameLabelScope(
+ AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withAutoGeneratedDomainNameLabelScope(autoGeneratedDomainNameLabelScope);
+ return this;
+ }
+
+ /**
+ * Get the autoGeneratedDomainNameLabel property: The autogenerated label used as part of the FQDNs for accessing
+ * the Communications Gateway.
+ *
+ * @return the autoGeneratedDomainNameLabel value.
+ */
+ public String autoGeneratedDomainNameLabel() {
+ return this.innerProperties() == null ? null : this.innerProperties().autoGeneratedDomainNameLabel();
+ }
+
+ /**
+ * Get the teamsVoicemailPilotNumber property: This number is used in Teams Phone Mobile scenarios for access to the
+ * voicemail IVR from the native dialer.
+ *
+ * @return the teamsVoicemailPilotNumber value.
+ */
+ public String teamsVoicemailPilotNumber() {
+ return this.innerProperties() == null ? null : this.innerProperties().teamsVoicemailPilotNumber();
+ }
+
+ /**
+ * Set the teamsVoicemailPilotNumber property: This number is used in Teams Phone Mobile scenarios for access to the
+ * voicemail IVR from the native dialer.
+ *
+ * @param teamsVoicemailPilotNumber the teamsVoicemailPilotNumber value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withTeamsVoicemailPilotNumber(String teamsVoicemailPilotNumber) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withTeamsVoicemailPilotNumber(teamsVoicemailPilotNumber);
+ return this;
+ }
+
+ /**
+ * Get the onPremMcpEnabled property: Whether an on-premises Mobile Control Point is in use.
+ *
+ * @return the onPremMcpEnabled value.
+ */
+ public Boolean onPremMcpEnabled() {
+ return this.innerProperties() == null ? null : this.innerProperties().onPremMcpEnabled();
+ }
+
+ /**
+ * Set the onPremMcpEnabled property: Whether an on-premises Mobile Control Point is in use.
+ *
+ * @param onPremMcpEnabled the onPremMcpEnabled value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withOnPremMcpEnabled(Boolean onPremMcpEnabled) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withOnPremMcpEnabled(onPremMcpEnabled);
+ return this;
+ }
+
+ /**
+ * Get the emergencyDialStrings property: A list of dial strings used for emergency calling.
+ *
+ * @return the emergencyDialStrings value.
+ */
+ public List emergencyDialStrings() {
+ return this.innerProperties() == null ? null : this.innerProperties().emergencyDialStrings();
+ }
+
+ /**
+ * Set the emergencyDialStrings property: A list of dial strings used for emergency calling.
+ *
+ * @param emergencyDialStrings the emergencyDialStrings value to set.
+ * @return the CommunicationsGatewayInner object itself.
+ */
+ public CommunicationsGatewayInner withEmergencyDialStrings(List emergencyDialStrings) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new CommunicationsGatewayProperties();
+ }
+ this.innerProperties().withEmergencyDialStrings(emergencyDialStrings);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayProperties.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayProperties.java
new file mode 100644
index 0000000000000..62714629f3f86
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayProperties.java
@@ -0,0 +1,379 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.voiceservices.models.AutoGeneratedDomainNameLabelScope;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsPlatform;
+import com.azure.resourcemanager.voiceservices.models.Connectivity;
+import com.azure.resourcemanager.voiceservices.models.E911Type;
+import com.azure.resourcemanager.voiceservices.models.ProvisioningState;
+import com.azure.resourcemanager.voiceservices.models.ServiceRegionProperties;
+import com.azure.resourcemanager.voiceservices.models.Status;
+import com.azure.resourcemanager.voiceservices.models.TeamsCodecs;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Details of the CommunicationsGateway resource. */
+@Fluent
+public final class CommunicationsGatewayProperties {
+ /*
+ * Resource provisioning state.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningState provisioningState;
+
+ /*
+ * The current status of the deployment.
+ */
+ @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
+ private Status status;
+
+ /*
+ * The regions in which to deploy the resources needed for Teams Calling
+ */
+ @JsonProperty(value = "serviceLocations", required = true)
+ private List serviceLocations;
+
+ /*
+ * How to connect back to the operator network, e.g. MAPS
+ */
+ @JsonProperty(value = "connectivity", required = true)
+ private Connectivity connectivity;
+
+ /*
+ * Voice codecs to support
+ */
+ @JsonProperty(value = "codecs", required = true)
+ private List codecs;
+
+ /*
+ * How to handle 911 calls
+ */
+ @JsonProperty(value = "e911Type", required = true)
+ private E911Type e911Type;
+
+ /*
+ * What platforms to support
+ */
+ @JsonProperty(value = "platforms", required = true)
+ private List platforms;
+
+ /*
+ * Details of API bridge functionality, if required
+ */
+ @JsonProperty(value = "apiBridge")
+ private Object apiBridge;
+
+ /*
+ * The scope at which the auto-generated domain name can be re-used
+ */
+ @JsonProperty(value = "autoGeneratedDomainNameLabelScope")
+ private AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope;
+
+ /*
+ * The autogenerated label used as part of the FQDNs for accessing the Communications Gateway
+ */
+ @JsonProperty(value = "autoGeneratedDomainNameLabel", access = JsonProperty.Access.WRITE_ONLY)
+ private String autoGeneratedDomainNameLabel;
+
+ /*
+ * This number is used in Teams Phone Mobile scenarios for access to the voicemail IVR from the native dialer.
+ */
+ @JsonProperty(value = "teamsVoicemailPilotNumber")
+ private String teamsVoicemailPilotNumber;
+
+ /*
+ * Whether an on-premises Mobile Control Point is in use.
+ */
+ @JsonProperty(value = "onPremMcpEnabled")
+ private Boolean onPremMcpEnabled;
+
+ /*
+ * A list of dial strings used for emergency calling.
+ */
+ @JsonProperty(value = "emergencyDialStrings")
+ private List emergencyDialStrings;
+
+ /** Creates an instance of CommunicationsGatewayProperties class. */
+ public CommunicationsGatewayProperties() {
+ }
+
+ /**
+ * Get the provisioningState property: Resource provisioning state.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the status property: The current status of the deployment.
+ *
+ * @return the status value.
+ */
+ public Status status() {
+ return this.status;
+ }
+
+ /**
+ * Get the serviceLocations property: The regions in which to deploy the resources needed for Teams Calling.
+ *
+ * @return the serviceLocations value.
+ */
+ public List serviceLocations() {
+ return this.serviceLocations;
+ }
+
+ /**
+ * Set the serviceLocations property: The regions in which to deploy the resources needed for Teams Calling.
+ *
+ * @param serviceLocations the serviceLocations value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withServiceLocations(List serviceLocations) {
+ this.serviceLocations = serviceLocations;
+ return this;
+ }
+
+ /**
+ * Get the connectivity property: How to connect back to the operator network, e.g. MAPS.
+ *
+ * @return the connectivity value.
+ */
+ public Connectivity connectivity() {
+ return this.connectivity;
+ }
+
+ /**
+ * Set the connectivity property: How to connect back to the operator network, e.g. MAPS.
+ *
+ * @param connectivity the connectivity value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withConnectivity(Connectivity connectivity) {
+ this.connectivity = connectivity;
+ return this;
+ }
+
+ /**
+ * Get the codecs property: Voice codecs to support.
+ *
+ * @return the codecs value.
+ */
+ public List codecs() {
+ return this.codecs;
+ }
+
+ /**
+ * Set the codecs property: Voice codecs to support.
+ *
+ * @param codecs the codecs value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withCodecs(List codecs) {
+ this.codecs = codecs;
+ return this;
+ }
+
+ /**
+ * Get the e911Type property: How to handle 911 calls.
+ *
+ * @return the e911Type value.
+ */
+ public E911Type e911Type() {
+ return this.e911Type;
+ }
+
+ /**
+ * Set the e911Type property: How to handle 911 calls.
+ *
+ * @param e911Type the e911Type value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withE911Type(E911Type e911Type) {
+ this.e911Type = e911Type;
+ return this;
+ }
+
+ /**
+ * Get the platforms property: What platforms to support.
+ *
+ * @return the platforms value.
+ */
+ public List platforms() {
+ return this.platforms;
+ }
+
+ /**
+ * Set the platforms property: What platforms to support.
+ *
+ * @param platforms the platforms value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withPlatforms(List platforms) {
+ this.platforms = platforms;
+ return this;
+ }
+
+ /**
+ * Get the apiBridge property: Details of API bridge functionality, if required.
+ *
+ * @return the apiBridge value.
+ */
+ public Object apiBridge() {
+ return this.apiBridge;
+ }
+
+ /**
+ * Set the apiBridge property: Details of API bridge functionality, if required.
+ *
+ * @param apiBridge the apiBridge value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withApiBridge(Object apiBridge) {
+ this.apiBridge = apiBridge;
+ return this;
+ }
+
+ /**
+ * Get the autoGeneratedDomainNameLabelScope property: The scope at which the auto-generated domain name can be
+ * re-used.
+ *
+ * @return the autoGeneratedDomainNameLabelScope value.
+ */
+ public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() {
+ return this.autoGeneratedDomainNameLabelScope;
+ }
+
+ /**
+ * Set the autoGeneratedDomainNameLabelScope property: The scope at which the auto-generated domain name can be
+ * re-used.
+ *
+ * @param autoGeneratedDomainNameLabelScope the autoGeneratedDomainNameLabelScope value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withAutoGeneratedDomainNameLabelScope(
+ AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) {
+ this.autoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope;
+ return this;
+ }
+
+ /**
+ * Get the autoGeneratedDomainNameLabel property: The autogenerated label used as part of the FQDNs for accessing
+ * the Communications Gateway.
+ *
+ * @return the autoGeneratedDomainNameLabel value.
+ */
+ public String autoGeneratedDomainNameLabel() {
+ return this.autoGeneratedDomainNameLabel;
+ }
+
+ /**
+ * Get the teamsVoicemailPilotNumber property: This number is used in Teams Phone Mobile scenarios for access to the
+ * voicemail IVR from the native dialer.
+ *
+ * @return the teamsVoicemailPilotNumber value.
+ */
+ public String teamsVoicemailPilotNumber() {
+ return this.teamsVoicemailPilotNumber;
+ }
+
+ /**
+ * Set the teamsVoicemailPilotNumber property: This number is used in Teams Phone Mobile scenarios for access to the
+ * voicemail IVR from the native dialer.
+ *
+ * @param teamsVoicemailPilotNumber the teamsVoicemailPilotNumber value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withTeamsVoicemailPilotNumber(String teamsVoicemailPilotNumber) {
+ this.teamsVoicemailPilotNumber = teamsVoicemailPilotNumber;
+ return this;
+ }
+
+ /**
+ * Get the onPremMcpEnabled property: Whether an on-premises Mobile Control Point is in use.
+ *
+ * @return the onPremMcpEnabled value.
+ */
+ public Boolean onPremMcpEnabled() {
+ return this.onPremMcpEnabled;
+ }
+
+ /**
+ * Set the onPremMcpEnabled property: Whether an on-premises Mobile Control Point is in use.
+ *
+ * @param onPremMcpEnabled the onPremMcpEnabled value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withOnPremMcpEnabled(Boolean onPremMcpEnabled) {
+ this.onPremMcpEnabled = onPremMcpEnabled;
+ return this;
+ }
+
+ /**
+ * Get the emergencyDialStrings property: A list of dial strings used for emergency calling.
+ *
+ * @return the emergencyDialStrings value.
+ */
+ public List emergencyDialStrings() {
+ return this.emergencyDialStrings;
+ }
+
+ /**
+ * Set the emergencyDialStrings property: A list of dial strings used for emergency calling.
+ *
+ * @param emergencyDialStrings the emergencyDialStrings value to set.
+ * @return the CommunicationsGatewayProperties object itself.
+ */
+ public CommunicationsGatewayProperties withEmergencyDialStrings(List emergencyDialStrings) {
+ this.emergencyDialStrings = emergencyDialStrings;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (serviceLocations() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property serviceLocations in model CommunicationsGatewayProperties"));
+ } else {
+ serviceLocations().forEach(e -> e.validate());
+ }
+ if (connectivity() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property connectivity in model CommunicationsGatewayProperties"));
+ }
+ if (codecs() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property codecs in model CommunicationsGatewayProperties"));
+ }
+ if (e911Type() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property e911Type in model CommunicationsGatewayProperties"));
+ }
+ if (platforms() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property platforms in model CommunicationsGatewayProperties"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(CommunicationsGatewayProperties.class);
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/OperationInner.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/OperationInner.java
new file mode 100644
index 0000000000000..9e828858c2ab3
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/OperationInner.java
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.voiceservices.models.ActionType;
+import com.azure.resourcemanager.voiceservices.models.OperationDisplay;
+import com.azure.resourcemanager.voiceservices.models.Origin;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Fluent
+public final class OperationInner {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for
+ * ARM/control-plane operations.
+ */
+ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY)
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ @JsonProperty(value = "display")
+ private OperationDisplay display;
+
+ /*
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+ * value is "user,system"
+ */
+ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
+ private Origin origin;
+
+ /*
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY)
+ private ActionType actionType;
+
+ /** Creates an instance of OperationInner class. */
+ public OperationInner() {
+ }
+
+ /**
+ * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for ARM/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Get the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Localized display information for this particular operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ public Origin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
+ * only APIs.
+ *
+ * @return the actionType value.
+ */
+ public ActionType actionType() {
+ return this.actionType;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/TestLineInner.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/TestLineInner.java
new file mode 100644
index 0000000000000..847910ed4037a
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/TestLineInner.java
@@ -0,0 +1,131 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.voiceservices.models.ProvisioningState;
+import com.azure.resourcemanager.voiceservices.models.TestLinePurpose;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
+/** A TestLine resource. */
+@Fluent
+public final class TestLineInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ @JsonProperty(value = "properties")
+ private TestLineProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of TestLineInner class. */
+ public TestLineInner() {
+ }
+
+ /**
+ * Get the innerProperties property: The resource-specific properties for this resource.
+ *
+ * @return the innerProperties value.
+ */
+ private TestLineProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public TestLineInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public TestLineInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: Resource provisioning state.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the phoneNumber property: The phone number.
+ *
+ * @return the phoneNumber value.
+ */
+ public String phoneNumber() {
+ return this.innerProperties() == null ? null : this.innerProperties().phoneNumber();
+ }
+
+ /**
+ * Set the phoneNumber property: The phone number.
+ *
+ * @param phoneNumber the phoneNumber value to set.
+ * @return the TestLineInner object itself.
+ */
+ public TestLineInner withPhoneNumber(String phoneNumber) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new TestLineProperties();
+ }
+ this.innerProperties().withPhoneNumber(phoneNumber);
+ return this;
+ }
+
+ /**
+ * Get the purpose property: Purpose of this test line, e.g. automated or manual testing.
+ *
+ * @return the purpose value.
+ */
+ public TestLinePurpose purpose() {
+ return this.innerProperties() == null ? null : this.innerProperties().purpose();
+ }
+
+ /**
+ * Set the purpose property: Purpose of this test line, e.g. automated or manual testing.
+ *
+ * @param purpose the purpose value to set.
+ * @return the TestLineInner object itself.
+ */
+ public TestLineInner withPurpose(TestLinePurpose purpose) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new TestLineProperties();
+ }
+ this.innerProperties().withPurpose(purpose);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/TestLineProperties.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/TestLineProperties.java
new file mode 100644
index 0000000000000..44152c2aa7c83
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/TestLineProperties.java
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.voiceservices.models.ProvisioningState;
+import com.azure.resourcemanager.voiceservices.models.TestLinePurpose;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Details of the TestLine resource. */
+@Fluent
+public final class TestLineProperties {
+ /*
+ * Resource provisioning state.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningState provisioningState;
+
+ /*
+ * The phone number
+ */
+ @JsonProperty(value = "phoneNumber", required = true)
+ private String phoneNumber;
+
+ /*
+ * Purpose of this test line, e.g. automated or manual testing
+ */
+ @JsonProperty(value = "purpose", required = true)
+ private TestLinePurpose purpose;
+
+ /** Creates an instance of TestLineProperties class. */
+ public TestLineProperties() {
+ }
+
+ /**
+ * Get the provisioningState property: Resource provisioning state.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the phoneNumber property: The phone number.
+ *
+ * @return the phoneNumber value.
+ */
+ public String phoneNumber() {
+ return this.phoneNumber;
+ }
+
+ /**
+ * Set the phoneNumber property: The phone number.
+ *
+ * @param phoneNumber the phoneNumber value to set.
+ * @return the TestLineProperties object itself.
+ */
+ public TestLineProperties withPhoneNumber(String phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ return this;
+ }
+
+ /**
+ * Get the purpose property: Purpose of this test line, e.g. automated or manual testing.
+ *
+ * @return the purpose value.
+ */
+ public TestLinePurpose purpose() {
+ return this.purpose;
+ }
+
+ /**
+ * Set the purpose property: Purpose of this test line, e.g. automated or manual testing.
+ *
+ * @param purpose the purpose value to set.
+ * @return the TestLineProperties object itself.
+ */
+ public TestLineProperties withPurpose(TestLinePurpose purpose) {
+ this.purpose = purpose;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (phoneNumber() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property phoneNumber in model TestLineProperties"));
+ }
+ if (purpose() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property purpose in model TestLineProperties"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(TestLineProperties.class);
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/package-info.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/package-info.java
new file mode 100644
index 0000000000000..69beb2b091328
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/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 MicrosoftVoiceServices. null. */
+package com.azure.resourcemanager.voiceservices.fluent.models;
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/package-info.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/package-info.java
new file mode 100644
index 0000000000000..f46738393017c
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/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 MicrosoftVoiceServices. null. */
+package com.azure.resourcemanager.voiceservices.fluent;
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CheckNameAvailabilityResponseImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CheckNameAvailabilityResponseImpl.java
new file mode 100644
index 0000000000000..73e60c6525f8d
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CheckNameAvailabilityResponseImpl.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.resourcemanager.voiceservices.fluent.models.CheckNameAvailabilityResponseInner;
+import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityReason;
+import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityResponse;
+
+public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailabilityResponse {
+ private CheckNameAvailabilityResponseInner innerObject;
+
+ private final com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager;
+
+ CheckNameAvailabilityResponseImpl(
+ CheckNameAvailabilityResponseInner innerObject,
+ com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public Boolean nameAvailable() {
+ return this.innerModel().nameAvailable();
+ }
+
+ public CheckNameAvailabilityReason reason() {
+ return this.innerModel().reason();
+ }
+
+ public String message() {
+ return this.innerModel().message();
+ }
+
+ public CheckNameAvailabilityResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.voiceservices.VoiceservicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewayImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewayImpl.java
new file mode 100644
index 0000000000000..f166c7cce7865
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewayImpl.java
@@ -0,0 +1,316 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.voiceservices.fluent.models.CommunicationsGatewayInner;
+import com.azure.resourcemanager.voiceservices.models.AutoGeneratedDomainNameLabelScope;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsGateway;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsGatewayUpdate;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsPlatform;
+import com.azure.resourcemanager.voiceservices.models.Connectivity;
+import com.azure.resourcemanager.voiceservices.models.E911Type;
+import com.azure.resourcemanager.voiceservices.models.ProvisioningState;
+import com.azure.resourcemanager.voiceservices.models.ServiceRegionProperties;
+import com.azure.resourcemanager.voiceservices.models.Status;
+import com.azure.resourcemanager.voiceservices.models.TeamsCodecs;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class CommunicationsGatewayImpl
+ implements CommunicationsGateway, CommunicationsGateway.Definition, CommunicationsGateway.Update {
+ private CommunicationsGatewayInner innerObject;
+
+ private final com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public Status status() {
+ return this.innerModel().status();
+ }
+
+ public List serviceLocations() {
+ List inner = this.innerModel().serviceLocations();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Connectivity connectivity() {
+ return this.innerModel().connectivity();
+ }
+
+ public List codecs() {
+ List inner = this.innerModel().codecs();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public E911Type e911Type() {
+ return this.innerModel().e911Type();
+ }
+
+ public List platforms() {
+ List inner = this.innerModel().platforms();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Object apiBridge() {
+ return this.innerModel().apiBridge();
+ }
+
+ public AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope() {
+ return this.innerModel().autoGeneratedDomainNameLabelScope();
+ }
+
+ public String autoGeneratedDomainNameLabel() {
+ return this.innerModel().autoGeneratedDomainNameLabel();
+ }
+
+ public String teamsVoicemailPilotNumber() {
+ return this.innerModel().teamsVoicemailPilotNumber();
+ }
+
+ public Boolean onPremMcpEnabled() {
+ return this.innerModel().onPremMcpEnabled();
+ }
+
+ public List emergencyDialStrings() {
+ List inner = this.innerModel().emergencyDialStrings();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public CommunicationsGatewayInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.voiceservices.VoiceservicesManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String communicationsGatewayName;
+
+ private CommunicationsGatewayUpdate updateProperties;
+
+ public CommunicationsGatewayImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public CommunicationsGateway create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCommunicationsGateways()
+ .createOrUpdate(resourceGroupName, communicationsGatewayName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public CommunicationsGateway create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCommunicationsGateways()
+ .createOrUpdate(resourceGroupName, communicationsGatewayName, this.innerModel(), context);
+ return this;
+ }
+
+ CommunicationsGatewayImpl(
+ String name, com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerObject = new CommunicationsGatewayInner();
+ this.serviceManager = serviceManager;
+ this.communicationsGatewayName = name;
+ }
+
+ public CommunicationsGatewayImpl update() {
+ this.updateProperties = new CommunicationsGatewayUpdate();
+ return this;
+ }
+
+ public CommunicationsGateway apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCommunicationsGateways()
+ .updateWithResponse(resourceGroupName, communicationsGatewayName, updateProperties, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public CommunicationsGateway apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCommunicationsGateways()
+ .updateWithResponse(resourceGroupName, communicationsGatewayName, updateProperties, context)
+ .getValue();
+ return this;
+ }
+
+ CommunicationsGatewayImpl(
+ CommunicationsGatewayInner innerObject,
+ com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.communicationsGatewayName = Utils.getValueFromIdByName(innerObject.id(), "communicationsGateways");
+ }
+
+ public CommunicationsGateway refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCommunicationsGateways()
+ .getByResourceGroupWithResponse(resourceGroupName, communicationsGatewayName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public CommunicationsGateway refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getCommunicationsGateways()
+ .getByResourceGroupWithResponse(resourceGroupName, communicationsGatewayName, context)
+ .getValue();
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateProperties.withTags(tags);
+ return this;
+ }
+ }
+
+ public CommunicationsGatewayImpl withServiceLocations(List serviceLocations) {
+ this.innerModel().withServiceLocations(serviceLocations);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withConnectivity(Connectivity connectivity) {
+ this.innerModel().withConnectivity(connectivity);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withCodecs(List codecs) {
+ this.innerModel().withCodecs(codecs);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withE911Type(E911Type e911Type) {
+ this.innerModel().withE911Type(e911Type);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withPlatforms(List platforms) {
+ this.innerModel().withPlatforms(platforms);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withApiBridge(Object apiBridge) {
+ this.innerModel().withApiBridge(apiBridge);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withAutoGeneratedDomainNameLabelScope(
+ AutoGeneratedDomainNameLabelScope autoGeneratedDomainNameLabelScope) {
+ this.innerModel().withAutoGeneratedDomainNameLabelScope(autoGeneratedDomainNameLabelScope);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withTeamsVoicemailPilotNumber(String teamsVoicemailPilotNumber) {
+ this.innerModel().withTeamsVoicemailPilotNumber(teamsVoicemailPilotNumber);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withOnPremMcpEnabled(Boolean onPremMcpEnabled) {
+ this.innerModel().withOnPremMcpEnabled(onPremMcpEnabled);
+ return this;
+ }
+
+ public CommunicationsGatewayImpl withEmergencyDialStrings(List emergencyDialStrings) {
+ this.innerModel().withEmergencyDialStrings(emergencyDialStrings);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewaysClientImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewaysClientImpl.java
new file mode 100644
index 0000000000000..575352abb39bc
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewaysClientImpl.java
@@ -0,0 +1,1494 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.voiceservices.fluent.CommunicationsGatewaysClient;
+import com.azure.resourcemanager.voiceservices.fluent.models.CommunicationsGatewayInner;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsGatewayListResult;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsGatewayUpdate;
+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 CommunicationsGatewaysClient. */
+public final class CommunicationsGatewaysClientImpl implements CommunicationsGatewaysClient {
+ /** The proxy service used to perform REST calls. */
+ private final CommunicationsGatewaysService service;
+
+ /** The service client containing this operation class. */
+ private final MicrosoftVoiceServicesImpl client;
+
+ /**
+ * Initializes an instance of CommunicationsGatewaysClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ CommunicationsGatewaysClientImpl(MicrosoftVoiceServicesImpl client) {
+ this.service =
+ RestProxy
+ .create(CommunicationsGatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftVoiceServicesCommunicationsGateways to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftVoiceServic")
+ public interface CommunicationsGatewaysService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.VoiceServices/communicationsGateways")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @BodyParam("application/json") CommunicationsGatewayInner resource,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @BodyParam("application/json") CommunicationsGatewayUpdate properties,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * List CommunicationsGateway resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List CommunicationsGateway resources by subscription ID.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List CommunicationsGateway resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List CommunicationsGateway resources by subscription ID.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List CommunicationsGateway resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List CommunicationsGateway resources by subscription ID.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * List CommunicationsGateway resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List CommunicationsGateway resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List CommunicationsGateway resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List CommunicationsGateway resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List CommunicationsGateway resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * List CommunicationsGateway resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Get a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 CommunicationsGateway along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String communicationsGatewayName) {
+ 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @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 CommunicationsGateway along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String communicationsGatewayName, 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ accept,
+ context);
+ }
+
+ /**
+ * Get a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 CommunicationsGateway on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(
+ String resourceGroupName, String communicationsGatewayName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, communicationsGatewayName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @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 CommunicationsGateway along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String communicationsGatewayName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, communicationsGatewayName, context).block();
+ }
+
+ /**
+ * Get a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 CommunicationsGateway.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CommunicationsGatewayInner getByResourceGroup(String resourceGroupName, String communicationsGatewayName) {
+ return getByResourceGroupWithResponse(resourceGroupName, communicationsGatewayName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayInner resource) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ resource,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayInner resource,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ resource,
+ accept,
+ context);
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, CommunicationsGatewayInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayInner resource) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, communicationsGatewayName, resource);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ CommunicationsGatewayInner.class,
+ CommunicationsGatewayInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, CommunicationsGatewayInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayInner resource,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, communicationsGatewayName, resource, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ CommunicationsGatewayInner.class,
+ CommunicationsGatewayInner.class,
+ context);
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, CommunicationsGatewayInner> beginCreateOrUpdate(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayInner resource) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, communicationsGatewayName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, CommunicationsGatewayInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayInner resource,
+ Context context) {
+ return this
+ .beginCreateOrUpdateAsync(resourceGroupName, communicationsGatewayName, resource, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, communicationsGatewayName, resource)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayInner resource,
+ Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, communicationsGatewayName, resource, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CommunicationsGatewayInner createOrUpdate(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayInner resource) {
+ return createOrUpdateAsync(resourceGroupName, communicationsGatewayName, resource).block();
+ }
+
+ /**
+ * Create a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CommunicationsGatewayInner createOrUpdate(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayInner resource,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, communicationsGatewayName, resource, context).block();
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 communicationsGatewayName) {
+ 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @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 communicationsGatewayName, 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ accept,
+ context);
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 communicationsGatewayName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, communicationsGatewayName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String communicationsGatewayName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, communicationsGatewayName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String communicationsGatewayName) {
+ return this.beginDeleteAsync(resourceGroupName, communicationsGatewayName).getSyncPoller();
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String communicationsGatewayName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, communicationsGatewayName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String communicationsGatewayName) {
+ return beginDeleteAsync(resourceGroupName, communicationsGatewayName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String communicationsGatewayName, Context context) {
+ return beginDeleteAsync(resourceGroupName, communicationsGatewayName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String communicationsGatewayName) {
+ deleteAsync(resourceGroupName, communicationsGatewayName).block();
+ }
+
+ /**
+ * Delete a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String communicationsGatewayName, Context context) {
+ deleteAsync(resourceGroupName, communicationsGatewayName, context).block();
+ }
+
+ /**
+ * Update a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayUpdate properties) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ properties,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayUpdate properties,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ properties,
+ accept,
+ context);
+ }
+
+ /**
+ * Update a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayUpdate properties) {
+ return updateWithResponseAsync(resourceGroupName, communicationsGatewayName, properties)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Update a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ CommunicationsGatewayUpdate properties,
+ Context context) {
+ return updateWithResponseAsync(resourceGroupName, communicationsGatewayName, properties, context).block();
+ }
+
+ /**
+ * Update a CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a CommunicationsGateway resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CommunicationsGatewayInner update(
+ String resourceGroupName, String communicationsGatewayName, CommunicationsGatewayUpdate properties) {
+ return updateWithResponse(resourceGroupName, communicationsGatewayName, properties, Context.NONE).getValue();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a CommunicationsGateway list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewaysImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewaysImpl.java
new file mode 100644
index 0000000000000..ba3b22b9d2536
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewaysImpl.java
@@ -0,0 +1,186 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.voiceservices.fluent.CommunicationsGatewaysClient;
+import com.azure.resourcemanager.voiceservices.fluent.models.CommunicationsGatewayInner;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsGateway;
+import com.azure.resourcemanager.voiceservices.models.CommunicationsGateways;
+
+public final class CommunicationsGatewaysImpl implements CommunicationsGateways {
+ private static final ClientLogger LOGGER = new ClientLogger(CommunicationsGatewaysImpl.class);
+
+ private final CommunicationsGatewaysClient innerClient;
+
+ private final com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager;
+
+ public CommunicationsGatewaysImpl(
+ CommunicationsGatewaysClient innerClient,
+ com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new CommunicationsGatewayImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new CommunicationsGatewayImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new CommunicationsGatewayImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new CommunicationsGatewayImpl(inner1, this.manager()));
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String communicationsGatewayName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, communicationsGatewayName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new CommunicationsGatewayImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public CommunicationsGateway getByResourceGroup(String resourceGroupName, String communicationsGatewayName) {
+ CommunicationsGatewayInner inner =
+ this.serviceClient().getByResourceGroup(resourceGroupName, communicationsGatewayName);
+ if (inner != null) {
+ return new CommunicationsGatewayImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String communicationsGatewayName) {
+ this.serviceClient().delete(resourceGroupName, communicationsGatewayName);
+ }
+
+ public void delete(String resourceGroupName, String communicationsGatewayName, Context context) {
+ this.serviceClient().delete(resourceGroupName, communicationsGatewayName, context);
+ }
+
+ public CommunicationsGateway getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String communicationsGatewayName = Utils.getValueFromIdByName(id, "communicationsGateways");
+ if (communicationsGatewayName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'communicationsGateways'.",
+ id)));
+ }
+ return this
+ .getByResourceGroupWithResponse(resourceGroupName, communicationsGatewayName, Context.NONE)
+ .getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String communicationsGatewayName = Utils.getValueFromIdByName(id, "communicationsGateways");
+ if (communicationsGatewayName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'communicationsGateways'.",
+ id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, communicationsGatewayName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String communicationsGatewayName = Utils.getValueFromIdByName(id, "communicationsGateways");
+ if (communicationsGatewayName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'communicationsGateways'.",
+ id)));
+ }
+ this.delete(resourceGroupName, communicationsGatewayName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String communicationsGatewayName = Utils.getValueFromIdByName(id, "communicationsGateways");
+ if (communicationsGatewayName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'communicationsGateways'.",
+ id)));
+ }
+ this.delete(resourceGroupName, communicationsGatewayName, context);
+ }
+
+ private CommunicationsGatewaysClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.voiceservices.VoiceservicesManager manager() {
+ return this.serviceManager;
+ }
+
+ public CommunicationsGatewayImpl define(String name) {
+ return new CommunicationsGatewayImpl(name, this.manager());
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesBuilder.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesBuilder.java
new file mode 100644
index 0000000000000..80b9f0e6952c6
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesBuilder.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.voiceservices.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 MicrosoftVoiceServicesImpl type. */
+@ServiceClientBuilder(serviceClients = {MicrosoftVoiceServicesImpl.class})
+public final class MicrosoftVoiceServicesBuilder {
+ /*
+ * The ID of the target subscription.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the MicrosoftVoiceServicesBuilder.
+ */
+ public MicrosoftVoiceServicesBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the MicrosoftVoiceServicesBuilder.
+ */
+ public MicrosoftVoiceServicesBuilder 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 MicrosoftVoiceServicesBuilder.
+ */
+ public MicrosoftVoiceServicesBuilder 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 MicrosoftVoiceServicesBuilder.
+ */
+ public MicrosoftVoiceServicesBuilder 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 MicrosoftVoiceServicesBuilder.
+ */
+ public MicrosoftVoiceServicesBuilder 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 MicrosoftVoiceServicesBuilder.
+ */
+ public MicrosoftVoiceServicesBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of MicrosoftVoiceServicesImpl with the provided parameters.
+ *
+ * @return an instance of MicrosoftVoiceServicesImpl.
+ */
+ public MicrosoftVoiceServicesImpl 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();
+ MicrosoftVoiceServicesImpl client =
+ new MicrosoftVoiceServicesImpl(
+ localPipeline,
+ localSerializerAdapter,
+ localDefaultPollInterval,
+ localEnvironment,
+ subscriptionId,
+ localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesImpl.java
new file mode 100644
index 0000000000000..234f0069af98a
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesImpl.java
@@ -0,0 +1,332 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.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.voiceservices.fluent.CommunicationsGatewaysClient;
+import com.azure.resourcemanager.voiceservices.fluent.MicrosoftVoiceServices;
+import com.azure.resourcemanager.voiceservices.fluent.NameAvailabilitiesClient;
+import com.azure.resourcemanager.voiceservices.fluent.OperationsClient;
+import com.azure.resourcemanager.voiceservices.fluent.TestLinesClient;
+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 MicrosoftVoiceServicesImpl type. */
+@ServiceClient(builder = MicrosoftVoiceServicesBuilder.class)
+public final class MicrosoftVoiceServicesImpl implements MicrosoftVoiceServices {
+ /** The ID of the target subscription. */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /** The serializer to serialize an object into a string. */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /** The default poll interval for long-running operation. */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /** The OperationsClient object to access its operations. */
+ private final OperationsClient operations;
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ public OperationsClient getOperations() {
+ return this.operations;
+ }
+
+ /** The CommunicationsGatewaysClient object to access its operations. */
+ private final CommunicationsGatewaysClient communicationsGateways;
+
+ /**
+ * Gets the CommunicationsGatewaysClient object to access its operations.
+ *
+ * @return the CommunicationsGatewaysClient object.
+ */
+ public CommunicationsGatewaysClient getCommunicationsGateways() {
+ return this.communicationsGateways;
+ }
+
+ /** The NameAvailabilitiesClient object to access its operations. */
+ private final NameAvailabilitiesClient nameAvailabilities;
+
+ /**
+ * Gets the NameAvailabilitiesClient object to access its operations.
+ *
+ * @return the NameAvailabilitiesClient object.
+ */
+ public NameAvailabilitiesClient getNameAvailabilities() {
+ return this.nameAvailabilities;
+ }
+
+ /** The TestLinesClient object to access its operations. */
+ private final TestLinesClient testLines;
+
+ /**
+ * Gets the TestLinesClient object to access its operations.
+ *
+ * @return the TestLinesClient object.
+ */
+ public TestLinesClient getTestLines() {
+ return this.testLines;
+ }
+
+ /**
+ * Initializes an instance of MicrosoftVoiceServices client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId The ID of the target subscription.
+ * @param endpoint server parameter.
+ */
+ MicrosoftVoiceServicesImpl(
+ 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 = "2023-01-31";
+ this.operations = new OperationsClientImpl(this);
+ this.communicationsGateways = new CommunicationsGatewaysClientImpl(this);
+ this.nameAvailabilities = new NameAvailabilitiesClientImpl(this);
+ this.testLines = new TestLinesClientImpl(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(MicrosoftVoiceServicesImpl.class);
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/NameAvailabilitiesClientImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/NameAvailabilitiesClientImpl.java
new file mode 100644
index 0000000000000..d8f20d6d68072
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/NameAvailabilitiesClientImpl.java
@@ -0,0 +1,215 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.voiceservices.fluent.NameAvailabilitiesClient;
+import com.azure.resourcemanager.voiceservices.fluent.models.CheckNameAvailabilityResponseInner;
+import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityRequest;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in NameAvailabilitiesClient. */
+public final class NameAvailabilitiesClientImpl implements NameAvailabilitiesClient {
+ /** The proxy service used to perform REST calls. */
+ private final NameAvailabilitiesService service;
+
+ /** The service client containing this operation class. */
+ private final MicrosoftVoiceServicesImpl client;
+
+ /**
+ * Initializes an instance of NameAvailabilitiesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ NameAvailabilitiesClientImpl(MicrosoftVoiceServicesImpl client) {
+ this.service =
+ RestProxy.create(NameAvailabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftVoiceServicesNameAvailabilities to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftVoiceServic")
+ public interface NameAvailabilitiesService {
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/providers/Microsoft.VoiceServices/locations/{location}"
+ + "/checkNameAvailability")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> checkLocal(
+ @HostParam("$host") String endpoint,
+ @PathParam("location") String location,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") CheckNameAvailabilityRequest body,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Check whether the resource name is available in the given region.
+ *
+ * @param location The location in which uniqueness will be verified.
+ * @param body The check availability request body.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> checkLocalWithResponseAsync(
+ String location, CheckNameAvailabilityRequest body) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location 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 (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .checkLocal(
+ this.client.getEndpoint(),
+ location,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ body,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Check whether the resource name is available in the given region.
+ *
+ * @param location The location in which uniqueness will be verified.
+ * @param body The check availability request body.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> checkLocalWithResponseAsync(
+ String location, CheckNameAvailabilityRequest body, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location 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 (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .checkLocal(
+ this.client.getEndpoint(),
+ location,
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ body,
+ accept,
+ context);
+ }
+
+ /**
+ * Check whether the resource name is available in the given region.
+ *
+ * @param location The location in which uniqueness will be verified.
+ * @param body The check availability request body.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono checkLocalAsync(
+ String location, CheckNameAvailabilityRequest body) {
+ return checkLocalWithResponseAsync(location, body).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Check whether the resource name is available in the given region.
+ *
+ * @param location The location in which uniqueness will be verified.
+ * @param body The check availability request body.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response checkLocalWithResponse(
+ String location, CheckNameAvailabilityRequest body, Context context) {
+ return checkLocalWithResponseAsync(location, body, context).block();
+ }
+
+ /**
+ * Check whether the resource name is available in the given region.
+ *
+ * @param location The location in which uniqueness will be verified.
+ * @param body The check availability request body.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CheckNameAvailabilityResponseInner checkLocal(String location, CheckNameAvailabilityRequest body) {
+ return checkLocalWithResponse(location, body, Context.NONE).getValue();
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/NameAvailabilitiesImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/NameAvailabilitiesImpl.java
new file mode 100644
index 0000000000000..5ecd4a5b9c8d6
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/NameAvailabilitiesImpl.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.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.voiceservices.fluent.NameAvailabilitiesClient;
+import com.azure.resourcemanager.voiceservices.fluent.models.CheckNameAvailabilityResponseInner;
+import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityResponse;
+import com.azure.resourcemanager.voiceservices.models.NameAvailabilities;
+
+public final class NameAvailabilitiesImpl implements NameAvailabilities {
+ private static final ClientLogger LOGGER = new ClientLogger(NameAvailabilitiesImpl.class);
+
+ private final NameAvailabilitiesClient innerClient;
+
+ private final com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager;
+
+ public NameAvailabilitiesImpl(
+ NameAvailabilitiesClient innerClient,
+ com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response checkLocalWithResponse(
+ String location, CheckNameAvailabilityRequest body, Context context) {
+ Response inner =
+ this.serviceClient().checkLocalWithResponse(location, body, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public CheckNameAvailabilityResponse checkLocal(String location, CheckNameAvailabilityRequest body) {
+ CheckNameAvailabilityResponseInner inner = this.serviceClient().checkLocal(location, body);
+ if (inner != null) {
+ return new CheckNameAvailabilityResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private NameAvailabilitiesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.voiceservices.VoiceservicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationImpl.java
new file mode 100644
index 0000000000000..12d0eeb091505
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.resourcemanager.voiceservices.fluent.models.OperationInner;
+import com.azure.resourcemanager.voiceservices.models.ActionType;
+import com.azure.resourcemanager.voiceservices.models.Operation;
+import com.azure.resourcemanager.voiceservices.models.OperationDisplay;
+import com.azure.resourcemanager.voiceservices.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager;
+
+ OperationImpl(
+ OperationInner innerObject, com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public Origin origin() {
+ return this.innerModel().origin();
+ }
+
+ public ActionType actionType() {
+ return this.innerModel().actionType();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.voiceservices.VoiceservicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationsClientImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..34d8f46bb430a
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationsClientImpl.java
@@ -0,0 +1,276 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.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.voiceservices.fluent.OperationsClient;
+import com.azure.resourcemanager.voiceservices.fluent.models.OperationInner;
+import com.azure.resourcemanager.voiceservices.models.OperationListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public final class OperationsClientImpl implements OperationsClient {
+ /** The proxy service used to perform REST calls. */
+ private final OperationsService service;
+
+ /** The service client containing this operation class. */
+ private final MicrosoftVoiceServicesImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(MicrosoftVoiceServicesImpl client) {
+ this.service =
+ RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftVoiceServicesOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftVoiceServic")
+ public interface OperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.VoiceServices/operations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationsImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationsImpl.java
new file mode 100644
index 0000000000000..9c4f1b57614ac
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/OperationsImpl.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.voiceservices.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.voiceservices.fluent.OperationsClient;
+import com.azure.resourcemanager.voiceservices.fluent.models.OperationInner;
+import com.azure.resourcemanager.voiceservices.models.Operation;
+import com.azure.resourcemanager.voiceservices.models.Operations;
+
+public final class OperationsImpl implements Operations {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager;
+
+ public OperationsImpl(
+ OperationsClient innerClient, com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.voiceservices.VoiceservicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLineImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLineImpl.java
new file mode 100644
index 0000000000000..4164f12df3edc
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLineImpl.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.voiceservices.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.voiceservices.fluent.models.TestLineInner;
+import com.azure.resourcemanager.voiceservices.models.ProvisioningState;
+import com.azure.resourcemanager.voiceservices.models.TestLine;
+import com.azure.resourcemanager.voiceservices.models.TestLinePurpose;
+import com.azure.resourcemanager.voiceservices.models.TestLineUpdate;
+import java.util.Collections;
+import java.util.Map;
+
+public final class TestLineImpl implements TestLine, TestLine.Definition, TestLine.Update {
+ private TestLineInner innerObject;
+
+ private final com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public String phoneNumber() {
+ return this.innerModel().phoneNumber();
+ }
+
+ public TestLinePurpose purpose() {
+ return this.innerModel().purpose();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public TestLineInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.voiceservices.VoiceservicesManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String communicationsGatewayName;
+
+ private String testLineName;
+
+ private TestLineUpdate updateProperties;
+
+ public TestLineImpl withExistingCommunicationsGateway(String resourceGroupName, String communicationsGatewayName) {
+ this.resourceGroupName = resourceGroupName;
+ this.communicationsGatewayName = communicationsGatewayName;
+ return this;
+ }
+
+ public TestLine create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getTestLines()
+ .createOrUpdate(
+ resourceGroupName, communicationsGatewayName, testLineName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public TestLine create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getTestLines()
+ .createOrUpdate(resourceGroupName, communicationsGatewayName, testLineName, this.innerModel(), context);
+ return this;
+ }
+
+ TestLineImpl(String name, com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerObject = new TestLineInner();
+ this.serviceManager = serviceManager;
+ this.testLineName = name;
+ }
+
+ public TestLineImpl update() {
+ this.updateProperties = new TestLineUpdate();
+ return this;
+ }
+
+ public TestLine apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getTestLines()
+ .updateWithResponse(
+ resourceGroupName, communicationsGatewayName, testLineName, updateProperties, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public TestLine apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getTestLines()
+ .updateWithResponse(
+ resourceGroupName, communicationsGatewayName, testLineName, updateProperties, context)
+ .getValue();
+ return this;
+ }
+
+ TestLineImpl(
+ TestLineInner innerObject, com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.communicationsGatewayName = Utils.getValueFromIdByName(innerObject.id(), "communicationsGateways");
+ this.testLineName = Utils.getValueFromIdByName(innerObject.id(), "testLines");
+ }
+
+ public TestLine refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getTestLines()
+ .getWithResponse(resourceGroupName, communicationsGatewayName, testLineName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public TestLine refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getTestLines()
+ .getWithResponse(resourceGroupName, communicationsGatewayName, testLineName, context)
+ .getValue();
+ return this;
+ }
+
+ public TestLineImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public TestLineImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public TestLineImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateProperties.withTags(tags);
+ return this;
+ }
+ }
+
+ public TestLineImpl withPhoneNumber(String phoneNumber) {
+ this.innerModel().withPhoneNumber(phoneNumber);
+ return this;
+ }
+
+ public TestLineImpl withPurpose(TestLinePurpose purpose) {
+ this.innerModel().withPurpose(purpose);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLinesClientImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLinesClientImpl.java
new file mode 100644
index 0000000000000..7efa1cfaa8f59
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLinesClientImpl.java
@@ -0,0 +1,1360 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.voiceservices.fluent.TestLinesClient;
+import com.azure.resourcemanager.voiceservices.fluent.models.TestLineInner;
+import com.azure.resourcemanager.voiceservices.models.TestLineListResult;
+import com.azure.resourcemanager.voiceservices.models.TestLineUpdate;
+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 TestLinesClient. */
+public final class TestLinesClientImpl implements TestLinesClient {
+ /** The proxy service used to perform REST calls. */
+ private final TestLinesService service;
+
+ /** The service client containing this operation class. */
+ private final MicrosoftVoiceServicesImpl client;
+
+ /**
+ * Initializes an instance of TestLinesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ TestLinesClientImpl(MicrosoftVoiceServicesImpl client) {
+ this.service =
+ RestProxy.create(TestLinesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for MicrosoftVoiceServicesTestLines to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "MicrosoftVoiceServic")
+ public interface TestLinesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}/testLines")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByCommunicationsGateway(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @PathParam("testLineName") String testLineName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @PathParam("testLineName") String testLineName,
+ @BodyParam("application/json") TestLineInner resource,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @PathParam("testLineName") String testLineName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VoiceServices"
+ + "/communicationsGateways/{communicationsGatewayName}/testLines/{testLineName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("communicationsGatewayName") String communicationsGatewayName,
+ @PathParam("testLineName") String testLineName,
+ @BodyParam("application/json") TestLineUpdate properties,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByCommunicationsGatewayNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * List TestLine resources by CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByCommunicationsGatewaySinglePageAsync(
+ String resourceGroupName, String communicationsGatewayName) {
+ 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByCommunicationsGateway(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List TestLine resources by CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByCommunicationsGatewaySinglePageAsync(
+ String resourceGroupName, String communicationsGatewayName, 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByCommunicationsGateway(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List TestLine resources by CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByCommunicationsGatewayAsync(
+ String resourceGroupName, String communicationsGatewayName) {
+ return new PagedFlux<>(
+ () -> listByCommunicationsGatewaySinglePageAsync(resourceGroupName, communicationsGatewayName),
+ nextLink -> listByCommunicationsGatewayNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List TestLine resources by CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByCommunicationsGatewayAsync(
+ String resourceGroupName, String communicationsGatewayName, Context context) {
+ return new PagedFlux<>(
+ () -> listByCommunicationsGatewaySinglePageAsync(resourceGroupName, communicationsGatewayName, context),
+ nextLink -> listByCommunicationsGatewayNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List TestLine resources by CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByCommunicationsGateway(
+ String resourceGroupName, String communicationsGatewayName) {
+ return new PagedIterable<>(listByCommunicationsGatewayAsync(resourceGroupName, communicationsGatewayName));
+ }
+
+ /**
+ * List TestLine resources by CommunicationsGateway.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByCommunicationsGateway(
+ String resourceGroupName, String communicationsGatewayName, Context context) {
+ return new PagedIterable<>(
+ listByCommunicationsGatewayAsync(resourceGroupName, communicationsGatewayName, context));
+ }
+
+ /**
+ * Get a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 TestLine along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName) {
+ 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (testLineName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter testLineName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ testLineName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @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 TestLine along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (testLineName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter testLineName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ testLineName,
+ accept,
+ context);
+ }
+
+ /**
+ * Get a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 TestLine on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName) {
+ return getWithResponseAsync(resourceGroupName, communicationsGatewayName, testLineName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @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 TestLine along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, Context context) {
+ return getWithResponseAsync(resourceGroupName, communicationsGatewayName, testLineName, context).block();
+ }
+
+ /**
+ * Get a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 TestLine.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TestLineInner get(String resourceGroupName, String communicationsGatewayName, String testLineName) {
+ return getWithResponse(resourceGroupName, communicationsGatewayName, testLineName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineInner resource) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (testLineName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter testLineName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ testLineName,
+ resource,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineInner resource,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (testLineName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter testLineName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ testLineName,
+ resource,
+ accept,
+ context);
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, TestLineInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineInner resource) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, communicationsGatewayName, testLineName, resource);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ TestLineInner.class,
+ TestLineInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, TestLineInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineInner resource,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(
+ resourceGroupName, communicationsGatewayName, testLineName, resource, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), TestLineInner.class, TestLineInner.class, context);
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, TestLineInner> beginCreateOrUpdate(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineInner resource) {
+ return this
+ .beginCreateOrUpdateAsync(resourceGroupName, communicationsGatewayName, testLineName, resource)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, TestLineInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineInner resource,
+ Context context) {
+ return this
+ .beginCreateOrUpdateAsync(resourceGroupName, communicationsGatewayName, testLineName, resource, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, communicationsGatewayName, testLineName, resource)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineInner resource,
+ Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, communicationsGatewayName, testLineName, resource, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TestLineInner createOrUpdate(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineInner resource) {
+ return createOrUpdateAsync(resourceGroupName, communicationsGatewayName, testLineName, resource).block();
+ }
+
+ /**
+ * Create a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TestLineInner createOrUpdate(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineInner resource,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, communicationsGatewayName, testLineName, resource, context)
+ .block();
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 communicationsGatewayName, String testLineName) {
+ 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (testLineName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter testLineName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ testLineName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @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 communicationsGatewayName, String testLineName, 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 (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (testLineName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter testLineName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ testLineName,
+ accept,
+ context);
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 communicationsGatewayName, String testLineName) {
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, communicationsGatewayName, testLineName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, communicationsGatewayName, testLineName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String communicationsGatewayName, String testLineName) {
+ return this.beginDeleteAsync(resourceGroupName, communicationsGatewayName, testLineName).getSyncPoller();
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, Context context) {
+ return this
+ .beginDeleteAsync(resourceGroupName, communicationsGatewayName, testLineName, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String communicationsGatewayName, String testLineName) {
+ return beginDeleteAsync(resourceGroupName, communicationsGatewayName, testLineName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, Context context) {
+ return beginDeleteAsync(resourceGroupName, communicationsGatewayName, testLineName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String communicationsGatewayName, String testLineName) {
+ deleteAsync(resourceGroupName, communicationsGatewayName, testLineName).block();
+ }
+
+ /**
+ * Delete a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, Context context) {
+ deleteAsync(resourceGroupName, communicationsGatewayName, testLineName, context).block();
+ }
+
+ /**
+ * Update a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineUpdate properties) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (testLineName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter testLineName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ testLineName,
+ properties,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineUpdate properties,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (communicationsGatewayName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter communicationsGatewayName is required and cannot be null."));
+ }
+ if (testLineName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter testLineName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ communicationsGatewayName,
+ testLineName,
+ properties,
+ accept,
+ context);
+ }
+
+ /**
+ * Update a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineUpdate properties) {
+ return updateWithResponseAsync(resourceGroupName, communicationsGatewayName, testLineName, properties)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Update a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param properties The resource properties to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(
+ String resourceGroupName,
+ String communicationsGatewayName,
+ String testLineName,
+ TestLineUpdate properties,
+ Context context) {
+ return updateWithResponseAsync(resourceGroupName, communicationsGatewayName, testLineName, properties, context)
+ .block();
+ }
+
+ /**
+ * Update a TestLine.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param communicationsGatewayName Unique identifier for this deployment.
+ * @param testLineName Unique identifier for this test line.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a TestLine resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TestLineInner update(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, TestLineUpdate properties) {
+ return updateWithResponse(resourceGroupName, communicationsGatewayName, testLineName, properties, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByCommunicationsGatewayNextSinglePageAsync(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.listByCommunicationsGatewayNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a TestLine list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByCommunicationsGatewayNextSinglePageAsync(
+ 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
+ .listByCommunicationsGatewayNext(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/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLinesImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLinesImpl.java
new file mode 100644
index 0000000000000..dba0c112048da
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/TestLinesImpl.java
@@ -0,0 +1,206 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.voiceservices.fluent.TestLinesClient;
+import com.azure.resourcemanager.voiceservices.fluent.models.TestLineInner;
+import com.azure.resourcemanager.voiceservices.models.TestLine;
+import com.azure.resourcemanager.voiceservices.models.TestLines;
+
+public final class TestLinesImpl implements TestLines {
+ private static final ClientLogger LOGGER = new ClientLogger(TestLinesImpl.class);
+
+ private final TestLinesClient innerClient;
+
+ private final com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager;
+
+ public TestLinesImpl(
+ TestLinesClient innerClient, com.azure.resourcemanager.voiceservices.VoiceservicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByCommunicationsGateway(
+ String resourceGroupName, String communicationsGatewayName) {
+ PagedIterable inner =
+ this.serviceClient().listByCommunicationsGateway(resourceGroupName, communicationsGatewayName);
+ return Utils.mapPage(inner, inner1 -> new TestLineImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByCommunicationsGateway(
+ String resourceGroupName, String communicationsGatewayName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByCommunicationsGateway(resourceGroupName, communicationsGatewayName, context);
+ return Utils.mapPage(inner, inner1 -> new TestLineImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, communicationsGatewayName, testLineName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new TestLineImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public TestLine get(String resourceGroupName, String communicationsGatewayName, String testLineName) {
+ TestLineInner inner = this.serviceClient().get(resourceGroupName, communicationsGatewayName, testLineName);
+ if (inner != null) {
+ return new TestLineImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void delete(String resourceGroupName, String communicationsGatewayName, String testLineName) {
+ this.serviceClient().delete(resourceGroupName, communicationsGatewayName, testLineName);
+ }
+
+ public void delete(
+ String resourceGroupName, String communicationsGatewayName, String testLineName, Context context) {
+ this.serviceClient().delete(resourceGroupName, communicationsGatewayName, testLineName, context);
+ }
+
+ public TestLine getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String communicationsGatewayName = Utils.getValueFromIdByName(id, "communicationsGateways");
+ if (communicationsGatewayName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'communicationsGateways'.",
+ id)));
+ }
+ String testLineName = Utils.getValueFromIdByName(id, "testLines");
+ if (testLineName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'testLines'.", id)));
+ }
+ return this
+ .getWithResponse(resourceGroupName, communicationsGatewayName, testLineName, Context.NONE)
+ .getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String communicationsGatewayName = Utils.getValueFromIdByName(id, "communicationsGateways");
+ if (communicationsGatewayName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'communicationsGateways'.",
+ id)));
+ }
+ String testLineName = Utils.getValueFromIdByName(id, "testLines");
+ if (testLineName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'testLines'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, communicationsGatewayName, testLineName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String communicationsGatewayName = Utils.getValueFromIdByName(id, "communicationsGateways");
+ if (communicationsGatewayName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'communicationsGateways'.",
+ id)));
+ }
+ String testLineName = Utils.getValueFromIdByName(id, "testLines");
+ if (testLineName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'testLines'.", id)));
+ }
+ this.delete(resourceGroupName, communicationsGatewayName, testLineName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String communicationsGatewayName = Utils.getValueFromIdByName(id, "communicationsGateways");
+ if (communicationsGatewayName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'communicationsGateways'.",
+ id)));
+ }
+ String testLineName = Utils.getValueFromIdByName(id, "testLines");
+ if (testLineName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'testLines'.", id)));
+ }
+ this.delete(resourceGroupName, communicationsGatewayName, testLineName, context);
+ }
+
+ private TestLinesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.voiceservices.VoiceservicesManager manager() {
+ return this.serviceManager;
+ }
+
+ public TestLineImpl define(String name) {
+ return new TestLineImpl(name, this.manager());
+ }
+}
diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/Utils.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/Utils.java
new file mode 100644
index 0000000000000..7e21383e04ff2
--- /dev/null
+++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/Utils.java
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.voiceservices.implementation;
+
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.util.CoreUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class Utils {
+ static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterator itr = Arrays.stream(id.split("/")).iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && !part.trim().isEmpty()) {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null) {
+ return null;
+ }
+ String parameterNameParentheses = "{" + parameterName + "}";
+ List idSegmentsReverted = Arrays.asList(id.split("/"));
+ List pathSegments = Arrays.asList(pathTemplate.split("/"));
+ Collections.reverse(idSegmentsReverted);
+ Iterator idItrReverted = idSegmentsReverted.iterator();
+ int pathIndex = pathSegments.size();
+ while (idItrReverted.hasNext() && pathIndex > 0) {
+ String idSegment = idItrReverted.next();
+ String pathSegment = pathSegments.get(--pathIndex);
+ if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) {
+ if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) {
+ if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) {
+ List segments = new ArrayList<>();
+ segments.add(idSegment);
+ idItrReverted.forEachRemaining(segments::add);
+ Collections.reverse(segments);
+ if (segments.size() > 0 && segments.get(0).isEmpty()) {
+ segments.remove(0);
+ }
+ return String.join("/", segments);
+ } else {
+ return idSegment;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse