diff --git a/sdk/databricks/azure-resourcemanager-databricks/CHANGELOG.md b/sdk/databricks/azure-resourcemanager-databricks/CHANGELOG.md index 4a7c72a195e78..a4da68320eef4 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/CHANGELOG.md +++ b/sdk/databricks/azure-resourcemanager-databricks/CHANGELOG.md @@ -1,7 +1,96 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2021-06-21) +- Azure Resource Manager AzureDatabricks client library for Java. This package contains Microsoft Azure SDK for AzureDatabricks Management SDK. The Microsoft Azure management APIs allow end users to operate on Azure Databricks Workspace resources. Package tag package-2021-04-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Change + +* `DatabricksManager` was removed + +* `DatabricksManager$Configurable` was removed + +### New Feature + +* `models.PrivateEndpointConnectionProvisioningState` was added + +* `models.PrivateEndpoint` was added + +* `AzureDatabricksManager` was added + +* `models.GroupIdInformation` was added + +* `models.PrivateEndpointConnection$Definition` was added + +* `models.EncryptionV2` was added + +* `models.RequiredNsgRules` was added + +* `models.GroupIdInformationProperties` was added + +* `models.PrivateLinkServiceConnectionStatus` was added + +* `models.EncryptionEntitiesDefinition` was added + +* `models.WorkspaceCustomObjectParameter` was added + +* `models.PublicNetworkAccess` was added + +* `models.WorkspacePropertiesEncryption` was added + +* `models.PrivateLinkResourcesList` was added + +* `models.PrivateEndpointConnection$DefinitionStages` was added + +* `models.PrivateEndpointConnection` was added + +* `models.PrivateLinkResources` was added + +* `models.EncryptionKeySource` was added + +* `models.PrivateEndpointConnectionProperties` was added + +* `AzureDatabricksManager$Configurable` was added + +* `models.PrivateEndpointConnectionsList` was added + +* `models.PrivateLinkServiceConnectionState` was added + +* `models.PrivateEndpointConnections` was added + +* `models.EncryptionV2KeyVaultProperties` was added + +#### `models.Workspace$Definition` was modified + +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added +* `withEncryption(models.WorkspacePropertiesEncryption)` was added +* `withRequiredNsgRules(models.RequiredNsgRules)` was added + +#### `models.Workspace` was modified + +* `encryption()` was added +* `requiredNsgRules()` was added +* `privateEndpointConnections()` was added +* `systemData()` was added +* `publicNetworkAccess()` was added + +#### `models.WorkspaceCustomParameters` was modified + +* `storageAccountName()` was added +* `withNatGatewayName(models.WorkspaceCustomStringParameter)` was added +* `loadBalancerBackendPoolName()` was added +* `natGatewayName()` was added +* `loadBalancerId()` was added +* `vnetAddressPrefix()` was added +* `withStorageAccountName(models.WorkspaceCustomStringParameter)` was added +* `publicIpName()` was added +* `withLoadBalancerId(models.WorkspaceCustomStringParameter)` was added +* `withVnetAddressPrefix(models.WorkspaceCustomStringParameter)` was added +* `withStorageAccountSkuName(models.WorkspaceCustomStringParameter)` was added +* `withPublicIpName(models.WorkspaceCustomStringParameter)` was added +* `resourceTags()` was added +* `storageAccountSkuName()` was added +* `withLoadBalancerBackendPoolName(models.WorkspaceCustomStringParameter)` was added ## 1.0.0-beta.1 (2021-04-08) diff --git a/sdk/databricks/azure-resourcemanager-databricks/README.md b/sdk/databricks/azure-resourcemanager-databricks/README.md index d367006d37b33..fe4fc63d6cc55 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/README.md +++ b/sdk/databricks/azure-resourcemanager-databricks/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager Databricks client library for Java +# Azure Resource Manager AzureDatabricks client library for Java -Azure Resource Manager Databricks client library for Java. +Azure Resource Manager AzureDatabricks client library for Java. -This package contains Microsoft Azure SDK for Databricks Management SDK. ARM Databricks. Package tag package-2018-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AzureDatabricks Management SDK. The Microsoft Azure management APIs allow end users to operate on Azure Databricks Workspace resources. Package tag package-2021-04-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-databricks - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -60,7 +60,7 @@ AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); -DatabricksManager manager = DatabricksManager +AzureDatabricksManager manager = AzureDatabricksManager .authenticate(credential, profile); ``` @@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps diff --git a/sdk/databricks/azure-resourcemanager-databricks/pom.xml b/sdk/databricks/azure-resourcemanager-databricks/pom.xml index 0a991506116a7..c999bce91fc1a 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/pom.xml +++ b/sdk/databricks/azure-resourcemanager-databricks/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-databricks - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-databricks + 1.0.0-beta.2 + jar - Microsoft Azure SDK for Databricks Management - This package contains Microsoft Azure SDK for Databricks Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. ARM Databricks. Package tag package-2018-04-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for AzureDatabricks Management + This package contains Microsoft Azure SDK for AzureDatabricks Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management APIs allow end users to operate on Azure Databricks Workspace resources. Package tag package-2021-04-01-preview. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.17.0 - - - com.azure - azure-core-management - 1.3.0 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/DatabricksManager.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/AzureDatabricksManager.java similarity index 69% rename from sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/DatabricksManager.java rename to sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/AzureDatabricksManager.java index 994d17e0d5aa7..801951783d8f6 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/DatabricksManager.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/AzureDatabricksManager.java @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,15 +16,20 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.databricks.fluent.DatabricksClient; -import com.azure.resourcemanager.databricks.implementation.DatabricksClientBuilder; +import com.azure.resourcemanager.databricks.fluent.AzureDatabricksManagementClient; +import com.azure.resourcemanager.databricks.implementation.AzureDatabricksManagementClientBuilder; import com.azure.resourcemanager.databricks.implementation.OperationsImpl; +import com.azure.resourcemanager.databricks.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.databricks.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.databricks.implementation.VNetPeeringsImpl; import com.azure.resourcemanager.databricks.implementation.WorkspacesImpl; import com.azure.resourcemanager.databricks.models.Operations; +import com.azure.resourcemanager.databricks.models.PrivateEndpointConnections; +import com.azure.resourcemanager.databricks.models.PrivateLinkResources; import com.azure.resourcemanager.databricks.models.VNetPeerings; import com.azure.resourcemanager.databricks.models.Workspaces; import java.time.Duration; @@ -34,21 +38,28 @@ import java.util.List; import java.util.Objects; -/** Entry point to DatabricksManager. ARM Databricks. */ -public final class DatabricksManager { +/** + * Entry point to AzureDatabricksManager. The Microsoft Azure management APIs allow end users to operate on Azure + * Databricks Workspace resources. + */ +public final class AzureDatabricksManager { private Workspaces workspaces; - private VNetPeerings vNetPeerings; - private Operations operations; - private final DatabricksClient clientObject; + private PrivateLinkResources privateLinkResources; + + private PrivateEndpointConnections privateEndpointConnections; + + private VNetPeerings vNetPeerings; - private DatabricksManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + private final AzureDatabricksManagementClient clientObject; + + private AzureDatabricksManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = - new DatabricksClientBuilder() + new AzureDatabricksManagementClientBuilder() .pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) @@ -57,25 +68,25 @@ private DatabricksManager(HttpPipeline httpPipeline, AzureProfile profile, Durat } /** - * Creates an instance of Databricks service API entry point. + * Creates an instance of AzureDatabricks service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the Databricks service API instance. + * @return the AzureDatabricks service API instance. */ - public static DatabricksManager authenticate(TokenCredential credential, AzureProfile profile) { + public static AzureDatabricksManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); return configure().authenticate(credential, profile); } /** - * Gets a Configurable instance that can be used to create DatabricksManager with optional configuration. + * Gets a Configurable instance that can be used to create AzureDatabricksManager with optional configuration. * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { - return new DatabricksManager.Configurable(); + return new AzureDatabricksManager.Configurable(); } /** The Configurable allowing configurations to be set. */ @@ -85,6 +96,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -124,6 +136,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { 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. * @@ -150,13 +173,13 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of Databricks service API entry point. + * Creates an instance of AzureDatabricks service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the Databricks service API instance. + * @return the AzureDatabricks service API instance. */ - public DatabricksManager authenticate(TokenCredential credential, AzureProfile profile) { + public AzureDatabricksManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); @@ -166,7 +189,7 @@ public DatabricksManager authenticate(TokenCredential credential, AzureProfile p .append("-") .append("com.azure.resourcemanager.databricks") .append("/") - .append("1.0.0-beta.1"); + .append("1.0.0-beta.2"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -180,6 +203,9 @@ public DatabricksManager authenticate(TokenCredential credential, AzureProfile p userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -189,10 +215,7 @@ public DatabricksManager authenticate(TokenCredential credential, AzureProfile p HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); @@ -201,7 +224,7 @@ public DatabricksManager authenticate(TokenCredential credential, AzureProfile p .httpClient(httpClient) .policies(policies.toArray(new HttpPipelinePolicy[0])) .build(); - return new DatabricksManager(httpPipeline, profile, defaultPollInterval); + return new AzureDatabricksManager(httpPipeline, profile, defaultPollInterval); } } @@ -213,14 +236,6 @@ public Workspaces workspaces() { return workspaces; } - /** @return Resource collection API of VNetPeerings. */ - public VNetPeerings vNetPeerings() { - if (this.vNetPeerings == null) { - this.vNetPeerings = new VNetPeeringsImpl(clientObject.getVNetPeerings(), this); - } - return vNetPeerings; - } - /** @return Resource collection API of Operations. */ public Operations operations() { if (this.operations == null) { @@ -229,11 +244,36 @@ public Operations operations() { return operations; } + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of VNetPeerings. */ + public VNetPeerings vNetPeerings() { + if (this.vNetPeerings == null) { + this.vNetPeerings = new VNetPeeringsImpl(clientObject.getVNetPeerings(), this); + } + return vNetPeerings; + } + /** - * @return Wrapped service client DatabricksClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * @return Wrapped service client AzureDatabricksManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. */ - public DatabricksClient serviceClient() { + public AzureDatabricksManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/DatabricksClient.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/AzureDatabricksManagementClient.java similarity index 72% rename from sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/DatabricksClient.java rename to sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/AzureDatabricksManagementClient.java index f37f4abbaf922..50ef24580115c 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/DatabricksClient.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/AzureDatabricksManagementClient.java @@ -7,8 +7,8 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for DatabricksClient class. */ -public interface DatabricksClient { +/** The interface for AzureDatabricksManagementClient class. */ +public interface AzureDatabricksManagementClient { /** * Gets The ID of the target subscription. * @@ -23,13 +23,6 @@ public interface DatabricksClient { */ String getEndpoint(); - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - /** * Gets The HTTP pipeline to send requests through. * @@ -52,16 +45,30 @@ public interface DatabricksClient { WorkspacesClient getWorkspaces(); /** - * Gets the VNetPeeringsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the VNetPeeringsClient object. + * @return the OperationsClient object. */ - VNetPeeringsClient getVNetPeerings(); + OperationsClient getOperations(); /** - * Gets the OperationsClient object to access its operations. + * Gets the PrivateLinkResourcesClient object to access its operations. * - * @return the OperationsClient object. + * @return the PrivateLinkResourcesClient object. */ - OperationsClient getOperations(); + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the VNetPeeringsClient object to access its operations. + * + * @return the VNetPeeringsClient object. + */ + VNetPeeringsClient getVNetPeerings(); } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/PrivateEndpointConnectionsClient.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..ad8f1129a43a4 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.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.databricks.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection properties for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection properties for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 workspaceName, String privateEndpointConnectionName); + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 workspaceName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/PrivateLinkResourcesClient.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..39a0b2ca1abb3 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.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.databricks.fluent.models.GroupIdInformationInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GroupIdInformationInner get(String resourceGroupName, String workspaceName, String groupId); + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId 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.resourcemanager.databricks.models.ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String groupId, Context context); +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/GroupIdInformationInner.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/GroupIdInformationInner.java new file mode 100644 index 0000000000000..64dbf42729253 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/GroupIdInformationInner.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.databricks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databricks.models.GroupIdInformationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The group information for creating a private endpoint on a workspace. */ +@Fluent +public final class GroupIdInformationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupIdInformationInner.class); + + /* + * The group id properties. + */ + @JsonProperty(value = "properties", required = true) + private GroupIdInformationProperties properties; + + /** + * Get the properties property: The group id properties. + * + * @return the properties value. + */ + public GroupIdInformationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The group id properties. + * + * @param properties the properties value to set. + * @return the GroupIdInformationInner object itself. + */ + public GroupIdInformationInner withProperties(GroupIdInformationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model GroupIdInformationInner")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/PrivateEndpointConnectionInner.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..ed5caef30d53a --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/PrivateEndpointConnectionInner.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.databricks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databricks.models.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The private endpoint connection of a workspace. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The private endpoint connection properties. + */ + @JsonProperty(value = "properties", required = true) + private PrivateEndpointConnectionProperties properties; + + /** + * Get the properties property: The private endpoint connection properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The private endpoint connection properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model PrivateEndpointConnectionInner")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/WorkspaceInner.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/WorkspaceInner.java index 25ef293e9481f..4441f7ffe593a 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/WorkspaceInner.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/WorkspaceInner.java @@ -7,12 +7,16 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.databricks.models.CreatedBy; import com.azure.resourcemanager.databricks.models.ManagedIdentityConfiguration; import com.azure.resourcemanager.databricks.models.ProvisioningState; +import com.azure.resourcemanager.databricks.models.PublicNetworkAccess; +import com.azure.resourcemanager.databricks.models.RequiredNsgRules; import com.azure.resourcemanager.databricks.models.Sku; import com.azure.resourcemanager.databricks.models.WorkspaceCustomParameters; +import com.azure.resourcemanager.databricks.models.WorkspacePropertiesEncryption; import com.azure.resourcemanager.databricks.models.WorkspaceProviderAuthorization; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -32,6 +36,12 @@ public class WorkspaceInner extends Resource { @JsonProperty(value = "sku") private Sku sku; + /* + * The system metadata relating to this resource + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /* * The managed resource group Id. */ @@ -102,6 +112,34 @@ public class WorkspaceInner extends Resource { @JsonProperty(value = "properties.storageAccountIdentity") private ManagedIdentityConfiguration storageAccountIdentity; + /* + * Encryption properties for databricks workspace + */ + @JsonProperty(value = "properties.encryption") + private WorkspacePropertiesEncryption encryption; + + /* + * Private endpoint connections created on the workspace + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * The network access type for accessing workspace. Set value to disabled + * to access workspace only via private link. + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Gets or sets a value indicating whether data plane (clusters) to control + * plane communication happen over private endpoint. Supported values are + * 'AllRules' and 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is + * for internal use only. + */ + @JsonProperty(value = "properties.requiredNsgRules") + private RequiredNsgRules requiredNsgRules; + /** * Get the sku property: The SKU of the resource. * @@ -122,6 +160,15 @@ public WorkspaceInner withSku(Sku sku) { return this; } + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the managedResourceGroupId property: The managed resource group Id. * @@ -303,6 +350,81 @@ public WorkspaceInner withStorageAccountIdentity(ManagedIdentityConfiguration st return this; } + /** + * Get the encryption property: Encryption properties for databricks workspace. + * + * @return the encryption value. + */ + public WorkspacePropertiesEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Encryption properties for databricks workspace. + * + * @param encryption the encryption value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withEncryption(WorkspacePropertiesEncryption encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections created on the workspace. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: The network access type for accessing workspace. Set value to disabled to + * access workspace only via private link. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: The network access type for accessing workspace. Set value to disabled to + * access workspace only via private link. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the requiredNsgRules property: Gets or sets a value indicating whether data plane (clusters) to control plane + * communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. + * 'NoAzureServiceRules' value is for internal use only. + * + * @return the requiredNsgRules value. + */ + public RequiredNsgRules requiredNsgRules() { + return this.requiredNsgRules; + } + + /** + * Set the requiredNsgRules property: Gets or sets a value indicating whether data plane (clusters) to control plane + * communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. + * 'NoAzureServiceRules' value is for internal use only. + * + * @param requiredNsgRules the requiredNsgRules value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withRequiredNsgRules(RequiredNsgRules requiredNsgRules) { + this.requiredNsgRules = requiredNsgRules; + return this; + } + /** {@inheritDoc} */ @Override public WorkspaceInner withLocation(String location) { @@ -347,5 +469,11 @@ public void validate() { if (storageAccountIdentity() != null) { storageAccountIdentity().validate(); } + if (encryption() != null) { + encryption().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/package-info.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/package-info.java index 65bb5a8fc10cd..088ce80b2ab67 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/package-info.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for DatabricksClient. ARM Databricks. */ +/** + * Package containing the inner data models for AzureDatabricksManagementClient. The Microsoft Azure management APIs + * allow end users to operate on Azure Databricks Workspace resources. + */ package com.azure.resourcemanager.databricks.fluent.models; diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/package-info.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/package-info.java index cb7bb8c062fa2..818492c1c1813 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/package-info.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for DatabricksClient. ARM Databricks. */ +/** + * Package containing the service clients for AzureDatabricksManagementClient. The Microsoft Azure management APIs allow + * end users to operate on Azure Databricks Workspace resources. + */ package com.azure.resourcemanager.databricks.fluent; diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/DatabricksClientBuilder.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/AzureDatabricksManagementClientBuilder.java similarity index 69% rename from sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/DatabricksClientBuilder.java rename to sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/AzureDatabricksManagementClientBuilder.java index b91bca50acc0c..184d82d2830fb 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/DatabricksClientBuilder.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/AzureDatabricksManagementClientBuilder.java @@ -15,9 +15,9 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the DatabricksClientImpl type. */ -@ServiceClientBuilder(serviceClients = {DatabricksClientImpl.class}) -public final class DatabricksClientBuilder { +/** A builder for creating a new instance of the AzureDatabricksManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {AzureDatabricksManagementClientImpl.class}) +public final class AzureDatabricksManagementClientBuilder { /* * The ID of the target subscription. */ @@ -27,9 +27,9 @@ public final class DatabricksClientBuilder { * Sets The ID of the target subscription. * * @param subscriptionId the subscriptionId value. - * @return the DatabricksClientBuilder. + * @return the AzureDatabricksManagementClientBuilder. */ - public DatabricksClientBuilder subscriptionId(String subscriptionId) { + public AzureDatabricksManagementClientBuilder subscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } @@ -43,9 +43,9 @@ public DatabricksClientBuilder subscriptionId(String subscriptionId) { * Sets server parameter. * * @param endpoint the endpoint value. - * @return the DatabricksClientBuilder. + * @return the AzureDatabricksManagementClientBuilder. */ - public DatabricksClientBuilder endpoint(String endpoint) { + public AzureDatabricksManagementClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -59,9 +59,9 @@ public DatabricksClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the DatabricksClientBuilder. + * @return the AzureDatabricksManagementClientBuilder. */ - public DatabricksClientBuilder environment(AzureEnvironment environment) { + public AzureDatabricksManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -75,9 +75,9 @@ public DatabricksClientBuilder environment(AzureEnvironment environment) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the DatabricksClientBuilder. + * @return the AzureDatabricksManagementClientBuilder. */ - public DatabricksClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public AzureDatabricksManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -91,9 +91,9 @@ public DatabricksClientBuilder defaultPollInterval(Duration defaultPollInterval) * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the DatabricksClientBuilder. + * @return the AzureDatabricksManagementClientBuilder. */ - public DatabricksClientBuilder pipeline(HttpPipeline pipeline) { + public AzureDatabricksManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -107,19 +107,19 @@ public DatabricksClientBuilder pipeline(HttpPipeline pipeline) { * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the DatabricksClientBuilder. + * @return the AzureDatabricksManagementClientBuilder. */ - public DatabricksClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public AzureDatabricksManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of DatabricksClientImpl with the provided parameters. + * Builds an instance of AzureDatabricksManagementClientImpl with the provided parameters. * - * @return an instance of DatabricksClientImpl. + * @return an instance of AzureDatabricksManagementClientImpl. */ - public DatabricksClientImpl buildClient() { + public AzureDatabricksManagementClientImpl buildClient() { if (endpoint == null) { this.endpoint = "https://management.azure.com"; } @@ -138,8 +138,8 @@ public DatabricksClientImpl buildClient() { if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } - DatabricksClientImpl client = - new DatabricksClientImpl( + AzureDatabricksManagementClientImpl client = + new AzureDatabricksManagementClientImpl( pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); return client; } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/DatabricksClientImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/AzureDatabricksManagementClientImpl.java similarity index 85% rename from sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/DatabricksClientImpl.java rename to sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/AzureDatabricksManagementClientImpl.java index 7e4a2786aea9a..a54ae7d37dac0 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/DatabricksClientImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/AzureDatabricksManagementClientImpl.java @@ -21,8 +21,10 @@ 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.databricks.fluent.DatabricksClient; +import com.azure.resourcemanager.databricks.fluent.AzureDatabricksManagementClient; import com.azure.resourcemanager.databricks.fluent.OperationsClient; +import com.azure.resourcemanager.databricks.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.databricks.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.databricks.fluent.VNetPeeringsClient; import com.azure.resourcemanager.databricks.fluent.WorkspacesClient; import java.io.IOException; @@ -35,10 +37,10 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the DatabricksClientImpl type. */ -@ServiceClient(builder = DatabricksClientBuilder.class) -public final class DatabricksClientImpl implements DatabricksClient { - private final ClientLogger logger = new ClientLogger(DatabricksClientImpl.class); +/** Initializes a new instance of the AzureDatabricksManagementClientImpl type. */ +@ServiceClient(builder = AzureDatabricksManagementClientBuilder.class) +public final class AzureDatabricksManagementClientImpl implements AzureDatabricksManagementClient { + private final ClientLogger logger = new ClientLogger(AzureDatabricksManagementClientImpl.class); /** The ID of the target subscription. */ private final String subscriptionId; @@ -64,18 +66,6 @@ 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; @@ -124,18 +114,6 @@ public WorkspacesClient getWorkspaces() { return this.workspaces; } - /** The VNetPeeringsClient object to access its operations. */ - private final VNetPeeringsClient vNetPeerings; - - /** - * Gets the VNetPeeringsClient object to access its operations. - * - * @return the VNetPeeringsClient object. - */ - public VNetPeeringsClient getVNetPeerings() { - return this.vNetPeerings; - } - /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -148,8 +126,44 @@ public OperationsClient getOperations() { return this.operations; } + /** 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; + } + + /** The VNetPeeringsClient object to access its operations. */ + private final VNetPeeringsClient vNetPeerings; + + /** + * Gets the VNetPeeringsClient object to access its operations. + * + * @return the VNetPeeringsClient object. + */ + public VNetPeeringsClient getVNetPeerings() { + return this.vNetPeerings; + } + /** - * Initializes an instance of DatabricksClient client. + * Initializes an instance of AzureDatabricksManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. @@ -158,7 +172,7 @@ public OperationsClient getOperations() { * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - DatabricksClientImpl( + AzureDatabricksManagementClientImpl( HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, @@ -170,10 +184,11 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2018-04-01"; this.workspaces = new WorkspacesClientImpl(this); - this.vNetPeerings = new VNetPeeringsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.vNetPeerings = new VNetPeeringsClientImpl(this); } /** diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/GroupIdInformationImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/GroupIdInformationImpl.java new file mode 100644 index 0000000000000..b3e1d2a950b83 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/GroupIdInformationImpl.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.databricks.implementation; + +import com.azure.resourcemanager.databricks.fluent.models.GroupIdInformationInner; +import com.azure.resourcemanager.databricks.models.GroupIdInformation; +import com.azure.resourcemanager.databricks.models.GroupIdInformationProperties; + +public final class GroupIdInformationImpl implements GroupIdInformation { + private GroupIdInformationInner innerObject; + + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; + + GroupIdInformationImpl( + GroupIdInformationInner innerObject, + com.azure.resourcemanager.databricks.AzureDatabricksManager 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 GroupIdInformationProperties properties() { + return this.innerModel().properties(); + } + + public GroupIdInformationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationImpl.java index 292fca576ada8..05553c361c41f 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationImpl.java @@ -11,9 +11,10 @@ public final class OperationImpl implements Operation { private OperationInner innerObject; - private final com.azure.resourcemanager.databricks.DatabricksManager serviceManager; + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.databricks.DatabricksManager serviceManager) { + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -30,7 +31,7 @@ public OperationInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.databricks.DatabricksManager manager() { + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { return this.serviceManager; } } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationsClientImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationsClientImpl.java index a4842f938eedc..c9b85117d4d5e 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationsClientImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationsClientImpl.java @@ -39,25 +39,25 @@ public final class OperationsClientImpl implements OperationsClient { private final OperationsService service; /** The service client containing this operation class. */ - private final DatabricksClientImpl client; + private final AzureDatabricksManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(DatabricksClientImpl client) { + OperationsClientImpl(AzureDatabricksManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DatabricksClientOperations to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for AzureDatabricksManagementClientOperations to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "DatabricksClientOper") + @ServiceInterface(name = "AzureDatabricksManag") private interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.Databricks/operations") @@ -95,10 +95,10 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -128,10 +128,11 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .list(this.client.getEndpoint(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationsImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationsImpl.java index d4b66159af96f..22868de60d49e 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationsImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/OperationsImpl.java @@ -18,10 +18,10 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final com.azure.resourcemanager.databricks.DatabricksManager serviceManager; + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.databricks.DatabricksManager serviceManager) { + OperationsClient innerClient, com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -40,7 +40,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.databricks.DatabricksManager manager() { + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { return this.serviceManager; } } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..40bab655657fb --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databricks.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.databricks.models.PrivateEndpointConnection; +import com.azure.resourcemanager.databricks.models.PrivateEndpointConnectionProperties; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.databricks.AzureDatabricksManager 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 PrivateEndpointConnectionProperties properties() { + return this.innerModel().properties(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create( + resourceGroupName, workspaceName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create(resourceGroupName, workspaceName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..c26b7fc68978a --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.databricks.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.databricks.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.databricks.models.ErrorInfoException; +import com.azure.resourcemanager.databricks.models.PrivateEndpointConnectionsList; +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 { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final AzureDatabricksManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(AzureDatabricksManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDatabricksManagementClientPrivateEndpointConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDatabricksManag") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks" + + "/workspaces/{workspaceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorInfoException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @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.Databricks" + + "/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorInfoException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks" + + "/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ErrorInfoException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks" + + "/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ErrorInfoException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorInfoException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection properties for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection properties for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection properties for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection properties for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).block(); + } + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection properties for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + privateEndpointConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + privateEndpointConnection, + accept, + context); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, privateEndpointConnection); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, privateEndpointConnection, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, privateEndpointConnection) + .getSyncPoller(); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginCreateAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, privateEndpointConnection, context) + .getSyncPoller(); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, privateEndpointConnection) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginCreateAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, privateEndpointConnection, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return createAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, privateEndpointConnection) + .block(); + } + + /** + * Update the status of a private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The private endpoint connection with updated properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 endpoint connection of a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return createAsync( + resourceGroupName, workspaceName, privateEndpointConnectionName, privateEndpointConnection, context) + .block(); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 workspaceName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).block(); + } + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 workspaceName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @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 ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + @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/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionsImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..7b5c6032e9196 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.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.databricks.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.databricks.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.databricks.models.PrivateEndpointConnection; +import com.azure.resourcemanager.databricks.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + } + + 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 workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", 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, workspaceName, 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 workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", 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, workspaceName, 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 workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", 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, workspaceName, 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 workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", 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, workspaceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateLinkResourcesClientImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..d17ecb9e94305 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databricks.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.databricks.fluent.models.GroupIdInformationInner; +import com.azure.resourcemanager.databricks.models.ErrorInfoException; +import com.azure.resourcemanager.databricks.models.PrivateLinkResourcesList; +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 { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final AzureDatabricksManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(AzureDatabricksManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDatabricksManagementClientPrivateLinkResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDatabricksManag") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks" + + "/workspaces/{workspaceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorInfoException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @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.Databricks" + + "/workspaces/{workspaceName}/privateLinkResources/{groupId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorInfoException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("groupId") String groupId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ErrorInfoException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String groupId) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + final String apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + groupId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId 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 ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String groupId, 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + final String apiVersion = "2021-04-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + workspaceName, + apiVersion, + this.client.getSubscriptionId(), + groupId, + accept, + context); + } + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String groupId) { + return getWithResponseAsync(resourceGroupName, workspaceName, groupId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GroupIdInformationInner get(String resourceGroupName, String workspaceName, String groupId) { + return getAsync(resourceGroupName, workspaceName, groupId).block(); + } + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId 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 ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String groupId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, groupId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @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 ErrorInfoException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + @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/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateLinkResourcesImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..286a43b516bb0 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.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.databricks.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.databricks.fluent.models.GroupIdInformationInner; +import com.azure.resourcemanager.databricks.models.GroupIdInformation; +import com.azure.resourcemanager.databricks.models.PrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new GroupIdInformationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new GroupIdInformationImpl(inner1, this.manager())); + } + + public GroupIdInformation get(String resourceGroupName, String workspaceName, String groupId) { + GroupIdInformationInner inner = this.serviceClient().get(resourceGroupName, workspaceName, groupId); + if (inner != null) { + return new GroupIdInformationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String groupId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, groupId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GroupIdInformationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VNetPeeringsClientImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VNetPeeringsClientImpl.java index e2793dafec678..ea87c21dc61c5 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VNetPeeringsClientImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VNetPeeringsClientImpl.java @@ -47,25 +47,25 @@ public final class VNetPeeringsClientImpl implements VNetPeeringsClient { private final VNetPeeringsService service; /** The service client containing this operation class. */ - private final DatabricksClientImpl client; + private final AzureDatabricksManagementClientImpl client; /** * Initializes an instance of VNetPeeringsClientImpl. * * @param client the instance of the service client containing this operation class. */ - VNetPeeringsClientImpl(DatabricksClientImpl client) { + VNetPeeringsClientImpl(AzureDatabricksManagementClientImpl client) { this.service = RestProxy.create(VNetPeeringsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DatabricksClientVNetPeerings to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for AzureDatabricksManagementClientVNetPeerings to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "DatabricksClientVNet") + @ServiceInterface(name = "AzureDatabricksManag") private interface VNetPeeringsService { @Headers({"Content-Type: application/json"}) @Get( @@ -178,6 +178,7 @@ private Mono> getWithResponseAsync( if (peeringName == null) { return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); } + final String apiVersion = "2018-04-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -187,7 +188,7 @@ private Mono> getWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), peeringName, accept, @@ -232,6 +233,7 @@ private Mono> getWithResponseAsync( if (peeringName == null) { return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); } + final String apiVersion = "2018-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -239,7 +241,7 @@ private Mono> getWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), peeringName, accept, @@ -341,6 +343,7 @@ private Mono>> deleteWithResponseAsync( if (peeringName == null) { return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); } + final String apiVersion = "2018-04-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -350,7 +353,7 @@ private Mono>> deleteWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), peeringName, accept, @@ -395,6 +398,7 @@ private Mono>> deleteWithResponseAsync( if (peeringName == null) { return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); } + final String apiVersion = "2018-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -402,7 +406,7 @@ private Mono>> deleteWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), peeringName, accept, @@ -604,6 +608,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { virtualNetworkPeeringParameters.validate(); } + final String apiVersion = "2018-04-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -613,7 +618,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), peeringName, virtualNetworkPeeringParameters, @@ -672,6 +677,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { virtualNetworkPeeringParameters.validate(); } + final String apiVersion = "2018-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -679,7 +685,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), peeringName, virtualNetworkPeeringParameters, @@ -927,6 +933,7 @@ private Mono> listByWorkspaceSinglePag new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2018-04-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -936,7 +943,7 @@ private Mono> listByWorkspaceSinglePag this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -985,6 +992,7 @@ private Mono> listByWorkspaceSinglePag new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2018-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -992,7 +1000,7 @@ private Mono> listByWorkspaceSinglePag this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VNetPeeringsImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VNetPeeringsImpl.java index 03a7aaee5d8a9..ee96bfd648607 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VNetPeeringsImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VNetPeeringsImpl.java @@ -20,10 +20,10 @@ public final class VNetPeeringsImpl implements VNetPeerings { private final VNetPeeringsClient innerClient; - private final com.azure.resourcemanager.databricks.DatabricksManager serviceManager; + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; public VNetPeeringsImpl( - VNetPeeringsClient innerClient, com.azure.resourcemanager.databricks.DatabricksManager serviceManager) { + VNetPeeringsClient innerClient, com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -193,7 +193,7 @@ private VNetPeeringsClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.databricks.DatabricksManager manager() { + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { return this.serviceManager; } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VirtualNetworkPeeringImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VirtualNetworkPeeringImpl.java index 571e629fb4f1d..e359f6e9d393e 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VirtualNetworkPeeringImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/VirtualNetworkPeeringImpl.java @@ -17,7 +17,7 @@ public final class VirtualNetworkPeeringImpl implements VirtualNetworkPeering, VirtualNetworkPeering.Definition, VirtualNetworkPeering.Update { private VirtualNetworkPeeringInner innerObject; - private final com.azure.resourcemanager.databricks.DatabricksManager serviceManager; + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; public String id() { return this.innerModel().id(); @@ -75,7 +75,7 @@ public VirtualNetworkPeeringInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.databricks.DatabricksManager manager() { + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { return this.serviceManager; } @@ -109,7 +109,7 @@ public VirtualNetworkPeering create(Context context) { return this; } - VirtualNetworkPeeringImpl(String name, com.azure.resourcemanager.databricks.DatabricksManager serviceManager) { + VirtualNetworkPeeringImpl(String name, com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { this.innerObject = new VirtualNetworkPeeringInner(); this.serviceManager = serviceManager; this.peeringName = name; @@ -138,7 +138,8 @@ public VirtualNetworkPeering apply(Context context) { } VirtualNetworkPeeringImpl( - VirtualNetworkPeeringInner innerObject, com.azure.resourcemanager.databricks.DatabricksManager serviceManager) { + VirtualNetworkPeeringInner innerObject, + com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspaceImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspaceImpl.java index a8770a594ee48..77883e7ff82eb 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspaceImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspaceImpl.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.databricks.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; +import com.azure.resourcemanager.databricks.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.databricks.fluent.models.WorkspaceInner; import com.azure.resourcemanager.databricks.models.CreatedBy; import com.azure.resourcemanager.databricks.models.ManagedIdentityConfiguration; +import com.azure.resourcemanager.databricks.models.PrivateEndpointConnection; import com.azure.resourcemanager.databricks.models.ProvisioningState; +import com.azure.resourcemanager.databricks.models.PublicNetworkAccess; +import com.azure.resourcemanager.databricks.models.RequiredNsgRules; import com.azure.resourcemanager.databricks.models.Sku; import com.azure.resourcemanager.databricks.models.Workspace; import com.azure.resourcemanager.databricks.models.WorkspaceCustomParameters; +import com.azure.resourcemanager.databricks.models.WorkspacePropertiesEncryption; import com.azure.resourcemanager.databricks.models.WorkspaceProviderAuthorization; import com.azure.resourcemanager.databricks.models.WorkspaceUpdate; import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class WorkspaceImpl implements Workspace, Workspace.Definition, Workspace.Update { private WorkspaceInner innerObject; - private final com.azure.resourcemanager.databricks.DatabricksManager serviceManager; + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; public String id() { return this.innerModel().id(); @@ -54,6 +61,10 @@ public Sku sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String managedResourceGroupId() { return this.innerModel().managedResourceGroupId(); } @@ -103,6 +114,32 @@ public ManagedIdentityConfiguration storageAccountIdentity() { return this.innerModel().storageAccountIdentity(); } + public WorkspacePropertiesEncryption encryption() { + return this.innerModel().encryption(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public RequiredNsgRules requiredNsgRules() { + return this.innerModel().requiredNsgRules(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -115,7 +152,7 @@ public WorkspaceInner innerModel() { return this.innerObject; } - private com.azure.resourcemanager.databricks.DatabricksManager manager() { + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { return this.serviceManager; } @@ -148,7 +185,7 @@ public Workspace create(Context context) { return this; } - WorkspaceImpl(String name, com.azure.resourcemanager.databricks.DatabricksManager serviceManager) { + WorkspaceImpl(String name, com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { this.innerObject = new WorkspaceInner(); this.serviceManager = serviceManager; this.workspaceName = name; @@ -177,7 +214,8 @@ public Workspace apply(Context context) { return this; } - WorkspaceImpl(WorkspaceInner innerObject, com.azure.resourcemanager.databricks.DatabricksManager serviceManager) { + WorkspaceImpl( + WorkspaceInner innerObject, com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -264,6 +302,21 @@ public WorkspaceImpl withStorageAccountIdentity(ManagedIdentityConfiguration sto return this; } + public WorkspaceImpl withEncryption(WorkspacePropertiesEncryption encryption) { + this.innerModel().withEncryption(encryption); + return this; + } + + public WorkspaceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public WorkspaceImpl withRequiredNsgRules(RequiredNsgRules requiredNsgRules) { + this.innerModel().withRequiredNsgRules(requiredNsgRules); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspacesClientImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspacesClientImpl.java index eb12d54ad256c..90b5c9a16e062 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspacesClientImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspacesClientImpl.java @@ -49,25 +49,25 @@ public final class WorkspacesClientImpl implements WorkspacesClient { private final WorkspacesService service; /** The service client containing this operation class. */ - private final DatabricksClientImpl client; + private final AzureDatabricksManagementClientImpl client; /** * Initializes an instance of WorkspacesClientImpl. * * @param client the instance of the service client containing this operation class. */ - WorkspacesClientImpl(DatabricksClientImpl client) { + WorkspacesClientImpl(AzureDatabricksManagementClientImpl client) { this.service = RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for DatabricksClientWorkspaces to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for AzureDatabricksManagementClientWorkspaces to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "DatabricksClientWork") + @ServiceInterface(name = "AzureDatabricksManag") private interface WorkspacesService { @Headers({"Content-Type: application/json"}) @Get( @@ -209,6 +209,7 @@ private Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -218,7 +219,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -258,6 +259,7 @@ private Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -265,7 +267,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -357,6 +359,7 @@ private Mono>> deleteWithResponseAsync(String resource new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -366,7 +369,7 @@ private Mono>> deleteWithResponseAsync(String resource this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -406,6 +409,7 @@ private Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -413,7 +417,7 @@ private Mono>> deleteWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -590,6 +594,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -599,7 +604,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -646,6 +651,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -653,7 +659,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -852,6 +858,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -861,7 +868,7 @@ private Mono>> updateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -908,6 +915,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -915,7 +923,7 @@ private Mono>> updateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, workspaceName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -1102,6 +1110,7 @@ private Mono> listByResourceGroupSinglePageAsync(S new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1110,7 +1119,7 @@ private Mono> listByResourceGroupSinglePageAsync(S .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -1155,13 +1164,14 @@ private Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context) @@ -1259,17 +1269,13 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .>map( res -> new PagedResponseBase<>( @@ -1305,15 +1311,11 @@ private Mono> listSinglePageAsync(Context context) new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2021-04-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspacesImpl.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspacesImpl.java index 2b1fa629326f0..8d754cc2b4b67 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspacesImpl.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/WorkspacesImpl.java @@ -20,10 +20,10 @@ public final class WorkspacesImpl implements Workspaces { private final WorkspacesClient innerClient; - private final com.azure.resourcemanager.databricks.DatabricksManager serviceManager; + private final com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager; public WorkspacesImpl( - WorkspacesClient innerClient, com.azure.resourcemanager.databricks.DatabricksManager serviceManager) { + WorkspacesClient innerClient, com.azure.resourcemanager.databricks.AzureDatabricksManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -160,7 +160,7 @@ private WorkspacesClient serviceClient() { return this.innerClient; } - private com.azure.resourcemanager.databricks.DatabricksManager manager() { + private com.azure.resourcemanager.databricks.AzureDatabricksManager manager() { return this.serviceManager; } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/package-info.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/package-info.java index 1f731192925c3..4e34cde0c7f65 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/package-info.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for DatabricksClient. ARM Databricks. */ +/** + * Package containing the implementations for AzureDatabricksManagementClient. The Microsoft Azure management APIs allow + * end users to operate on Azure Databricks Workspace resources. + */ package com.azure.resourcemanager.databricks.implementation; diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionEntitiesDefinition.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionEntitiesDefinition.java new file mode 100644 index 0000000000000..c659067f6cff3 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionEntitiesDefinition.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption entities for databricks workspace resource. */ +@Fluent +public final class EncryptionEntitiesDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionEntitiesDefinition.class); + + /* + * Encryption properties for the databricks managed services. + */ + @JsonProperty(value = "managedServices") + private EncryptionV2 managedServices; + + /** + * Get the managedServices property: Encryption properties for the databricks managed services. + * + * @return the managedServices value. + */ + public EncryptionV2 managedServices() { + return this.managedServices; + } + + /** + * Set the managedServices property: Encryption properties for the databricks managed services. + * + * @param managedServices the managedServices value to set. + * @return the EncryptionEntitiesDefinition object itself. + */ + public EncryptionEntitiesDefinition withManagedServices(EncryptionV2 managedServices) { + this.managedServices = managedServices; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedServices() != null) { + managedServices().validate(); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionKeySource.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionKeySource.java new file mode 100644 index 0000000000000..f3d323af4aeb4 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionKeySource.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionKeySource. */ +public final class EncryptionKeySource extends ExpandableStringEnum { + /** Static value Microsoft.Keyvault for EncryptionKeySource. */ + public static final EncryptionKeySource MICROSOFT_KEYVAULT = fromString("Microsoft.Keyvault"); + + /** + * Creates or finds a EncryptionKeySource from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionKeySource. + */ + @JsonCreator + public static EncryptionKeySource fromString(String name) { + return fromString(name, EncryptionKeySource.class); + } + + /** @return known EncryptionKeySource values. */ + public static Collection values() { + return values(EncryptionKeySource.class); + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionV2.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionV2.java new file mode 100644 index 0000000000000..adcfef831d11b --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionV2.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that contains details of encryption used on the workspace. */ +@Fluent +public final class EncryptionV2 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionV2.class); + + /* + * The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Keyvault + */ + @JsonProperty(value = "keySource", required = true) + private EncryptionKeySource keySource; + + /* + * Key Vault input properties for encryption. + */ + @JsonProperty(value = "keyVaultProperties") + private EncryptionV2KeyVaultProperties keyVaultProperties; + + /** + * Get the keySource property: The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Keyvault. + * + * @return the keySource value. + */ + public EncryptionKeySource keySource() { + return this.keySource; + } + + /** + * Set the keySource property: The encryption keySource (provider). Possible values (case-insensitive): + * Microsoft.Keyvault. + * + * @param keySource the keySource value to set. + * @return the EncryptionV2 object itself. + */ + public EncryptionV2 withKeySource(EncryptionKeySource keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the keyVaultProperties property: Key Vault input properties for encryption. + * + * @return the keyVaultProperties value. + */ + public EncryptionV2KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Key Vault input properties for encryption. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionV2 object itself. + */ + public EncryptionV2 withKeyVaultProperties(EncryptionV2KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keySource() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property keySource in model EncryptionV2")); + } + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionV2KeyVaultProperties.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionV2KeyVaultProperties.java new file mode 100644 index 0000000000000..adeee1991e46b --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/EncryptionV2KeyVaultProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Key Vault input properties for encryption. */ +@Fluent +public final class EncryptionV2KeyVaultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionV2KeyVaultProperties.class); + + /* + * The Uri of KeyVault. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /* + * The name of KeyVault key. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /* + * The version of KeyVault key. + */ + @JsonProperty(value = "keyVersion", required = true) + private String keyVersion; + + /** + * Get the keyVaultUri property: The Uri of KeyVault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the EncryptionV2KeyVaultProperties object itself. + */ + public EncryptionV2KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the keyName property: The name of KeyVault key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of KeyVault key. + * + * @param keyName the keyName value to set. + * @return the EncryptionV2KeyVaultProperties object itself. + */ + public EncryptionV2KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The version of KeyVault key. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The version of KeyVault key. + * + * @param keyVersion the keyVersion value to set. + * @return the EncryptionV2KeyVaultProperties object itself. + */ + public EncryptionV2KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultUri in model EncryptionV2KeyVaultProperties")); + } + if (keyName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyName in model EncryptionV2KeyVaultProperties")); + } + if (keyVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVersion in model EncryptionV2KeyVaultProperties")); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/GroupIdInformation.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/GroupIdInformation.java new file mode 100644 index 0000000000000..1fe64a4b0e063 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/GroupIdInformation.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.resourcemanager.databricks.fluent.models.GroupIdInformationInner; + +/** An immutable client-side representation of GroupIdInformation. */ +public interface GroupIdInformation { + /** + * 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 properties property: The group id properties. + * + * @return the properties value. + */ + GroupIdInformationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.databricks.fluent.models.GroupIdInformationInner object. + * + * @return the inner object. + */ + GroupIdInformationInner innerModel(); +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/GroupIdInformationProperties.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/GroupIdInformationProperties.java new file mode 100644 index 0000000000000..90c51f96d159d --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/GroupIdInformationProperties.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties for a group information object. */ +@Fluent +public final class GroupIdInformationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupIdInformationProperties.class); + + /* + * The group id + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The required members for a specific group id + */ + @JsonProperty(value = "requiredMembers") + private List requiredMembers; + + /* + * The required DNS zones for a specific group id + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The group id. + * + * @param groupId the groupId value to set. + * @return the GroupIdInformationProperties object itself. + */ + public GroupIdInformationProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: The required members for a specific group id. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: The required members for a specific group id. + * + * @param requiredMembers the requiredMembers value to set. + * @return the GroupIdInformationProperties object itself. + */ + public GroupIdInformationProperties withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the requiredZoneNames property: The required DNS zones for a specific group id. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The required DNS zones for a specific group id. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the GroupIdInformationProperties object itself. + */ + public GroupIdInformationProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpoint.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..faa81fa335d26 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The private endpoint property of a private endpoint connection. */ +@Immutable +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * The resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The resource identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnection.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..b0f3d0123b0e2 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnection.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.databricks.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 properties property: The private endpoint connection properties. + * + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.databricks.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + 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, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The private endpoint connection properties.. + * + * @param properties The private endpoint connection properties. + * @return the next definition stage. + */ + WithCreate withProperties(PrivateEndpointConnectionProperties properties); + } + /** + * 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 { + /** + * 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); + } + } + /** + * 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/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionProperties.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..badb0026c8149 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /* + * Private endpoint + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Private endpoint connection state + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * Provisioning state of the private endpoint connection. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: Private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Private endpoint. + * + * @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: Private endpoint connection state. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Private endpoint connection state. + * + * @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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionProvisioningState.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..0bf9912c3a518 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** @return known PrivateEndpointConnectionProvisioningState values. */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnections.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..958f16788acc3 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnections.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List private endpoint connections of the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private link connections. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection properties for a workspace. + */ + PrivateEndpointConnection get(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection properties for a workspace. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * Remove private endpoint connection with the specified name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection properties for a workspace. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get a private endpoint connection properties for a workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 endpoint connection properties for a workspace. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Remove private endpoint connection with the specified name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Remove private endpoint connection with the specified name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionsList.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionsList.java new file mode 100644 index 0000000000000..c0a797d32cc88 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateEndpointConnectionsList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databricks.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private link connections. */ +@Fluent +public final class PrivateEndpointConnectionsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsList.class); + + /* + * The list of returned private endpoint connection. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of endpoint connections. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of returned private endpoint connection. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of returned private endpoint connection. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionsList object itself. + */ + public PrivateEndpointConnectionsList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of endpoint connections. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of endpoint connections. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionsList object itself. + */ + public PrivateEndpointConnectionsList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkResources.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..2ab6f257b26d0 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkResources.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * List private link resources for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException thrown if the request is rejected by + * server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the available private link resources for a workspace. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.databricks.models.ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + GroupIdInformation get(String resourceGroupName, String workspaceName, String groupId); + + /** + * Get the specified private link resource for the given group id (sub-resource). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param groupId 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.resourcemanager.databricks.models.ErrorInfoException 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 link resource for the given group id (sub-resource). + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String groupId, Context context); +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkResourcesList.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkResourcesList.java new file mode 100644 index 0000000000000..d94b451e380fc --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkResourcesList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.databricks.fluent.models.GroupIdInformationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The available private link resources for a workspace. */ +@Fluent +public final class PrivateLinkResourcesList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesList.class); + + /* + * The list of available private link resources for a workspace + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of private link resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of available private link resources for a workspace. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of available private link resources for a workspace. + * + * @param value the value value to set. + * @return the PrivateLinkResourcesList object itself. + */ + public PrivateLinkResourcesList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of private link resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of private link resources. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkResourcesList object itself. + */ + public PrivateLinkResourcesList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkServiceConnectionState.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..3b709eace287b --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The current state of a private endpoint connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * The status of a private endpoint connection + */ + @JsonProperty(value = "status", required = true) + private PrivateLinkServiceConnectionStatus status; + + /* + * The description for the current state of a private endpoint connection + */ + @JsonProperty(value = "description") + private String description; + + /* + * Actions required for a private endpoint connection + */ + @JsonProperty(value = "actionRequired") + private String actionRequired; + + /** + * Get the status property: The status of a private endpoint connection. + * + * @return the status value. + */ + public PrivateLinkServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: The status of a private endpoint connection. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateLinkServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The description for the current state of a private endpoint connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description for the current state of a private endpoint connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionRequired property: Actions required for a private endpoint connection. + * + * @return the actionRequired value. + */ + public String actionRequired() { + return this.actionRequired; + } + + /** + * Set the actionRequired property: Actions required for a private endpoint connection. + * + * @param actionRequired the actionRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { + this.actionRequired = actionRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model PrivateLinkServiceConnectionState")); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkServiceConnectionStatus.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkServiceConnectionStatus.java new file mode 100644 index 0000000000000..2a1df07b8d4d9 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PrivateLinkServiceConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateLinkServiceConnectionStatus. */ +public final class PrivateLinkServiceConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateLinkServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateLinkServiceConnectionStatus. + */ + @JsonCreator + public static PrivateLinkServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateLinkServiceConnectionStatus.class); + } + + /** @return known PrivateLinkServiceConnectionStatus values. */ + public static Collection values() { + return values(PrivateLinkServiceConnectionStatus.class); + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PublicNetworkAccess.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..d4fcc8cec355f --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/PublicNetworkAccess.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccess. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** @return known PublicNetworkAccess values. */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/RequiredNsgRules.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/RequiredNsgRules.java new file mode 100644 index 0000000000000..f515dce5f9811 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/RequiredNsgRules.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RequiredNsgRules. */ +public final class RequiredNsgRules extends ExpandableStringEnum { + /** Static value AllRules for RequiredNsgRules. */ + public static final RequiredNsgRules ALL_RULES = fromString("AllRules"); + + /** Static value NoAzureDatabricksRules for RequiredNsgRules. */ + public static final RequiredNsgRules NO_AZURE_DATABRICKS_RULES = fromString("NoAzureDatabricksRules"); + + /** Static value NoAzureServiceRules for RequiredNsgRules. */ + public static final RequiredNsgRules NO_AZURE_SERVICE_RULES = fromString("NoAzureServiceRules"); + + /** + * Creates or finds a RequiredNsgRules from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequiredNsgRules. + */ + @JsonCreator + public static RequiredNsgRules fromString(String name) { + return fromString(name, RequiredNsgRules.class); + } + + /** @return known RequiredNsgRules values. */ + public static Collection values() { + return values(RequiredNsgRules.class); + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/Workspace.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/Workspace.java index ea0cb41ca14be..10fbdaf9864f9 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/Workspace.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/Workspace.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.databricks.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.databricks.fluent.models.WorkspaceInner; import java.time.OffsetDateTime; @@ -55,6 +56,13 @@ public interface Workspace { */ Sku sku(); + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the managedResourceGroupId property: The managed resource group Id. * @@ -135,6 +143,37 @@ public interface Workspace { */ ManagedIdentityConfiguration storageAccountIdentity(); + /** + * Gets the encryption property: Encryption properties for databricks workspace. + * + * @return the encryption value. + */ + WorkspacePropertiesEncryption encryption(); + + /** + * Gets the privateEndpointConnections property: Private endpoint connections created on the workspace. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: The network access type for accessing workspace. Set value to disabled to + * access workspace only via private link. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the requiredNsgRules property: Gets or sets a value indicating whether data plane (clusters) to control + * plane communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. + * 'NoAzureServiceRules' value is for internal use only. + * + * @return the requiredNsgRules value. + */ + RequiredNsgRules requiredNsgRules(); + /** * Gets the region of the resource. * @@ -219,7 +258,10 @@ interface WithCreate DefinitionStages.WithAuthorizations, DefinitionStages.WithCreatedBy, DefinitionStages.WithUpdatedBy, - DefinitionStages.WithStorageAccountIdentity { + DefinitionStages.WithStorageAccountIdentity, + DefinitionStages.WithEncryption, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithRequiredNsgRules { /** * Executes the create request. * @@ -318,6 +360,42 @@ interface WithStorageAccountIdentity { */ WithCreate withStorageAccountIdentity(ManagedIdentityConfiguration storageAccountIdentity); } + /** The stage of the Workspace definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Encryption properties for databricks workspace. + * + * @param encryption Encryption properties for databricks workspace. + * @return the next definition stage. + */ + WithCreate withEncryption(WorkspacePropertiesEncryption encryption); + } + /** The stage of the Workspace definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: The network access type for accessing workspace. Set value to + * disabled to access workspace only via private link.. + * + * @param publicNetworkAccess The network access type for accessing workspace. Set value to disabled to + * access workspace only via private link. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Workspace definition allowing to specify requiredNsgRules. */ + interface WithRequiredNsgRules { + /** + * Specifies the requiredNsgRules property: Gets or sets a value indicating whether data plane (clusters) to + * control plane communication happen over private endpoint. Supported values are 'AllRules' and + * 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only.. + * + * @param requiredNsgRules Gets or sets a value indicating whether data plane (clusters) to control plane + * communication happen over private endpoint. Supported values are 'AllRules' and + * 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only. + * @return the next definition stage. + */ + WithCreate withRequiredNsgRules(RequiredNsgRules requiredNsgRules); + } } /** * Begins update for the Workspace resource. diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspaceCustomObjectParameter.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspaceCustomObjectParameter.java new file mode 100644 index 0000000000000..d0fd1a2fa9223 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspaceCustomObjectParameter.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The value which should be used for this field. */ +@Fluent +public final class WorkspaceCustomObjectParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceCustomObjectParameter.class); + + /* + * The type of variable that this is + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private CustomParameterType type; + + /* + * The value which should be used for this field. + */ + @JsonProperty(value = "value", required = true) + private Object value; + + /** + * Get the type property: The type of variable that this is. + * + * @return the type value. + */ + public CustomParameterType type() { + return this.type; + } + + /** + * Get the value property: The value which should be used for this field. + * + * @return the value value. + */ + public Object value() { + return this.value; + } + + /** + * Set the value property: The value which should be used for this field. + * + * @param value the value value to set. + * @return the WorkspaceCustomObjectParameter object itself. + */ + public WorkspaceCustomObjectParameter withValue(Object value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model WorkspaceCustomObjectParameter")); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspaceCustomParameters.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspaceCustomParameters.java index eb32d2a892204..d9f3b65efa281 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspaceCustomParameters.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspaceCustomParameters.java @@ -46,6 +46,33 @@ public final class WorkspaceCustomParameters { @JsonProperty(value = "enableNoPublicIp") private WorkspaceCustomBooleanParameter enableNoPublicIp; + /* + * Name of the outbound Load Balancer Backend Pool for Secure Cluster + * Connectivity (No Public IP). + */ + @JsonProperty(value = "loadBalancerBackendPoolName") + private WorkspaceCustomStringParameter loadBalancerBackendPoolName; + + /* + * Resource URI of Outbound Load balancer for Secure Cluster Connectivity + * (No Public IP) workspace. + */ + @JsonProperty(value = "loadBalancerId") + private WorkspaceCustomStringParameter loadBalancerId; + + /* + * Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) + * workspace subnets. + */ + @JsonProperty(value = "natGatewayName") + private WorkspaceCustomStringParameter natGatewayName; + + /* + * Name of the Public IP for No Public IP workspace with managed vNet. + */ + @JsonProperty(value = "publicIpName") + private WorkspaceCustomStringParameter publicIpName; + /* * Prepare the workspace for encryption. Enables the Managed Identity for * managed storage account. @@ -68,6 +95,33 @@ public final class WorkspaceCustomParameters { @JsonProperty(value = "requireInfrastructureEncryption") private WorkspaceCustomBooleanParameter requireInfrastructureEncryption; + /* + * Default DBFS storage account name. + */ + @JsonProperty(value = "storageAccountName") + private WorkspaceCustomStringParameter storageAccountName; + + /* + * Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer + * https://aka.ms/storageskus for valid inputs. + */ + @JsonProperty(value = "storageAccountSkuName") + private WorkspaceCustomStringParameter storageAccountSkuName; + + /* + * Address prefix for Managed virtual network. Default value for this input + * is 10.139. + */ + @JsonProperty(value = "vnetAddressPrefix") + private WorkspaceCustomStringParameter vnetAddressPrefix; + + /* + * Tags applied to resources under Managed resource group. These can be + * updated by updating tags at workspace level. + */ + @JsonProperty(value = "resourceTags", access = JsonProperty.Access.WRITE_ONLY) + private WorkspaceCustomObjectParameter resourceTags; + /** * Get the amlWorkspaceId property: The ID of a Azure Machine Learning workspace to link with Databricks workspace. * @@ -171,6 +225,93 @@ public WorkspaceCustomParameters withEnableNoPublicIp(WorkspaceCustomBooleanPara return this; } + /** + * Get the loadBalancerBackendPoolName property: Name of the outbound Load Balancer Backend Pool for Secure Cluster + * Connectivity (No Public IP). + * + * @return the loadBalancerBackendPoolName value. + */ + public WorkspaceCustomStringParameter loadBalancerBackendPoolName() { + return this.loadBalancerBackendPoolName; + } + + /** + * Set the loadBalancerBackendPoolName property: Name of the outbound Load Balancer Backend Pool for Secure Cluster + * Connectivity (No Public IP). + * + * @param loadBalancerBackendPoolName the loadBalancerBackendPoolName value to set. + * @return the WorkspaceCustomParameters object itself. + */ + public WorkspaceCustomParameters withLoadBalancerBackendPoolName( + WorkspaceCustomStringParameter loadBalancerBackendPoolName) { + this.loadBalancerBackendPoolName = loadBalancerBackendPoolName; + return this; + } + + /** + * Get the loadBalancerId property: Resource URI of Outbound Load balancer for Secure Cluster Connectivity (No + * Public IP) workspace. + * + * @return the loadBalancerId value. + */ + public WorkspaceCustomStringParameter loadBalancerId() { + return this.loadBalancerId; + } + + /** + * Set the loadBalancerId property: Resource URI of Outbound Load balancer for Secure Cluster Connectivity (No + * Public IP) workspace. + * + * @param loadBalancerId the loadBalancerId value to set. + * @return the WorkspaceCustomParameters object itself. + */ + public WorkspaceCustomParameters withLoadBalancerId(WorkspaceCustomStringParameter loadBalancerId) { + this.loadBalancerId = loadBalancerId; + return this; + } + + /** + * Get the natGatewayName property: Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) workspace + * subnets. + * + * @return the natGatewayName value. + */ + public WorkspaceCustomStringParameter natGatewayName() { + return this.natGatewayName; + } + + /** + * Set the natGatewayName property: Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) workspace + * subnets. + * + * @param natGatewayName the natGatewayName value to set. + * @return the WorkspaceCustomParameters object itself. + */ + public WorkspaceCustomParameters withNatGatewayName(WorkspaceCustomStringParameter natGatewayName) { + this.natGatewayName = natGatewayName; + return this; + } + + /** + * Get the publicIpName property: Name of the Public IP for No Public IP workspace with managed vNet. + * + * @return the publicIpName value. + */ + public WorkspaceCustomStringParameter publicIpName() { + return this.publicIpName; + } + + /** + * Set the publicIpName property: Name of the Public IP for No Public IP workspace with managed vNet. + * + * @param publicIpName the publicIpName value to set. + * @return the WorkspaceCustomParameters object itself. + */ + public WorkspaceCustomParameters withPublicIpName(WorkspaceCustomStringParameter publicIpName) { + this.publicIpName = publicIpName; + return this; + } + /** * Get the prepareEncryption property: Prepare the workspace for encryption. Enables the Managed Identity for * managed storage account. @@ -236,6 +377,80 @@ public WorkspaceCustomParameters withRequireInfrastructureEncryption( return this; } + /** + * Get the storageAccountName property: Default DBFS storage account name. + * + * @return the storageAccountName value. + */ + public WorkspaceCustomStringParameter storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: Default DBFS storage account name. + * + * @param storageAccountName the storageAccountName value to set. + * @return the WorkspaceCustomParameters object itself. + */ + public WorkspaceCustomParameters withStorageAccountName(WorkspaceCustomStringParameter storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageAccountSkuName property: Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer + * https://aka.ms/storageskus for valid inputs. + * + * @return the storageAccountSkuName value. + */ + public WorkspaceCustomStringParameter storageAccountSkuName() { + return this.storageAccountSkuName; + } + + /** + * Set the storageAccountSkuName property: Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer + * https://aka.ms/storageskus for valid inputs. + * + * @param storageAccountSkuName the storageAccountSkuName value to set. + * @return the WorkspaceCustomParameters object itself. + */ + public WorkspaceCustomParameters withStorageAccountSkuName(WorkspaceCustomStringParameter storageAccountSkuName) { + this.storageAccountSkuName = storageAccountSkuName; + return this; + } + + /** + * Get the vnetAddressPrefix property: Address prefix for Managed virtual network. Default value for this input is + * 10.139. + * + * @return the vnetAddressPrefix value. + */ + public WorkspaceCustomStringParameter vnetAddressPrefix() { + return this.vnetAddressPrefix; + } + + /** + * Set the vnetAddressPrefix property: Address prefix for Managed virtual network. Default value for this input is + * 10.139. + * + * @param vnetAddressPrefix the vnetAddressPrefix value to set. + * @return the WorkspaceCustomParameters object itself. + */ + public WorkspaceCustomParameters withVnetAddressPrefix(WorkspaceCustomStringParameter vnetAddressPrefix) { + this.vnetAddressPrefix = vnetAddressPrefix; + return this; + } + + /** + * Get the resourceTags property: Tags applied to resources under Managed resource group. These can be updated by + * updating tags at workspace level. + * + * @return the resourceTags value. + */ + public WorkspaceCustomObjectParameter resourceTags() { + return this.resourceTags; + } + /** * Validates the instance. * @@ -257,6 +472,18 @@ public void validate() { if (enableNoPublicIp() != null) { enableNoPublicIp().validate(); } + if (loadBalancerBackendPoolName() != null) { + loadBalancerBackendPoolName().validate(); + } + if (loadBalancerId() != null) { + loadBalancerId().validate(); + } + if (natGatewayName() != null) { + natGatewayName().validate(); + } + if (publicIpName() != null) { + publicIpName().validate(); + } if (prepareEncryption() != null) { prepareEncryption().validate(); } @@ -266,5 +493,17 @@ public void validate() { if (requireInfrastructureEncryption() != null) { requireInfrastructureEncryption().validate(); } + if (storageAccountName() != null) { + storageAccountName().validate(); + } + if (storageAccountSkuName() != null) { + storageAccountSkuName().validate(); + } + if (vnetAddressPrefix() != null) { + vnetAddressPrefix().validate(); + } + if (resourceTags() != null) { + resourceTags().validate(); + } } } diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspacePropertiesEncryption.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspacePropertiesEncryption.java new file mode 100644 index 0000000000000..046bdd2483cb0 --- /dev/null +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/WorkspacePropertiesEncryption.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.databricks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption properties for databricks workspace. */ +@Fluent +public final class WorkspacePropertiesEncryption { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspacePropertiesEncryption.class); + + /* + * Encryption entities definition for the workspace. + */ + @JsonProperty(value = "entities", required = true) + private EncryptionEntitiesDefinition entities; + + /** + * Get the entities property: Encryption entities definition for the workspace. + * + * @return the entities value. + */ + public EncryptionEntitiesDefinition entities() { + return this.entities; + } + + /** + * Set the entities property: Encryption entities definition for the workspace. + * + * @param entities the entities value to set. + * @return the WorkspacePropertiesEncryption object itself. + */ + public WorkspacePropertiesEncryption withEntities(EncryptionEntitiesDefinition entities) { + this.entities = entities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (entities() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property entities in model WorkspacePropertiesEncryption")); + } else { + entities().validate(); + } + } +} diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/package-info.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/package-info.java index 887a47b009167..134e8eac99c77 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/package-info.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for DatabricksClient. ARM Databricks. */ +/** + * Package containing the data models for AzureDatabricksManagementClient. The Microsoft Azure management APIs allow end + * users to operate on Azure Databricks Workspace resources. + */ package com.azure.resourcemanager.databricks.models; diff --git a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/package-info.java b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/package-info.java index 76a7bcd05e63b..d4fb89fe3cb2e 100644 --- a/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/package-info.java +++ b/sdk/databricks/azure-resourcemanager-databricks/src/main/java/com/azure/resourcemanager/databricks/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for DatabricksClient. ARM Databricks. */ +/** + * Package containing the classes for AzureDatabricksManagementClient. The Microsoft Azure management APIs allow end + * users to operate on Azure Databricks Workspace resources. + */ package com.azure.resourcemanager.databricks;