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 Azureactivedirectory service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Azureactivedirectory service API instance.
+ */
+ public AzureactivedirectoryManager 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.azureactivedirectory")
+ .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 AzureactivedirectoryManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of PrivateLinkForAzureAds. It manages PrivateLinkPolicy.
+ *
+ * @return Resource collection API of PrivateLinkForAzureAds.
+ */
+ public PrivateLinkForAzureAds privateLinkForAzureAds() {
+ if (this.privateLinkForAzureAds == null) {
+ this.privateLinkForAzureAds =
+ new PrivateLinkForAzureAdsImpl(clientObject.getPrivateLinkForAzureAds(), this);
+ }
+ return privateLinkForAzureAds;
+ }
+
+ /**
+ * Gets the resource collection API of PrivateLinkResources.
+ *
+ * @return Resource collection API of PrivateLinkResources.
+ */
+ public PrivateLinkResources privateLinkResources() {
+ if (this.privateLinkResources == null) {
+ this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this);
+ }
+ return privateLinkResources;
+ }
+
+ /**
+ * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection.
+ *
+ * @return Resource collection API of PrivateEndpointConnections.
+ */
+ public PrivateEndpointConnections privateEndpointConnections() {
+ if (this.privateEndpointConnections == null) {
+ this.privateEndpointConnections =
+ new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this);
+ }
+ return privateEndpointConnections;
+ }
+
+ /**
+ * @return Wrapped service client Azureactivedirectory providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ */
+ public Azureactivedirectory serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/Azureactivedirectory.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/Azureactivedirectory.java
new file mode 100644
index 000000000000..8d60f341074d
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/Azureactivedirectory.java
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for Azureactivedirectory class. */
+public interface Azureactivedirectory {
+ /**
+ * Gets Azure subscription ID.
+ *
+ * @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 PrivateLinkForAzureAdsClient object to access its operations.
+ *
+ * @return the PrivateLinkForAzureAdsClient object.
+ */
+ PrivateLinkForAzureAdsClient getPrivateLinkForAzureAds();
+
+ /**
+ * Gets the PrivateLinkResourcesClient object to access its operations.
+ *
+ * @return the PrivateLinkResourcesClient object.
+ */
+ PrivateLinkResourcesClient getPrivateLinkResources();
+
+ /**
+ * Gets the PrivateEndpointConnectionsClient object to access its operations.
+ *
+ * @return the PrivateEndpointConnectionsClient object.
+ */
+ PrivateEndpointConnectionsClient getPrivateEndpointConnections();
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateEndpointConnectionsClient.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateEndpointConnectionsClient.java
new file mode 100644
index 000000000000..f0df3ecae8ac
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateEndpointConnectionsClient.java
@@ -0,0 +1,214 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.models.PrivateEndpointConnectionInner;
+
+/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */
+public interface PrivateEndpointConnectionsClient {
+ /**
+ * Lists all Private Endpoint Connections for the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByPolicyName(String resourceGroupName, String policyName);
+
+ /**
+ * Lists all Private Endpoint Connections for the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByPolicyName(
+ String resourceGroupName, String policyName, Context context);
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, PrivateEndpointConnectionInner> beginCreate(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters);
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, PrivateEndpointConnectionInner> beginCreate(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters,
+ Context context);
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionInner create(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters);
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionInner create(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters,
+ Context context);
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName);
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName, Context context);
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName);
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName, Context context);
+
+ /**
+ * Gets the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 specified private endpoint connection associated with the given policy.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionInner get(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName);
+
+ /**
+ * Gets the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 specified private endpoint connection associated with the given policy along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName, Context context);
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateLinkForAzureAdsClient.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateLinkForAzureAdsClient.java
new file mode 100644
index 000000000000..3d24532e0ccf
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateLinkForAzureAdsClient.java
@@ -0,0 +1,213 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.models.PrivateLinkPolicyInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkPolicyUpdateParameter;
+
+/** An instance of this class provides access to all the operations defined in PrivateLinkForAzureAdsClient. */
+public interface PrivateLinkForAzureAdsClient {
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the 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 privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, PrivateLinkPolicyInner> beginCreate(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy);
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, PrivateLinkPolicyInner> beginCreate(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy, Context context);
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the 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 privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateLinkPolicyInner create(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy);
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateLinkPolicyInner create(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy, Context context);
+
+ /**
+ * Updates private link policy tags with specified values.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateLinkPolicyInner update(String resourceGroupName, String policyName);
+
+ /**
+ * Updates private link policy tags with specified values.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy Private Link Policy resource with the tags 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 privateLink Policy configuration object along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName,
+ String policyName,
+ PrivateLinkPolicyUpdateParameter privateLinkPolicy,
+ Context context);
+
+ /**
+ * Gets a private link policy with a given name.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link policy with a given name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateLinkPolicyInner getByResourceGroup(String resourceGroupName, String policyName);
+
+ /**
+ * Gets a private link policy with a given name.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link policy with a given name along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String policyName, Context context);
+
+ /**
+ * Deletes a private link policy. When operation completes, status code 200 returned without content.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 policyName);
+
+ /**
+ * Deletes a private link policy. When operation completes, status code 200 returned without content.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String policyName, Context context);
+
+ /**
+ * Lists all Private Link Policies For AzureAD in the given subscription.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all Private Link Policies For AzureAD in the given subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateLinkResourcesClient.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateLinkResourcesClient.java
new file mode 100644
index 000000000000..e138416a43e4
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/PrivateLinkResourcesClient.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateLinkResourceInner;
+
+/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */
+public interface PrivateLinkResourcesClient {
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources that need to be created for a policy of AzureAD as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByPrivateLinkPolicy(String resourceGroupName, String policyName);
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources that need to be created for a policy of AzureAD as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByPrivateLinkPolicy(
+ String resourceGroupName, String policyName, Context context);
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param groupName The name of the private link resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources that need to be created for a policy of AzureAD.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateLinkResourceInner get(String resourceGroupName, String policyName, String groupName);
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param groupName The name of the private link resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources that need to be created for a policy of AzureAD along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String policyName, String groupName, Context context);
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateEndpointConnectionInner.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateEndpointConnectionInner.java
new file mode 100644
index 000000000000..8e0fc14b4567
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateEndpointConnectionInner.java
@@ -0,0 +1,124 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpoint;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpointConnectionProvisioningState;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkServiceConnectionState;
+import com.azure.resourcemanager.azureactivedirectory.models.TagsResource;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Private endpoint connection resource. */
+@Fluent
+public final class PrivateEndpointConnectionInner extends ProxyResource {
+ /*
+ * Resource properties.
+ */
+ @JsonProperty(value = "properties")
+ private PrivateEndpointConnectionProperties innerProperties;
+
+ /**
+ * Get the innerProperties property: Resource properties.
+ *
+ * @return the innerProperties value.
+ */
+ private PrivateEndpointConnectionProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the privateEndpoint property: Properties of the private endpoint object.
+ *
+ * @return the privateEndpoint value.
+ */
+ public PrivateEndpoint privateEndpoint() {
+ return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint();
+ }
+
+ /**
+ * Set the privateEndpoint property: Properties of the private endpoint object.
+ *
+ * @param privateEndpoint the privateEndpoint value to set.
+ * @return the PrivateEndpointConnectionInner object itself.
+ */
+ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PrivateEndpointConnectionProperties();
+ }
+ this.innerProperties().withPrivateEndpoint(privateEndpoint);
+ return this;
+ }
+
+ /**
+ * Get the privateLinkServiceConnectionState property: Approval state of the private link connection.
+ *
+ * @return the privateLinkServiceConnectionState value.
+ */
+ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() {
+ return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState();
+ }
+
+ /**
+ * Set the privateLinkServiceConnectionState property: Approval state of the private link connection.
+ *
+ * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set.
+ * @return the PrivateEndpointConnectionInner object itself.
+ */
+ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(
+ PrivateLinkServiceConnectionState privateLinkServiceConnectionState) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PrivateEndpointConnectionProperties();
+ }
+ this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: Provisioning state of the private endpoint connection.
+ *
+ * @return the provisioningState value.
+ */
+ public PrivateEndpointConnectionProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the privateLinkConnectionTags property: Updated tag information to set into the PrivateLinkConnection
+ * instance.
+ *
+ * @return the privateLinkConnectionTags value.
+ */
+ public TagsResource privateLinkConnectionTags() {
+ return this.innerProperties() == null ? null : this.innerProperties().privateLinkConnectionTags();
+ }
+
+ /**
+ * Set the privateLinkConnectionTags property: Updated tag information to set into the PrivateLinkConnection
+ * instance.
+ *
+ * @param privateLinkConnectionTags the privateLinkConnectionTags value to set.
+ * @return the PrivateEndpointConnectionInner object itself.
+ */
+ public PrivateEndpointConnectionInner withPrivateLinkConnectionTags(TagsResource privateLinkConnectionTags) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new PrivateEndpointConnectionProperties();
+ }
+ this.innerProperties().withPrivateLinkConnectionTags(privateLinkConnectionTags);
+ 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/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateEndpointConnectionProperties.java
new file mode 100644
index 000000000000..e0f8628501bd
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateEndpointConnectionProperties.java
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpoint;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpointConnectionProvisioningState;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkServiceConnectionState;
+import com.azure.resourcemanager.azureactivedirectory.models.TagsResource;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Properties of the private endpoint connection resource. */
+@Fluent
+public final class PrivateEndpointConnectionProperties {
+ /*
+ * Properties of the private endpoint object.
+ */
+ @JsonProperty(value = "privateEndpoint")
+ private PrivateEndpoint privateEndpoint;
+
+ /*
+ * Approval state of the private link connection.
+ */
+ @JsonProperty(value = "privateLinkServiceConnectionState")
+ private PrivateLinkServiceConnectionState privateLinkServiceConnectionState;
+
+ /*
+ * Provisioning state of the private endpoint connection.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private PrivateEndpointConnectionProvisioningState provisioningState;
+
+ /*
+ * Updated tag information to set into the PrivateLinkConnection instance.
+ */
+ @JsonProperty(value = "privateLinkConnectionTags")
+ private TagsResource privateLinkConnectionTags;
+
+ /**
+ * Get the privateEndpoint property: Properties of the private endpoint object.
+ *
+ * @return the privateEndpoint value.
+ */
+ public PrivateEndpoint privateEndpoint() {
+ return this.privateEndpoint;
+ }
+
+ /**
+ * Set the privateEndpoint property: Properties of the private endpoint object.
+ *
+ * @param privateEndpoint the privateEndpoint value to set.
+ * @return the PrivateEndpointConnectionProperties object itself.
+ */
+ public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) {
+ this.privateEndpoint = privateEndpoint;
+ return this;
+ }
+
+ /**
+ * Get the privateLinkServiceConnectionState property: Approval state of the private link connection.
+ *
+ * @return the privateLinkServiceConnectionState value.
+ */
+ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() {
+ return this.privateLinkServiceConnectionState;
+ }
+
+ /**
+ * Set the privateLinkServiceConnectionState property: Approval state of the private link connection.
+ *
+ * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set.
+ * @return the PrivateEndpointConnectionProperties object itself.
+ */
+ public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState(
+ PrivateLinkServiceConnectionState privateLinkServiceConnectionState) {
+ this.privateLinkServiceConnectionState = privateLinkServiceConnectionState;
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: Provisioning state of the private endpoint connection.
+ *
+ * @return the provisioningState value.
+ */
+ public PrivateEndpointConnectionProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the privateLinkConnectionTags property: Updated tag information to set into the PrivateLinkConnection
+ * instance.
+ *
+ * @return the privateLinkConnectionTags value.
+ */
+ public TagsResource privateLinkConnectionTags() {
+ return this.privateLinkConnectionTags;
+ }
+
+ /**
+ * Set the privateLinkConnectionTags property: Updated tag information to set into the PrivateLinkConnection
+ * instance.
+ *
+ * @param privateLinkConnectionTags the privateLinkConnectionTags value to set.
+ * @return the PrivateEndpointConnectionProperties object itself.
+ */
+ public PrivateEndpointConnectionProperties withPrivateLinkConnectionTags(TagsResource privateLinkConnectionTags) {
+ this.privateLinkConnectionTags = privateLinkConnectionTags;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (privateEndpoint() != null) {
+ privateEndpoint().validate();
+ }
+ if (privateLinkServiceConnectionState() != null) {
+ privateLinkServiceConnectionState().validate();
+ }
+ if (privateLinkConnectionTags() != null) {
+ privateLinkConnectionTags().validate();
+ }
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkPolicyInner.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkPolicyInner.java
new file mode 100644
index 000000000000..ae8e6426f0fa
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkPolicyInner.java
@@ -0,0 +1,216 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.azureactivedirectory.models.AzureResourceBase;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/** PrivateLink Policy configuration object. */
+@Fluent
+public final class PrivateLinkPolicyInner extends AzureResourceBase {
+ /*
+ * Guid of the owner tenant
+ */
+ @JsonProperty(value = "ownerTenantId")
+ private String ownerTenantId;
+
+ /*
+ * Flag indicating whether all tenants are allowed
+ */
+ @JsonProperty(value = "allTenants")
+ private Boolean allTenants;
+
+ /*
+ * The list of tenantIds.
+ */
+ @JsonProperty(value = "tenants")
+ private List tenants;
+
+ /*
+ * Name of the private link policy resource
+ */
+ @JsonProperty(value = "resourceName")
+ private String resourceName;
+
+ /*
+ * Subscription Identifier
+ */
+ @JsonProperty(value = "subscriptionId")
+ private String subscriptionId;
+
+ /*
+ * Name of the resource group
+ */
+ @JsonProperty(value = "resourceGroup")
+ private String resourceGroup;
+
+ /*
+ * Resource tags.
+ */
+ @JsonProperty(value = "tags")
+ @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
+ private Map tags;
+
+ /**
+ * Get the ownerTenantId property: Guid of the owner tenant.
+ *
+ * @return the ownerTenantId value.
+ */
+ public String ownerTenantId() {
+ return this.ownerTenantId;
+ }
+
+ /**
+ * Set the ownerTenantId property: Guid of the owner tenant.
+ *
+ * @param ownerTenantId the ownerTenantId value to set.
+ * @return the PrivateLinkPolicyInner object itself.
+ */
+ public PrivateLinkPolicyInner withOwnerTenantId(String ownerTenantId) {
+ this.ownerTenantId = ownerTenantId;
+ return this;
+ }
+
+ /**
+ * Get the allTenants property: Flag indicating whether all tenants are allowed.
+ *
+ * @return the allTenants value.
+ */
+ public Boolean allTenants() {
+ return this.allTenants;
+ }
+
+ /**
+ * Set the allTenants property: Flag indicating whether all tenants are allowed.
+ *
+ * @param allTenants the allTenants value to set.
+ * @return the PrivateLinkPolicyInner object itself.
+ */
+ public PrivateLinkPolicyInner withAllTenants(Boolean allTenants) {
+ this.allTenants = allTenants;
+ return this;
+ }
+
+ /**
+ * Get the tenants property: The list of tenantIds.
+ *
+ * @return the tenants value.
+ */
+ public List tenants() {
+ return this.tenants;
+ }
+
+ /**
+ * Set the tenants property: The list of tenantIds.
+ *
+ * @param tenants the tenants value to set.
+ * @return the PrivateLinkPolicyInner object itself.
+ */
+ public PrivateLinkPolicyInner withTenants(List tenants) {
+ this.tenants = tenants;
+ return this;
+ }
+
+ /**
+ * Get the resourceName property: Name of the private link policy resource.
+ *
+ * @return the resourceName value.
+ */
+ public String resourceName() {
+ return this.resourceName;
+ }
+
+ /**
+ * Set the resourceName property: Name of the private link policy resource.
+ *
+ * @param resourceName the resourceName value to set.
+ * @return the PrivateLinkPolicyInner object itself.
+ */
+ public PrivateLinkPolicyInner withResourceName(String resourceName) {
+ this.resourceName = resourceName;
+ return this;
+ }
+
+ /**
+ * Get the subscriptionId property: Subscription Identifier.
+ *
+ * @return the subscriptionId value.
+ */
+ public String subscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * Set the subscriptionId property: Subscription Identifier.
+ *
+ * @param subscriptionId the subscriptionId value to set.
+ * @return the PrivateLinkPolicyInner object itself.
+ */
+ public PrivateLinkPolicyInner withSubscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /**
+ * Get the resourceGroup property: Name of the resource group.
+ *
+ * @return the resourceGroup value.
+ */
+ public String resourceGroup() {
+ return this.resourceGroup;
+ }
+
+ /**
+ * Set the resourceGroup property: Name of the resource group.
+ *
+ * @param resourceGroup the resourceGroup value to set.
+ * @return the PrivateLinkPolicyInner object itself.
+ */
+ public PrivateLinkPolicyInner withResourceGroup(String resourceGroup) {
+ this.resourceGroup = resourceGroup;
+ return this;
+ }
+
+ /**
+ * Get the tags property: Resource tags.
+ *
+ * @return the tags value.
+ */
+ public Map tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags property: Resource tags.
+ *
+ * @param tags the tags value to set.
+ * @return the PrivateLinkPolicyInner object itself.
+ */
+ public PrivateLinkPolicyInner withTags(Map tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public PrivateLinkPolicyInner withName(String name) {
+ super.withName(name);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkResourceInner.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkResourceInner.java
new file mode 100644
index 000000000000..eb2c1239378d
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkResourceInner.java
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.azureactivedirectory.models.ArmProxyResource;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** A private link resource. */
+@Fluent
+public final class PrivateLinkResourceInner extends ArmProxyResource {
+ /*
+ * Resource properties.
+ */
+ @JsonProperty(value = "properties")
+ private PrivateLinkResourceProperties innerProperties;
+
+ /**
+ * Get the innerProperties property: Resource properties.
+ *
+ * @return the innerProperties value.
+ */
+ private PrivateLinkResourceProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the groupId property: The private link resource group id.
+ *
+ * @return the groupId value.
+ */
+ public String groupId() {
+ return this.innerProperties() == null ? null : this.innerProperties().groupId();
+ }
+
+ /**
+ * Get the requiredMembers property: The private link resource required member names.
+ *
+ * @return the requiredMembers value.
+ */
+ public List requiredMembers() {
+ return this.innerProperties() == null ? null : this.innerProperties().requiredMembers();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkResourceProperties.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkResourceProperties.java
new file mode 100644
index 000000000000..adab165dd8bc
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/PrivateLinkResourceProperties.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.azureactivedirectory.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Properties of a private link resource. */
+@Immutable
+public final class PrivateLinkResourceProperties {
+ /*
+ * The private link resource group id.
+ */
+ @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY)
+ private String groupId;
+
+ /*
+ * The private link resource required member names.
+ */
+ @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY)
+ private List requiredMembers;
+
+ /**
+ * Get the groupId property: The private link resource group id.
+ *
+ * @return the groupId value.
+ */
+ public String groupId() {
+ return this.groupId;
+ }
+
+ /**
+ * Get the requiredMembers property: The private link resource required member names.
+ *
+ * @return the requiredMembers value.
+ */
+ public List requiredMembers() {
+ return this.requiredMembers;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/package-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/package-info.java
new file mode 100644
index 000000000000..fd4febc57518
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/models/package-info.java
@@ -0,0 +1,8 @@
+// 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 Azureactivedirectory. Private link Policy for Azure Active Directory.
+ */
+package com.azure.resourcemanager.azureactivedirectory.fluent.models;
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/package-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/fluent/package-info.java
new file mode 100644
index 000000000000..c7e3db11b1d0
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/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 Azureactivedirectory. Private link Policy for Azure Active Directory. */
+package com.azure.resourcemanager.azureactivedirectory.fluent;
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryBuilder.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryBuilder.java
new file mode 100644
index 000000000000..f4e6c6042203
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryBuilder.java
@@ -0,0 +1,142 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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 AzureactivedirectoryImpl type. */
+@ServiceClientBuilder(serviceClients = {AzureactivedirectoryImpl.class})
+public final class AzureactivedirectoryBuilder {
+ /*
+ * Azure subscription ID.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets Azure subscription ID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the AzureactivedirectoryBuilder.
+ */
+ public AzureactivedirectoryBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the AzureactivedirectoryBuilder.
+ */
+ public AzureactivedirectoryBuilder 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 AzureactivedirectoryBuilder.
+ */
+ public AzureactivedirectoryBuilder 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 AzureactivedirectoryBuilder.
+ */
+ public AzureactivedirectoryBuilder 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 AzureactivedirectoryBuilder.
+ */
+ public AzureactivedirectoryBuilder 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 AzureactivedirectoryBuilder.
+ */
+ public AzureactivedirectoryBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of AzureactivedirectoryImpl with the provided parameters.
+ *
+ * @return an instance of AzureactivedirectoryImpl.
+ */
+ public AzureactivedirectoryImpl buildClient() {
+ if (endpoint == null) {
+ this.endpoint = "https://management.azure.com";
+ }
+ if (environment == null) {
+ this.environment = AzureEnvironment.AZURE;
+ }
+ if (pipeline == null) {
+ this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ }
+ if (defaultPollInterval == null) {
+ this.defaultPollInterval = Duration.ofSeconds(30);
+ }
+ if (serializerAdapter == null) {
+ this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
+ }
+ AzureactivedirectoryImpl client =
+ new AzureactivedirectoryImpl(
+ pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
+ return client;
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryImpl.java
new file mode 100644
index 000000000000..4c785d986728
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/AzureactivedirectoryImpl.java
@@ -0,0 +1,318 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.Azureactivedirectory;
+import com.azure.resourcemanager.azureactivedirectory.fluent.PrivateEndpointConnectionsClient;
+import com.azure.resourcemanager.azureactivedirectory.fluent.PrivateLinkForAzureAdsClient;
+import com.azure.resourcemanager.azureactivedirectory.fluent.PrivateLinkResourcesClient;
+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 AzureactivedirectoryImpl type. */
+@ServiceClient(builder = AzureactivedirectoryBuilder.class)
+public final class AzureactivedirectoryImpl implements Azureactivedirectory {
+ /** Azure subscription ID. */
+ private final String subscriptionId;
+
+ /**
+ * Gets Azure subscription ID.
+ *
+ * @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 PrivateLinkForAzureAdsClient object to access its operations. */
+ private final PrivateLinkForAzureAdsClient privateLinkForAzureAds;
+
+ /**
+ * Gets the PrivateLinkForAzureAdsClient object to access its operations.
+ *
+ * @return the PrivateLinkForAzureAdsClient object.
+ */
+ public PrivateLinkForAzureAdsClient getPrivateLinkForAzureAds() {
+ return this.privateLinkForAzureAds;
+ }
+
+ /** The PrivateLinkResourcesClient object to access its operations. */
+ private final PrivateLinkResourcesClient privateLinkResources;
+
+ /**
+ * Gets the PrivateLinkResourcesClient object to access its operations.
+ *
+ * @return the PrivateLinkResourcesClient object.
+ */
+ public PrivateLinkResourcesClient getPrivateLinkResources() {
+ return this.privateLinkResources;
+ }
+
+ /** The PrivateEndpointConnectionsClient object to access its operations. */
+ private final PrivateEndpointConnectionsClient privateEndpointConnections;
+
+ /**
+ * Gets the PrivateEndpointConnectionsClient object to access its operations.
+ *
+ * @return the PrivateEndpointConnectionsClient object.
+ */
+ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() {
+ return this.privateEndpointConnections;
+ }
+
+ /**
+ * Initializes an instance of Azureactivedirectory 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 Azure subscription ID.
+ * @param endpoint server parameter.
+ */
+ AzureactivedirectoryImpl(
+ 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 = "2020-03-01";
+ this.privateLinkForAzureAds = new PrivateLinkForAzureAdsClientImpl(this);
+ this.privateLinkResources = new PrivateLinkResourcesClientImpl(this);
+ this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(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(AzureactivedirectoryImpl.class);
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionImpl.java
new file mode 100644
index 000000000000..36d8a3e70925
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionImpl.java
@@ -0,0 +1,132 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpoint;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpointConnection;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpointConnectionProvisioningState;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkServiceConnectionState;
+import com.azure.resourcemanager.azureactivedirectory.models.TagsResource;
+
+public final class PrivateEndpointConnectionImpl
+ implements PrivateEndpointConnection, PrivateEndpointConnection.Definition {
+ private PrivateEndpointConnectionInner innerObject;
+
+ private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager;
+
+ PrivateEndpointConnectionImpl(
+ PrivateEndpointConnectionInner innerObject,
+ com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public PrivateEndpoint privateEndpoint() {
+ return this.innerModel().privateEndpoint();
+ }
+
+ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() {
+ return this.innerModel().privateLinkServiceConnectionState();
+ }
+
+ public PrivateEndpointConnectionProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public TagsResource privateLinkConnectionTags() {
+ return this.innerModel().privateLinkConnectionTags();
+ }
+
+ public PrivateEndpointConnectionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String policyName;
+
+ private String privateEndpointConnectionName;
+
+ public PrivateEndpointConnectionImpl withExistingPrivateLinkForAzureAd(
+ String resourceGroupName, String policyName) {
+ this.resourceGroupName = resourceGroupName;
+ this.policyName = policyName;
+ return this;
+ }
+
+ public PrivateEndpointConnection create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .create(resourceGroupName, policyName, privateEndpointConnectionName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public PrivateEndpointConnection create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .create(resourceGroupName, policyName, privateEndpointConnectionName, this.innerModel(), context);
+ return this;
+ }
+
+ PrivateEndpointConnectionImpl(
+ String name, com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) {
+ this.innerObject = new PrivateEndpointConnectionInner();
+ this.serviceManager = serviceManager;
+ this.privateEndpointConnectionName = name;
+ }
+
+ public PrivateEndpointConnection refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .getWithResponse(resourceGroupName, policyName, privateEndpointConnectionName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public PrivateEndpointConnection refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateEndpointConnections()
+ .getWithResponse(resourceGroupName, policyName, privateEndpointConnectionName, context)
+ .getValue();
+ return this;
+ }
+
+ public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) {
+ this.innerModel().withPrivateEndpoint(privateEndpoint);
+ return this;
+ }
+
+ public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(
+ PrivateLinkServiceConnectionState privateLinkServiceConnectionState) {
+ this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState);
+ return this;
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionsClientImpl.java
new file mode 100644
index 000000000000..824671648867
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionsClientImpl.java
@@ -0,0 +1,1160 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.azureactivedirectory.fluent.PrivateEndpointConnectionsClient;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpointConnectionListResult;
+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 PrivateEndpointConnectionsClient. */
+public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient {
+ /** The proxy service used to perform REST calls. */
+ private final PrivateEndpointConnectionsService service;
+
+ /** The service client containing this operation class. */
+ private final AzureactivedirectoryImpl client;
+
+ /**
+ * Initializes an instance of PrivateEndpointConnectionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ PrivateEndpointConnectionsClientImpl(AzureactivedirectoryImpl client) {
+ this.service =
+ RestProxy
+ .create(
+ PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureactivedirectoryPrivateEndpointConnections to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "Azureactivedirectory")
+ private interface PrivateEndpointConnectionsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}/privateEndpointConnections")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByPolicyName(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}/privateEndpointConnections/{privateEndpointConnectionName}")
+ @ExpectedResponses({201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> create(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
+ @BodyParam("application/json") PrivateEndpointConnectionInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}/privateEndpointConnections/{privateEndpointConnectionName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
+ @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.aadiam"
+ + "/privateLinkForAzureAd/{policyName}/privateEndpointConnections/{privateEndpointConnectionName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByPolicyNameNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Lists all Private Endpoint Connections for the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByPolicyNameSinglePageAsync(
+ String resourceGroupName, String policyName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName 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
+ .listByPolicyName(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ policyName,
+ 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()));
+ }
+
+ /**
+ * Lists all Private Endpoint Connections for the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByPolicyNameSinglePageAsync(
+ String resourceGroupName, String policyName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName 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
+ .listByPolicyName(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ policyName,
+ 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));
+ }
+
+ /**
+ * Lists all Private Endpoint Connections for the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByPolicyNameAsync(
+ String resourceGroupName, String policyName) {
+ return new PagedFlux<>(
+ () -> listByPolicyNameSinglePageAsync(resourceGroupName, policyName),
+ nextLink -> listByPolicyNameNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all Private Endpoint Connections for the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByPolicyNameAsync(
+ String resourceGroupName, String policyName, Context context) {
+ return new PagedFlux<>(
+ () -> listByPolicyNameSinglePageAsync(resourceGroupName, policyName, context),
+ nextLink -> listByPolicyNameNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all Private Endpoint Connections for the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByPolicyName(String resourceGroupName, String policyName) {
+ return new PagedIterable<>(listByPolicyNameAsync(resourceGroupName, policyName));
+ }
+
+ /**
+ * Lists all Private Endpoint Connections for the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByPolicyName(
+ String resourceGroupName, String policyName, Context context) {
+ return new PagedIterable<>(listByPolicyNameAsync(resourceGroupName, policyName, context));
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return private endpoint connection resource along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateEndpointConnectionName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter privateEndpointConnectionName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .create(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ privateEndpointConnectionName,
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateEndpointConnectionName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter privateEndpointConnectionName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .create(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ privateEndpointConnectionName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters) {
+ Mono>> mono =
+ createWithResponseAsync(resourceGroupName, policyName, privateEndpointConnectionName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ PrivateEndpointConnectionInner.class,
+ PrivateEndpointConnectionInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createWithResponseAsync(resourceGroupName, policyName, privateEndpointConnectionName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ PrivateEndpointConnectionInner.class,
+ PrivateEndpointConnectionInner.class,
+ context);
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, PrivateEndpointConnectionInner> beginCreate(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters) {
+ return beginCreateAsync(resourceGroupName, policyName, privateEndpointConnectionName, parameters)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, PrivateEndpointConnectionInner> beginCreate(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters,
+ Context context) {
+ return beginCreateAsync(resourceGroupName, policyName, privateEndpointConnectionName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return private endpoint connection resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters) {
+ return beginCreateAsync(resourceGroupName, policyName, privateEndpointConnectionName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters,
+ Context context) {
+ return beginCreateAsync(resourceGroupName, policyName, privateEndpointConnectionName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateEndpointConnectionInner create(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters) {
+ return createAsync(resourceGroupName, policyName, privateEndpointConnectionName, parameters).block();
+ }
+
+ /**
+ * Creates specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @param parameters The intended state of private endpoint connection.
+ * @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 private endpoint connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateEndpointConnectionInner create(
+ String resourceGroupName,
+ String policyName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnectionInner parameters,
+ Context context) {
+ return createAsync(resourceGroupName, policyName, privateEndpointConnectionName, parameters, context).block();
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 policyName, String privateEndpointConnectionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateEndpointConnectionName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter privateEndpointConnectionName 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
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ policyName,
+ privateEndpointConnectionName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateEndpointConnectionName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter privateEndpointConnectionName 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
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ policyName,
+ privateEndpointConnectionName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 policyName, String privateEndpointConnectionName) {
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, policyName, privateEndpointConnectionName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, policyName, privateEndpointConnectionName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 policyName, String privateEndpointConnectionName) {
+ return beginDeleteAsync(resourceGroupName, policyName, privateEndpointConnectionName).getSyncPoller();
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName, Context context) {
+ return beginDeleteAsync(resourceGroupName, policyName, privateEndpointConnectionName, context).getSyncPoller();
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 policyName, String privateEndpointConnectionName) {
+ return beginDeleteAsync(resourceGroupName, policyName, privateEndpointConnectionName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName, Context context) {
+ return beginDeleteAsync(resourceGroupName, policyName, privateEndpointConnectionName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 policyName, String privateEndpointConnectionName) {
+ deleteAsync(resourceGroupName, policyName, privateEndpointConnectionName).block();
+ }
+
+ /**
+ * Deletes the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 policyName, String privateEndpointConnectionName, Context context) {
+ deleteAsync(resourceGroupName, policyName, privateEndpointConnectionName, context).block();
+ }
+
+ /**
+ * Gets the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 specified private endpoint connection associated with the given policy along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateEndpointConnectionName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter privateEndpointConnectionName 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
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ policyName,
+ privateEndpointConnectionName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 specified private endpoint connection associated with the given policy along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateEndpointConnectionName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter privateEndpointConnectionName 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
+ .get(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ policyName,
+ privateEndpointConnectionName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context);
+ }
+
+ /**
+ * Gets the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 specified private endpoint connection associated with the given policy on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName) {
+ return getWithResponseAsync(resourceGroupName, policyName, privateEndpointConnectionName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 specified private endpoint connection associated with the given policy.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateEndpointConnectionInner get(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName) {
+ return getAsync(resourceGroupName, policyName, privateEndpointConnectionName).block();
+ }
+
+ /**
+ * Gets the specified private endpoint connection associated with the given policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateEndpointConnectionName The PrivateEndpointConnection name.
+ * @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 specified private endpoint connection associated with the given policy along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName, Context context) {
+ return getWithResponseAsync(resourceGroupName, policyName, privateEndpointConnectionName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByPolicyNameNextSinglePageAsync(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.listByPolicyNameNext(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 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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByPolicyNameNextSinglePageAsync(
+ 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
+ .listByPolicyNameNext(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/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionsImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionsImpl.java
new file mode 100644
index 000000000000..523882cbc314
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateEndpointConnectionsImpl.java
@@ -0,0 +1,220 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.PrivateEndpointConnectionsClient;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateEndpointConnectionInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpointConnection;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateEndpointConnections;
+
+public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections {
+ private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class);
+
+ private final PrivateEndpointConnectionsClient innerClient;
+
+ private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager;
+
+ public PrivateEndpointConnectionsImpl(
+ PrivateEndpointConnectionsClient innerClient,
+ com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByPolicyName(String resourceGroupName, String policyName) {
+ PagedIterable inner =
+ this.serviceClient().listByPolicyName(resourceGroupName, policyName);
+ return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByPolicyName(
+ String resourceGroupName, String policyName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByPolicyName(resourceGroupName, policyName, context);
+ return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager()));
+ }
+
+ public void delete(String resourceGroupName, String policyName, String privateEndpointConnectionName) {
+ this.serviceClient().delete(resourceGroupName, policyName, privateEndpointConnectionName);
+ }
+
+ public void delete(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName, Context context) {
+ this.serviceClient().delete(resourceGroupName, policyName, privateEndpointConnectionName, context);
+ }
+
+ public PrivateEndpointConnection get(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName) {
+ PrivateEndpointConnectionInner inner =
+ this.serviceClient().get(resourceGroupName, policyName, privateEndpointConnectionName);
+ if (inner != null) {
+ return new PrivateEndpointConnectionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String policyName, String privateEndpointConnectionName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, policyName, privateEndpointConnectionName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new PrivateEndpointConnectionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public PrivateEndpointConnection 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 policyName = Utils.getValueFromIdByName(id, "privateLinkForAzureAd");
+ if (policyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateLinkForAzureAd'.",
+ id)));
+ }
+ String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections");
+ if (privateEndpointConnectionName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.",
+ id)));
+ }
+ return this
+ .getWithResponse(resourceGroupName, policyName, privateEndpointConnectionName, 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 policyName = Utils.getValueFromIdByName(id, "privateLinkForAzureAd");
+ if (policyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateLinkForAzureAd'.",
+ id)));
+ }
+ String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections");
+ if (privateEndpointConnectionName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.",
+ id)));
+ }
+ return this.getWithResponse(resourceGroupName, policyName, privateEndpointConnectionName, 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 policyName = Utils.getValueFromIdByName(id, "privateLinkForAzureAd");
+ if (policyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateLinkForAzureAd'.",
+ id)));
+ }
+ String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections");
+ if (privateEndpointConnectionName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.",
+ id)));
+ }
+ this.delete(resourceGroupName, policyName, privateEndpointConnectionName, 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 policyName = Utils.getValueFromIdByName(id, "privateLinkForAzureAd");
+ if (policyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateLinkForAzureAd'.",
+ id)));
+ }
+ String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections");
+ if (privateEndpointConnectionName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.",
+ id)));
+ }
+ this.delete(resourceGroupName, policyName, privateEndpointConnectionName, context);
+ }
+
+ private PrivateEndpointConnectionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() {
+ return this.serviceManager;
+ }
+
+ public PrivateEndpointConnectionImpl define(String name) {
+ return new PrivateEndpointConnectionImpl(name, this.manager());
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkForAzureAdsClientImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkForAzureAdsClientImpl.java
new file mode 100644
index 000000000000..723487cff053
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkForAzureAdsClientImpl.java
@@ -0,0 +1,1369 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.PrivateLinkForAzureAdsClient;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateLinkPolicyInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkPolicyListResult;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkPolicyUpdateParameter;
+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 PrivateLinkForAzureAdsClient. */
+public final class PrivateLinkForAzureAdsClientImpl implements PrivateLinkForAzureAdsClient {
+ /** The proxy service used to perform REST calls. */
+ private final PrivateLinkForAzureAdsService service;
+
+ /** The service client containing this operation class. */
+ private final AzureactivedirectoryImpl client;
+
+ /**
+ * Initializes an instance of PrivateLinkForAzureAdsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ PrivateLinkForAzureAdsClientImpl(AzureactivedirectoryImpl client) {
+ this.service =
+ RestProxy
+ .create(PrivateLinkForAzureAdsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureactivedirectoryPrivateLinkForAzureAds to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "Azureactivedirectory")
+ private interface PrivateLinkForAzureAdsService {
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> create(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") PrivateLinkPolicyInner privateLinkPolicy,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") PrivateLinkPolicyUpdateParameter privateLinkPolicy,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/microsoft.aadiam/privateLinkForAzureAd")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> 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> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the 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 privateLink Policy configuration object along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy) {
+ 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateLinkPolicy == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter privateLinkPolicy is required and cannot be null."));
+ } else {
+ privateLinkPolicy.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .create(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ privateLinkPolicy,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return privateLink Policy configuration object along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy, 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateLinkPolicy == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter privateLinkPolicy is required and cannot be null."));
+ } else {
+ privateLinkPolicy.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .create(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ privateLinkPolicy,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the 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 privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, PrivateLinkPolicyInner> beginCreateAsync(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy) {
+ Mono>> mono =
+ createWithResponseAsync(resourceGroupName, policyName, privateLinkPolicy);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ PrivateLinkPolicyInner.class,
+ PrivateLinkPolicyInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, PrivateLinkPolicyInner> beginCreateAsync(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createWithResponseAsync(resourceGroupName, policyName, privateLinkPolicy, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ PrivateLinkPolicyInner.class,
+ PrivateLinkPolicyInner.class,
+ context);
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the 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 privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, PrivateLinkPolicyInner> beginCreate(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy) {
+ return beginCreateAsync(resourceGroupName, policyName, privateLinkPolicy).getSyncPoller();
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, PrivateLinkPolicyInner> beginCreate(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy, Context context) {
+ return beginCreateAsync(resourceGroupName, policyName, privateLinkPolicy, context).getSyncPoller();
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the 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 privateLink Policy configuration object on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy) {
+ return beginCreateAsync(resourceGroupName, policyName, privateLinkPolicy)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return privateLink Policy configuration object on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy, Context context) {
+ return beginCreateAsync(resourceGroupName, policyName, privateLinkPolicy, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the 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 privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateLinkPolicyInner create(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy) {
+ return createAsync(resourceGroupName, policyName, privateLinkPolicy).block();
+ }
+
+ /**
+ * Creates a private link policy.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy private link Policy supplied to the operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateLinkPolicyInner create(
+ String resourceGroupName, String policyName, PrivateLinkPolicyInner privateLinkPolicy, Context context) {
+ return createAsync(resourceGroupName, policyName, privateLinkPolicy, context).block();
+ }
+
+ /**
+ * Updates private link policy tags with specified values.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy Private Link Policy resource with the tags 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 privateLink Policy configuration object along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName, String policyName, PrivateLinkPolicyUpdateParameter privateLinkPolicy) {
+ 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateLinkPolicy != null) {
+ privateLinkPolicy.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ privateLinkPolicy,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates private link policy tags with specified values.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy Private Link Policy resource with the tags 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 privateLink Policy configuration object along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName,
+ String policyName,
+ PrivateLinkPolicyUpdateParameter privateLinkPolicy,
+ 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (privateLinkPolicy != null) {
+ privateLinkPolicy.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ privateLinkPolicy,
+ accept,
+ context);
+ }
+
+ /**
+ * Updates private link policy tags with specified values.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy Private Link Policy resource with the tags 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 privateLink Policy configuration object on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String policyName, PrivateLinkPolicyUpdateParameter privateLinkPolicy) {
+ return updateWithResponseAsync(resourceGroupName, policyName, privateLinkPolicy)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Updates private link policy tags with specified values.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return privateLink Policy configuration object on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String policyName) {
+ final PrivateLinkPolicyUpdateParameter privateLinkPolicy = null;
+ return updateWithResponseAsync(resourceGroupName, policyName, privateLinkPolicy)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Updates private link policy tags with specified values.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return privateLink Policy configuration object.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateLinkPolicyInner update(String resourceGroupName, String policyName) {
+ final PrivateLinkPolicyUpdateParameter privateLinkPolicy = null;
+ return updateAsync(resourceGroupName, policyName, privateLinkPolicy).block();
+ }
+
+ /**
+ * Updates private link policy tags with specified values.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param privateLinkPolicy Private Link Policy resource with the tags 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 privateLink Policy configuration object along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(
+ String resourceGroupName,
+ String policyName,
+ PrivateLinkPolicyUpdateParameter privateLinkPolicy,
+ Context context) {
+ return updateWithResponseAsync(resourceGroupName, policyName, privateLinkPolicy, context).block();
+ }
+
+ /**
+ * Gets a private link policy with a given name.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link policy with a given name along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String policyName) {
+ 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets a private link policy with a given name.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link policy with a given name along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String policyName, 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Gets a private link policy with a given name.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link policy with a given name on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String policyName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, policyName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets a private link policy with a given name.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link policy with a given name.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateLinkPolicyInner getByResourceGroup(String resourceGroupName, String policyName) {
+ return getByResourceGroupAsync(resourceGroupName, policyName).block();
+ }
+
+ /**
+ * Gets a private link policy with a given name.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link policy with a given name along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String policyName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, policyName, context).block();
+ }
+
+ /**
+ * Deletes a private link policy. When operation completes, status code 200 returned without content.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 policyName) {
+ 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a private link policy. When operation completes, status code 200 returned without content.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 policyName, 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes a private link policy. When operation completes, status code 200 returned without content.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 policyName) {
+ return deleteWithResponseAsync(resourceGroupName, policyName).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes a private link policy. When operation completes, status code 200 returned without content.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 policyName) {
+ deleteAsync(resourceGroupName, policyName).block();
+ }
+
+ /**
+ * Deletes a private link policy. When operation completes, status code 200 returned without content.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(String resourceGroupName, String policyName, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, policyName, context).block();
+ }
+
+ /**
+ * Lists all Private Link Policies For AzureAD in the given subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Lists all Private Link Policies For AzureAD in the given subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all Private Link Policies For AzureAD in the given subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all Private Link Policies For AzureAD in the given subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all Private Link Policies For AzureAD in the given subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Lists all Private Link Policies For AzureAD in the given subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Operation to return the list of Private Link Policies For AzureAD scoped to the resourceGroup.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of private link policies as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The 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 private link policies 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 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 private link policies 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 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 private link policies 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 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 private link policies 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/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkForAzureAdsImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkForAzureAdsImpl.java
new file mode 100644
index 000000000000..ed758feed332
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkForAzureAdsImpl.java
@@ -0,0 +1,183 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.PrivateLinkForAzureAdsClient;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateLinkPolicyInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkForAzureAds;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkPolicy;
+
+public final class PrivateLinkForAzureAdsImpl implements PrivateLinkForAzureAds {
+ private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkForAzureAdsImpl.class);
+
+ private final PrivateLinkForAzureAdsClient innerClient;
+
+ private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager;
+
+ public PrivateLinkForAzureAdsImpl(
+ PrivateLinkForAzureAdsClient innerClient,
+ com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PrivateLinkPolicy getByResourceGroup(String resourceGroupName, String policyName) {
+ PrivateLinkPolicyInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, policyName);
+ if (inner != null) {
+ return new PrivateLinkPolicyImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String policyName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, policyName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new PrivateLinkPolicyImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String policyName) {
+ this.serviceClient().delete(resourceGroupName, policyName);
+ }
+
+ public Response deleteWithResponse(String resourceGroupName, String policyName, Context context) {
+ return this.serviceClient().deleteWithResponse(resourceGroupName, policyName, context);
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkPolicyImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkPolicyImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkPolicyImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkPolicyImpl(inner1, this.manager()));
+ }
+
+ public PrivateLinkPolicy 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 policyName = Utils.getValueFromIdByName(id, "privateLinkForAzureAd");
+ if (policyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateLinkForAzureAd'.",
+ id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, policyName, 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 policyName = Utils.getValueFromIdByName(id, "privateLinkForAzureAd");
+ if (policyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateLinkForAzureAd'.",
+ id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, policyName, 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 policyName = Utils.getValueFromIdByName(id, "privateLinkForAzureAd");
+ if (policyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateLinkForAzureAd'.",
+ id)));
+ }
+ this.deleteWithResponse(resourceGroupName, policyName, Context.NONE);
+ }
+
+ public Response 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 policyName = Utils.getValueFromIdByName(id, "privateLinkForAzureAd");
+ if (policyName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'privateLinkForAzureAd'.",
+ id)));
+ }
+ return this.deleteWithResponse(resourceGroupName, policyName, context);
+ }
+
+ private PrivateLinkForAzureAdsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() {
+ return this.serviceManager;
+ }
+
+ public PrivateLinkPolicyImpl define(String name) {
+ return new PrivateLinkPolicyImpl(name, this.manager());
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkPolicyImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkPolicyImpl.java
new file mode 100644
index 000000000000..bce8fcbb3b54
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkPolicyImpl.java
@@ -0,0 +1,221 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateLinkPolicyInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkPolicy;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkPolicyUpdateParameter;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class PrivateLinkPolicyImpl
+ implements PrivateLinkPolicy, PrivateLinkPolicy.Definition, PrivateLinkPolicy.Update {
+ private PrivateLinkPolicyInner innerObject;
+
+ private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String ownerTenantId() {
+ return this.innerModel().ownerTenantId();
+ }
+
+ public Boolean allTenants() {
+ return this.innerModel().allTenants();
+ }
+
+ public List tenants() {
+ List inner = this.innerModel().tenants();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public String resourceName() {
+ return this.innerModel().resourceName();
+ }
+
+ public String subscriptionId() {
+ return this.innerModel().subscriptionId();
+ }
+
+ public String resourceGroup() {
+ return this.innerModel().resourceGroup();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public PrivateLinkPolicyInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String policyName;
+
+ private PrivateLinkPolicyUpdateParameter updatePrivateLinkPolicy;
+
+ public PrivateLinkPolicyImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public PrivateLinkPolicy create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateLinkForAzureAds()
+ .create(resourceGroupName, policyName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public PrivateLinkPolicy create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateLinkForAzureAds()
+ .create(resourceGroupName, policyName, this.innerModel(), context);
+ return this;
+ }
+
+ PrivateLinkPolicyImpl(
+ String name, com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) {
+ this.innerObject = new PrivateLinkPolicyInner();
+ this.serviceManager = serviceManager;
+ this.policyName = name;
+ }
+
+ public PrivateLinkPolicyImpl update() {
+ this.updatePrivateLinkPolicy = new PrivateLinkPolicyUpdateParameter();
+ return this;
+ }
+
+ public PrivateLinkPolicy apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateLinkForAzureAds()
+ .updateWithResponse(resourceGroupName, policyName, updatePrivateLinkPolicy, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public PrivateLinkPolicy apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateLinkForAzureAds()
+ .updateWithResponse(resourceGroupName, policyName, updatePrivateLinkPolicy, context)
+ .getValue();
+ return this;
+ }
+
+ PrivateLinkPolicyImpl(
+ PrivateLinkPolicyInner innerObject,
+ com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups");
+ this.policyName = Utils.getValueFromIdByName(innerObject.id(), "privateLinkForAzureAd");
+ }
+
+ public PrivateLinkPolicy refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateLinkForAzureAds()
+ .getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public PrivateLinkPolicy refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getPrivateLinkForAzureAds()
+ .getByResourceGroupWithResponse(resourceGroupName, policyName, context)
+ .getValue();
+ return this;
+ }
+
+ public PrivateLinkPolicyImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updatePrivateLinkPolicy.withTags(tags);
+ return this;
+ }
+ }
+
+ public PrivateLinkPolicyImpl withName(String name) {
+ this.innerModel().withName(name);
+ return this;
+ }
+
+ public PrivateLinkPolicyImpl withOwnerTenantId(String ownerTenantId) {
+ this.innerModel().withOwnerTenantId(ownerTenantId);
+ return this;
+ }
+
+ public PrivateLinkPolicyImpl withAllTenants(Boolean allTenants) {
+ this.innerModel().withAllTenants(allTenants);
+ return this;
+ }
+
+ public PrivateLinkPolicyImpl withTenants(List tenants) {
+ this.innerModel().withTenants(tenants);
+ return this;
+ }
+
+ public PrivateLinkPolicyImpl withResourceName(String resourceName) {
+ this.innerModel().withResourceName(resourceName);
+ return this;
+ }
+
+ public PrivateLinkPolicyImpl withSubscriptionId(String subscriptionId) {
+ this.innerModel().withSubscriptionId(subscriptionId);
+ return this;
+ }
+
+ public PrivateLinkPolicyImpl withResourceGroup(String resourceGroup) {
+ this.innerModel().withResourceGroup(resourceGroup);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourceImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourceImpl.java
new file mode 100644
index 000000000000..e1b1394ddb86
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourceImpl.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.implementation;
+
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateLinkResourceInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkResource;
+import java.util.Collections;
+import java.util.List;
+
+public final class PrivateLinkResourceImpl implements PrivateLinkResource {
+ private PrivateLinkResourceInner innerObject;
+
+ private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager;
+
+ PrivateLinkResourceImpl(
+ PrivateLinkResourceInner innerObject,
+ com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String groupId() {
+ return this.innerModel().groupId();
+ }
+
+ public List requiredMembers() {
+ List inner = this.innerModel().requiredMembers();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public PrivateLinkResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourcesClientImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourcesClientImpl.java
new file mode 100644
index 000000000000..2a7dfe02ac0f
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourcesClientImpl.java
@@ -0,0 +1,522 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.PrivateLinkResourcesClient;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateLinkResourceInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkResourceListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */
+public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient {
+ /** The proxy service used to perform REST calls. */
+ private final PrivateLinkResourcesService service;
+
+ /** The service client containing this operation class. */
+ private final AzureactivedirectoryImpl client;
+
+ /**
+ * Initializes an instance of PrivateLinkResourcesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ PrivateLinkResourcesClientImpl(AzureactivedirectoryImpl client) {
+ this.service =
+ RestProxy
+ .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureactivedirectoryPrivateLinkResources to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "Azureactivedirectory")
+ private interface PrivateLinkResourcesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}/privateLinkResources")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByPrivateLinkPolicy(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.aadiam"
+ + "/privateLinkForAzureAd/{policyName}/privateLinkResources/{groupName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("policyName") String policyName,
+ @PathParam("groupName") String groupName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByPrivateLinkPolicyNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link resources that need to be created for a policy of AzureAD along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByPrivateLinkPolicySinglePageAsync(
+ String resourceGroupName, String policyName) {
+ 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByPrivateLinkPolicy(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources that need to be created for a policy of AzureAD along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByPrivateLinkPolicySinglePageAsync(
+ String resourceGroupName, String policyName, 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByPrivateLinkPolicy(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link resources that need to be created for a policy of AzureAD as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByPrivateLinkPolicyAsync(
+ String resourceGroupName, String policyName) {
+ return new PagedFlux<>(
+ () -> listByPrivateLinkPolicySinglePageAsync(resourceGroupName, policyName),
+ nextLink -> listByPrivateLinkPolicyNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources that need to be created for a policy of AzureAD as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByPrivateLinkPolicyAsync(
+ String resourceGroupName, String policyName, Context context) {
+ return new PagedFlux<>(
+ () -> listByPrivateLinkPolicySinglePageAsync(resourceGroupName, policyName, context),
+ nextLink -> listByPrivateLinkPolicyNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 private link resources that need to be created for a policy of AzureAD as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByPrivateLinkPolicy(
+ String resourceGroupName, String policyName) {
+ return new PagedIterable<>(listByPrivateLinkPolicyAsync(resourceGroupName, policyName));
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @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 private link resources that need to be created for a policy of AzureAD as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByPrivateLinkPolicy(
+ String resourceGroupName, String policyName, Context context) {
+ return new PagedIterable<>(listByPrivateLinkPolicyAsync(resourceGroupName, policyName, context));
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param groupName The name of the private link resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources that need to be created for a policy of AzureAD along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String policyName, String groupName) {
+ 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (groupName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ groupName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param groupName The name of the private link resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources that need to be created for a policy of AzureAD along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String policyName, String groupName, 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 (policyName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter policyName is required and cannot be null."));
+ }
+ if (groupName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ policyName,
+ groupName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param groupName The name of the private link resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources that need to be created for a policy of AzureAD on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String policyName, String groupName) {
+ return getWithResponseAsync(resourceGroupName, policyName, groupName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param groupName The name of the private link resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources that need to be created for a policy of AzureAD.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateLinkResourceInner get(String resourceGroupName, String policyName, String groupName) {
+ return getAsync(resourceGroupName, policyName, groupName).block();
+ }
+
+ /**
+ * Gets the private link resources that need to be created for a policy of AzureAD.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @param groupName The name of the private link resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the private link resources that need to be created for a policy of AzureAD along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String policyName, String groupName, Context context) {
+ return getWithResponseAsync(resourceGroupName, policyName, groupName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByPrivateLinkPolicyNextSinglePageAsync(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.listByPrivateLinkPolicyNext(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 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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByPrivateLinkPolicyNextSinglePageAsync(
+ 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
+ .listByPrivateLinkPolicyNext(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/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourcesImpl.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourcesImpl.java
new file mode 100644
index 000000000000..40961b7c06e4
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/PrivateLinkResourcesImpl.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.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.azureactivedirectory.fluent.PrivateLinkResourcesClient;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateLinkResourceInner;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkResource;
+import com.azure.resourcemanager.azureactivedirectory.models.PrivateLinkResources;
+
+public final class PrivateLinkResourcesImpl implements PrivateLinkResources {
+ private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class);
+
+ private final PrivateLinkResourcesClient innerClient;
+
+ private final com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager;
+
+ public PrivateLinkResourcesImpl(
+ PrivateLinkResourcesClient innerClient,
+ com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByPrivateLinkPolicy(String resourceGroupName, String policyName) {
+ PagedIterable inner =
+ this.serviceClient().listByPrivateLinkPolicy(resourceGroupName, policyName);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByPrivateLinkPolicy(
+ String resourceGroupName, String policyName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByPrivateLinkPolicy(resourceGroupName, policyName, context);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
+ }
+
+ public PrivateLinkResource get(String resourceGroupName, String policyName, String groupName) {
+ PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, policyName, groupName);
+ if (inner != null) {
+ return new PrivateLinkResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String policyName, String groupName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, policyName, groupName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new PrivateLinkResourceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ private PrivateLinkResourcesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.azureactivedirectory.AzureactivedirectoryManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/Utils.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/Utils.java
new file mode 100644
index 000000000000..7247a0b743ac
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/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.azureactivedirectory.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> pageMapper;
+
+ private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
+ super(
+ PagedFlux
+ .create(
+ () ->
+ (continuationToken, pageSize) ->
+ Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ this.pagedIterable = pagedIterable;
+ this.mapper = mapper;
+ this.pageMapper = getPageMapper(mapper);
+ }
+
+ private static Function, PagedResponse> getPageMapper(Function mapper) {
+ return page ->
+ new PagedResponseBase(
+ page.getRequest(),
+ page.getStatusCode(),
+ page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()),
+ page.getContinuationToken(),
+ null);
+ }
+
+ @Override
+ public Stream stream() {
+ return pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl(iterable.iterator(), mapper);
+ }
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/package-info.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/package-info.java
new file mode 100644
index 000000000000..dcd759df533a
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/implementation/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 implementations for Azureactivedirectory. Private link Policy for Azure Active Directory. */
+package com.azure.resourcemanager.azureactivedirectory.implementation;
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/ArmProxyResource.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/ArmProxyResource.java
new file mode 100644
index 000000000000..64578824fad9
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/ArmProxyResource.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.management.ProxyResource;
+
+/**
+ * The resource model definition for a ARM proxy resource. It will have everything other than required location and
+ * tags.
+ */
+@Immutable
+public class ArmProxyResource extends ProxyResource {
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/AzureResourceBase.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/AzureResourceBase.java
new file mode 100644
index 000000000000..b4d5f8efabf7
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/AzureResourceBase.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Common properties for all Azure resources. */
+@Fluent
+public class AzureResourceBase extends ProxyResource {
+ /*
+ * Name of this resource.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /**
+ * Get the name property: Name of this resource.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: Name of this resource.
+ *
+ * @param name the name value to set.
+ * @return the AzureResourceBase object itself.
+ */
+ public AzureResourceBase withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpoint.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpoint.java
new file mode 100644
index 000000000000..250f60fa5833
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpoint.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Private endpoint object properties. */
+@Fluent
+public final class PrivateEndpoint {
+ /*
+ * Full identifier of the private endpoint resource.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /**
+ * Get the id property: Full identifier of the private endpoint resource.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set the id property: Full identifier of the private endpoint resource.
+ *
+ * @param id the id value to set.
+ * @return the PrivateEndpoint object itself.
+ */
+ public PrivateEndpoint withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpointConnection.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpointConnection.java
new file mode 100644
index 000000000000..c3565666a1ef
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpointConnection.java
@@ -0,0 +1,149 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.models;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateEndpointConnectionInner;
+
+/** An immutable client-side representation of PrivateEndpointConnection. */
+public interface PrivateEndpointConnection {
+ /**
+ * Gets the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * Gets the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * Gets the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * Gets the privateEndpoint property: Properties of the private endpoint object.
+ *
+ * @return the privateEndpoint value.
+ */
+ PrivateEndpoint privateEndpoint();
+
+ /**
+ * Gets the privateLinkServiceConnectionState property: Approval state of the private link connection.
+ *
+ * @return the privateLinkServiceConnectionState value.
+ */
+ PrivateLinkServiceConnectionState privateLinkServiceConnectionState();
+
+ /**
+ * Gets the provisioningState property: Provisioning state of the private endpoint connection.
+ *
+ * @return the provisioningState value.
+ */
+ PrivateEndpointConnectionProvisioningState provisioningState();
+
+ /**
+ * Gets the privateLinkConnectionTags property: Updated tag information to set into the PrivateLinkConnection
+ * instance.
+ *
+ * @return the privateLinkConnectionTags value.
+ */
+ TagsResource privateLinkConnectionTags();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateEndpointConnectionInner
+ * object.
+ *
+ * @return the inner object.
+ */
+ PrivateEndpointConnectionInner innerModel();
+
+ /** The entirety of the PrivateEndpointConnection definition. */
+ interface Definition
+ extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate {
+ }
+ /** The PrivateEndpointConnection definition stages. */
+ interface DefinitionStages {
+ /** The first stage of the PrivateEndpointConnection definition. */
+ interface Blank extends WithParentResource {
+ }
+ /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */
+ interface WithParentResource {
+ /**
+ * Specifies resourceGroupName, policyName.
+ *
+ * @param resourceGroupName Name of an Azure resource group.
+ * @param policyName The name of the private link policy in Azure AD.
+ * @return the next definition stage.
+ */
+ WithCreate withExistingPrivateLinkForAzureAd(String resourceGroupName, String policyName);
+ }
+ /**
+ * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for
+ * the resource to be created, but also allows for any other optional properties to be specified.
+ */
+ interface WithCreate
+ extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState {
+ /**
+ * Executes the create request.
+ *
+ * @return the created resource.
+ */
+ PrivateEndpointConnection create();
+
+ /**
+ * Executes the create request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the created resource.
+ */
+ PrivateEndpointConnection create(Context context);
+ }
+ /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */
+ interface WithPrivateEndpoint {
+ /**
+ * Specifies the privateEndpoint property: Properties of the private endpoint object..
+ *
+ * @param privateEndpoint Properties of the private endpoint object.
+ * @return the next definition stage.
+ */
+ WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint);
+ }
+ /**
+ * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState.
+ */
+ interface WithPrivateLinkServiceConnectionState {
+ /**
+ * Specifies the privateLinkServiceConnectionState property: Approval state of the private link connection..
+ *
+ * @param privateLinkServiceConnectionState Approval state of the private link connection.
+ * @return the next definition stage.
+ */
+ WithCreate withPrivateLinkServiceConnectionState(
+ PrivateLinkServiceConnectionState privateLinkServiceConnectionState);
+ }
+ }
+ /**
+ * Refreshes the resource to sync with Azure.
+ *
+ * @return the refreshed resource.
+ */
+ PrivateEndpointConnection refresh();
+
+ /**
+ * Refreshes the resource to sync with Azure.
+ *
+ * @param context The context to associate with this operation.
+ * @return the refreshed resource.
+ */
+ PrivateEndpointConnection refresh(Context context);
+}
diff --git a/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpointConnectionListResult.java b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpointConnectionListResult.java
new file mode 100644
index 000000000000..e3b122f6f026
--- /dev/null
+++ b/sdk/azureactivedirectory/azure-resourcemanager-azureactivedirectory/src/main/java/com/azure/resourcemanager/azureactivedirectory/models/PrivateEndpointConnectionListResult.java
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.azureactivedirectory.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.azureactivedirectory.fluent.models.PrivateEndpointConnectionInner;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** A list of private link resources. */
+@Fluent
+public final class PrivateEndpointConnectionListResult {
+ /*
+ * Array of private link resources
+ */
+ @JsonProperty(value = "value")
+ private List value;
+
+ /*
+ * URL to next page of results
+ */
+ @JsonProperty(value = "nextLink")
+ private String nextLink;
+
+ /**
+ * Get the value property: Array of private link resources.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: Array of private link resources.
+ *
+ * @param value the value value to set.
+ * @return the PrivateEndpointConnectionListResult object itself.
+ */
+ public PrivateEndpointConnectionListResult withValue(List