diff --git a/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md b/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md index e18101c073fa..b8543bd9bd3a 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md +++ b/sdk/kusto/azure-resourcemanager-kusto/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2021-09-03) +- Azure Resource Manager Kusto client library for Java. This package contains Microsoft Azure SDK for Kusto Management SDK. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2021-08-27. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.2 (2021-04-19) diff --git a/sdk/kusto/azure-resourcemanager-kusto/README.md b/sdk/kusto/azure-resourcemanager-kusto/README.md index a8800bc80ae7..0cfd48a43309 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/README.md +++ b/sdk/kusto/azure-resourcemanager-kusto/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Kusto client library for Java. -This package contains Microsoft Azure SDK for Kusto Management SDK. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2021-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 Kusto Management SDK. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2021-08-27. 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-kusto - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -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/kusto/azure-resourcemanager-kusto/pom.xml b/sdk/kusto/azure-resourcemanager-kusto/pom.xml index cbf1d9cd9e78..b83e620c42a0 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/pom.xml +++ b/sdk/kusto/azure-resourcemanager-kusto/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-kusto - 1.0.0-beta.3 - jar + com.azure.resourcemanager + azure-resourcemanager-kusto + 1.0.0-beta.3 + jar - Microsoft Azure SDK for Kusto Management - This package contains Microsoft Azure SDK for Kusto Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2021-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for Kusto Management + This package contains Microsoft Azure SDK for Kusto Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. Package tag package-2021-08-27. + 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.19.0 - - - com.azure - azure-core-management - 1.4.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.19.0 + + + com.azure + azure-core-management + 1.4.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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java index 3530b09c35d3..5e437b84e6a2 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/KustoManager.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,6 +16,7 @@ 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; @@ -28,8 +28,11 @@ import com.azure.resourcemanager.kusto.implementation.DatabasePrincipalAssignmentsImpl; import com.azure.resourcemanager.kusto.implementation.DatabasesImpl; import com.azure.resourcemanager.kusto.implementation.KustoManagementClientBuilder; +import com.azure.resourcemanager.kusto.implementation.ManagedPrivateEndpointsImpl; import com.azure.resourcemanager.kusto.implementation.OperationsImpl; import com.azure.resourcemanager.kusto.implementation.OperationsResultsImpl; +import com.azure.resourcemanager.kusto.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.kusto.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.kusto.implementation.ScriptsImpl; import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurations; import com.azure.resourcemanager.kusto.models.ClusterPrincipalAssignments; @@ -37,8 +40,11 @@ import com.azure.resourcemanager.kusto.models.DataConnections; import com.azure.resourcemanager.kusto.models.DatabasePrincipalAssignments; import com.azure.resourcemanager.kusto.models.Databases; +import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpoints; import com.azure.resourcemanager.kusto.models.Operations; import com.azure.resourcemanager.kusto.models.OperationsResults; +import com.azure.resourcemanager.kusto.models.PrivateEndpointConnections; +import com.azure.resourcemanager.kusto.models.PrivateLinkResources; import com.azure.resourcemanager.kusto.models.Scripts; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -58,11 +64,17 @@ public final class KustoManager { private Databases databases; + private AttachedDatabaseConfigurations attachedDatabaseConfigurations; + + private ManagedPrivateEndpoints managedPrivateEndpoints; + private DatabasePrincipalAssignments databasePrincipalAssignments; private Scripts scripts; - private AttachedDatabaseConfigurations attachedDatabaseConfigurations; + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; private DataConnections dataConnections; @@ -113,6 +125,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; @@ -152,6 +165,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. * @@ -194,7 +218,7 @@ public KustoManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.kusto") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -208,6 +232,9 @@ public KustoManager authenticate(TokenCredential credential, AzureProfile profil userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -217,10 +244,7 @@ public KustoManager authenticate(TokenCredential credential, AzureProfile profil 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)); @@ -258,6 +282,24 @@ public Databases databases() { return databases; } + /** @return Resource collection API of AttachedDatabaseConfigurations. */ + public AttachedDatabaseConfigurations attachedDatabaseConfigurations() { + if (this.attachedDatabaseConfigurations == null) { + this.attachedDatabaseConfigurations = + new AttachedDatabaseConfigurationsImpl(clientObject.getAttachedDatabaseConfigurations(), this); + } + return attachedDatabaseConfigurations; + } + + /** @return Resource collection API of ManagedPrivateEndpoints. */ + public ManagedPrivateEndpoints managedPrivateEndpoints() { + if (this.managedPrivateEndpoints == null) { + this.managedPrivateEndpoints = + new ManagedPrivateEndpointsImpl(clientObject.getManagedPrivateEndpoints(), this); + } + return managedPrivateEndpoints; + } + /** @return Resource collection API of DatabasePrincipalAssignments. */ public DatabasePrincipalAssignments databasePrincipalAssignments() { if (this.databasePrincipalAssignments == null) { @@ -275,13 +317,21 @@ public Scripts scripts() { return scripts; } - /** @return Resource collection API of AttachedDatabaseConfigurations. */ - public AttachedDatabaseConfigurations attachedDatabaseConfigurations() { - if (this.attachedDatabaseConfigurations == null) { - this.attachedDatabaseConfigurations = - new AttachedDatabaseConfigurationsImpl(clientObject.getAttachedDatabaseConfigurations(), this); + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); } - return attachedDatabaseConfigurations; + return privateEndpointConnections; + } + + /** @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 DataConnections. */ diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/AttachedDatabaseConfigurationsClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/AttachedDatabaseConfigurationsClient.java index dc68ba727a51..c09df4dcf14e 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/AttachedDatabaseConfigurationsClient.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/AttachedDatabaseConfigurationsClient.java @@ -12,9 +12,45 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurationsCheckNameRequest; /** An instance of this class provides access to all the operations defined in AttachedDatabaseConfigurationsClient. */ public interface AttachedDatabaseConfigurationsClient { + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability( + String resourceGroupName, String clusterName, AttachedDatabaseConfigurationsCheckNameRequest resourceName); + + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + AttachedDatabaseConfigurationsCheckNameRequest resourceName, + Context context); + /** * Returns the list of attached database configurations of the given Kusto cluster. * diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClustersClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClustersClient.java index 0b7fa87ba350..5a613e887909 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClustersClient.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ClustersClient.java @@ -17,6 +17,7 @@ import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; +import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner; import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; import com.azure.resourcemanager.kusto.models.ClusterCheckNameRequest; import com.azure.resourcemanager.kusto.models.ClusterUpdate; @@ -669,6 +670,35 @@ Response checkNameAvailabilityWithResponse( PagedIterable listSkusByResource( String resourceGroupName, String clusterName, Context context); + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String clusterName); + + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String clusterName, Context context); + /** * Returns a list of language extensions that can run within KQL queries. * diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasesClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasesClient.java index 4c040687b5b4..f9dd55ea45b7 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasesClient.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/DatabasesClient.java @@ -21,7 +21,7 @@ /** An instance of this class provides access to all the operations defined in DatabasesClient. */ public interface DatabasesClient { /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. @@ -36,7 +36,7 @@ CheckNameResultInner checkNameAvailability( String resourceGroupName, String clusterName, CheckNameRequest resourceName); /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/KustoManagementClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/KustoManagementClient.java index a663376015b2..dcb024a298d2 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/KustoManagementClient.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/KustoManagementClient.java @@ -66,6 +66,20 @@ public interface KustoManagementClient { */ DatabasesClient getDatabases(); + /** + * Gets the AttachedDatabaseConfigurationsClient object to access its operations. + * + * @return the AttachedDatabaseConfigurationsClient object. + */ + AttachedDatabaseConfigurationsClient getAttachedDatabaseConfigurations(); + + /** + * Gets the ManagedPrivateEndpointsClient object to access its operations. + * + * @return the ManagedPrivateEndpointsClient object. + */ + ManagedPrivateEndpointsClient getManagedPrivateEndpoints(); + /** * Gets the DatabasePrincipalAssignmentsClient object to access its operations. * @@ -81,11 +95,18 @@ public interface KustoManagementClient { ScriptsClient getScripts(); /** - * Gets the AttachedDatabaseConfigurationsClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the AttachedDatabaseConfigurationsClient object. + * @return the PrivateEndpointConnectionsClient object. */ - AttachedDatabaseConfigurationsClient getAttachedDatabaseConfigurations(); + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); /** * Gets the DataConnectionsClient object to access its operations. diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ManagedPrivateEndpointsClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ManagedPrivateEndpointsClient.java new file mode 100644 index 000000000000..51870be55f40 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/ManagedPrivateEndpointsClient.java @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner; +import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpointsCheckNameRequest; + +/** An instance of this class provides access to all the operations defined in ManagedPrivateEndpointsClient. */ +public interface ManagedPrivateEndpointsClient { + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameResultInner checkNameAvailability( + String resourceGroupName, String clusterName, ManagedPrivateEndpointsCheckNameRequest resourceName); + + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + ManagedPrivateEndpointsCheckNameRequest resourceName, + Context context); + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointInner get(String resourceGroupName, String clusterName, String managedPrivateEndpointName); + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context); + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedPrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters); + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedPrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context); + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointInner createOrUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters); + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointInner createOrUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context); + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedPrivateEndpointInner> beginUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters); + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedPrivateEndpointInner> beginUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context); + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointInner update( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters); + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedPrivateEndpointInner update( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context); + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String managedPrivateEndpointName); + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context); + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String managedPrivateEndpointName); + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/PrivateEndpointConnectionsClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..9d428aebd388 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String clusterName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/PrivateLinkResourcesClient.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..6d388d7f47f6 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String clusterName, String privateLinkResourceName); + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String privateLinkResourceName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterInner.java index 8419cb381560..3cab306b80fc 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterInner.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ClusterInner.java @@ -7,14 +7,18 @@ 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.kusto.models.AcceptedAudiences; import com.azure.resourcemanager.kusto.models.AzureSku; +import com.azure.resourcemanager.kusto.models.ClusterNetworkAccessFlag; import com.azure.resourcemanager.kusto.models.EngineType; import com.azure.resourcemanager.kusto.models.Identity; import com.azure.resourcemanager.kusto.models.KeyVaultProperties; import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; import com.azure.resourcemanager.kusto.models.OptimizedAutoscale; import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.azure.resourcemanager.kusto.models.PublicNetworkAccess; import com.azure.resourcemanager.kusto.models.State; import com.azure.resourcemanager.kusto.models.TrustedExternalTenant; import com.azure.resourcemanager.kusto.models.VirtualNetworkConfiguration; @@ -35,6 +39,12 @@ public class ClusterInner extends Resource { @JsonProperty(value = "sku", required = true) private AzureSku sku; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /* * The availability zones of the cluster. */ @@ -137,12 +147,52 @@ public class ClusterInner extends Resource { @JsonProperty(value = "properties.enableDoubleEncryption") private Boolean enableDoubleEncryption; + /* + * Public network access to the cluster is enabled by default. When + * disabled, only private endpoint connection to the cluster is allowed + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * The list of ips in the format of CIDR allowed to connect to the cluster. + */ + @JsonProperty(value = "properties.allowedIpRangeList") + private List allowedIpRangeList; + /* * The engine type */ @JsonProperty(value = "properties.engineType") private EngineType engineType; + /* + * The cluster's accepted audiences. + */ + @JsonProperty(value = "properties.acceptedAudiences") + private List acceptedAudiences; + + /* + * A boolean value that indicates if the cluster could be automatically + * stopped (due to lack of data or no activity for many days). + */ + @JsonProperty(value = "properties.enableAutoStop") + private Boolean enableAutoStop; + + /* + * Whether or not to restrict outbound network access. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "properties.restrictOutboundNetworkAccess") + private ClusterNetworkAccessFlag restrictOutboundNetworkAccess; + + /* + * List of allowed FQDNs(Fully Qualified Domain Name) for egress from + * Cluster. + */ + @JsonProperty(value = "properties.allowedFqdnList") + private List allowedFqdnList; + /** * Get the sku property: The SKU of the cluster. * @@ -163,6 +213,15 @@ public ClusterInner withSku(AzureSku sku) { return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the zones property: The availability zones of the cluster. * @@ -426,6 +485,48 @@ public ClusterInner withEnableDoubleEncryption(Boolean enableDoubleEncryption) { return this; } + /** + * Get the publicNetworkAccess property: Public network access to the cluster is enabled by default. When disabled, + * only private endpoint connection to the cluster is allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Public network access to the cluster is enabled by default. When disabled, + * only private endpoint connection to the cluster is allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the allowedIpRangeList property: The list of ips in the format of CIDR allowed to connect to the cluster. + * + * @return the allowedIpRangeList value. + */ + public List allowedIpRangeList() { + return this.allowedIpRangeList; + } + + /** + * Set the allowedIpRangeList property: The list of ips in the format of CIDR allowed to connect to the cluster. + * + * @param allowedIpRangeList the allowedIpRangeList value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAllowedIpRangeList(List allowedIpRangeList) { + this.allowedIpRangeList = allowedIpRangeList; + return this; + } + /** * Get the engineType property: The engine type. * @@ -446,6 +547,90 @@ public ClusterInner withEngineType(EngineType engineType) { return this; } + /** + * Get the acceptedAudiences property: The cluster's accepted audiences. + * + * @return the acceptedAudiences value. + */ + public List acceptedAudiences() { + return this.acceptedAudiences; + } + + /** + * Set the acceptedAudiences property: The cluster's accepted audiences. + * + * @param acceptedAudiences the acceptedAudiences value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAcceptedAudiences(List acceptedAudiences) { + this.acceptedAudiences = acceptedAudiences; + return this; + } + + /** + * Get the enableAutoStop property: A boolean value that indicates if the cluster could be automatically stopped + * (due to lack of data or no activity for many days). + * + * @return the enableAutoStop value. + */ + public Boolean enableAutoStop() { + return this.enableAutoStop; + } + + /** + * Set the enableAutoStop property: A boolean value that indicates if the cluster could be automatically stopped + * (due to lack of data or no activity for many days). + * + * @param enableAutoStop the enableAutoStop value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEnableAutoStop(Boolean enableAutoStop) { + this.enableAutoStop = enableAutoStop; + return this; + } + + /** + * Get the restrictOutboundNetworkAccess property: Whether or not to restrict outbound network access. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the restrictOutboundNetworkAccess value. + */ + public ClusterNetworkAccessFlag restrictOutboundNetworkAccess() { + return this.restrictOutboundNetworkAccess; + } + + /** + * Set the restrictOutboundNetworkAccess property: Whether or not to restrict outbound network access. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param restrictOutboundNetworkAccess the restrictOutboundNetworkAccess value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withRestrictOutboundNetworkAccess(ClusterNetworkAccessFlag restrictOutboundNetworkAccess) { + this.restrictOutboundNetworkAccess = restrictOutboundNetworkAccess; + return this; + } + + /** + * Get the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + * + * @return the allowedFqdnList value. + */ + public List allowedFqdnList() { + return this.allowedFqdnList; + } + + /** + * Set the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + * + * @param allowedFqdnList the allowedFqdnList value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withAllowedFqdnList(List allowedFqdnList) { + this.allowedFqdnList = allowedFqdnList; + return this; + } + /** {@inheritDoc} */ @Override public ClusterInner withLocation(String location) { @@ -491,5 +676,8 @@ public void validate() { if (languageExtensions() != null) { languageExtensions().validate(); } + if (acceptedAudiences() != null) { + acceptedAudiences().forEach(e -> e.validate()); + } } } diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ManagedPrivateEndpointInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ManagedPrivateEndpointInner.java new file mode 100644 index 000000000000..8fe2c1080c54 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/ManagedPrivateEndpointInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Class representing a managed private endpoint. */ +@JsonFlatten +@Fluent +public class ManagedPrivateEndpointInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedPrivateEndpointInner.class); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The ARM resource ID of the resource for which the managed private + * endpoint is created. + */ + @JsonProperty(value = "properties.privateLinkResourceId") + private String privateLinkResourceId; + + /* + * The region of the resource to which the managed private endpoint is + * created. + */ + @JsonProperty(value = "properties.privateLinkResourceRegion") + private String privateLinkResourceRegion; + + /* + * The groupId in which the managed private endpoint is created. + */ + @JsonProperty(value = "properties.groupId") + private String groupId; + + /* + * The user request message. + */ + @JsonProperty(value = "properties.requestMessage") + private String requestMessage; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateLinkResourceId property: The ARM resource ID of the resource for which the managed private + * endpoint is created. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the privateLinkResourceId property: The ARM resource ID of the resource for which the managed private + * endpoint is created. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the ManagedPrivateEndpointInner object itself. + */ + public ManagedPrivateEndpointInner withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the privateLinkResourceRegion property: The region of the resource to which the managed private endpoint is + * created. + * + * @return the privateLinkResourceRegion value. + */ + public String privateLinkResourceRegion() { + return this.privateLinkResourceRegion; + } + + /** + * Set the privateLinkResourceRegion property: The region of the resource to which the managed private endpoint is + * created. + * + * @param privateLinkResourceRegion the privateLinkResourceRegion value to set. + * @return the ManagedPrivateEndpointInner object itself. + */ + public ManagedPrivateEndpointInner withPrivateLinkResourceRegion(String privateLinkResourceRegion) { + this.privateLinkResourceRegion = privateLinkResourceRegion; + return this; + } + + /** + * Get the groupId property: The groupId in which the managed private endpoint is created. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The groupId in which the managed private endpoint is created. + * + * @param groupId the groupId value to set. + * @return the ManagedPrivateEndpointInner object itself. + */ + public ManagedPrivateEndpointInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requestMessage property: The user request message. + * + * @return the requestMessage value. + */ + public String requestMessage() { + return this.requestMessage; + } + + /** + * Set the requestMessage property: The user request message. + * + * @param requestMessage the requestMessage value to set. + * @return the ManagedPrivateEndpointInner object itself. + */ + public ManagedPrivateEndpointInner withRequestMessage(String requestMessage) { + this.requestMessage = requestMessage; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OperationInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OperationInner.java index 5a7278a8f268..35a0e1104550 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OperationInner.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OperationInner.java @@ -16,7 +16,8 @@ public final class OperationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); /* - * This is of the format {provider}/{resource}/{operation}. + * The operation name. This is of the format + * {provider}/{resource}/{operation}. */ @JsonProperty(value = "name") private String name; @@ -40,7 +41,7 @@ public final class OperationInner { private Object properties; /** - * Get the name property: This is of the format {provider}/{resource}/{operation}. + * Get the name property: The operation name. This is of the format {provider}/{resource}/{operation}. * * @return the name value. */ @@ -49,7 +50,7 @@ public String name() { } /** - * Set the name property: This is of the format {provider}/{resource}/{operation}. + * Set the name property: The operation name. This is of the format {provider}/{resource}/{operation}. * * @param name the name value to set. * @return the OperationInner object itself. diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OutboundNetworkDependenciesEndpointInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OutboundNetworkDependenciesEndpointInner.java new file mode 100644 index 000000000000..cdb0c928cdc1 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/OutboundNetworkDependenciesEndpointInner.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.EndpointDependency; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Endpoints accessed for a common purpose that the Kusto Service Environment requires outbound network access to. */ +@JsonFlatten +@Fluent +public class OutboundNetworkDependenciesEndpointInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundNetworkDependenciesEndpointInner.class); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /* + * The type of service accessed by the Kusto Service Environment, e.g., + * Azure Storage, Azure SQL Database, and Azure Active Directory. + */ + @JsonProperty(value = "properties.category") + private String category; + + /* + * The endpoints that the Kusto Service Environment reaches the service at. + */ + @JsonProperty(value = "properties.endpoints") + private List endpoints; + + /* + * The provisioned state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the category property: The type of service accessed by the Kusto Service Environment, e.g., Azure Storage, + * Azure SQL Database, and Azure Active Directory. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The type of service accessed by the Kusto Service Environment, e.g., Azure Storage, + * Azure SQL Database, and Azure Active Directory. + * + * @param category the category value to set. + * @return the OutboundNetworkDependenciesEndpointInner object itself. + */ + public OutboundNetworkDependenciesEndpointInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the endpoints property: The endpoints that the Kusto Service Environment reaches the service at. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints that the Kusto Service Environment reaches the service at. + * + * @param endpoints the endpoints value to set. + * @return the OutboundNetworkDependenciesEndpointInner object itself. + */ + public OutboundNetworkDependenciesEndpointInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/PrivateEndpointConnectionInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..d830acf012b4 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.models.PrivateEndpointProperty; +import com.azure.resourcemanager.kusto.models.PrivateLinkServiceConnectionStateProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private endpoint connection. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Private endpoint which the connection belongs to. + */ + @JsonProperty(value = "properties.privateEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointProperty privateEndpoint; + + /* + * Connection State of the Private Endpoint Connection. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState; + + /* + * Group id of the private endpoint. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * Provisioning state of the private endpoint. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateEndpoint property: Private endpoint which the connection belongs to. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointProperty privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Get the privateLinkServiceConnectionState property: Connection State of the Private Endpoint Connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Connection State of the Private Endpoint Connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the groupId property: Group id of the private endpoint. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint. + * + * @return the provisioningState value. + */ + public String 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) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/PrivateLinkResourceInner.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..bbb641cd52e8 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@JsonFlatten +@Immutable +public class PrivateLinkResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource required zone names. + */ + @JsonProperty(value = "properties.requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource required zone names. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsClientImpl.java index 086f7f1cd11b..0eb819456e00 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsClientImpl.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -34,7 +35,9 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.kusto.fluent.AttachedDatabaseConfigurationsClient; import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurationListResult; +import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurationsCheckNameRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -71,6 +74,22 @@ public final class AttachedDatabaseConfigurationsClientImpl implements AttachedD @Host("{$host}") @ServiceInterface(name = "KustoManagementClien") private interface AttachedDatabaseConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/attachedDatabaseConfigurationCheckNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") AttachedDatabaseConfigurationsCheckNameRequest resourceName, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" @@ -136,6 +155,180 @@ Mono>> delete( Context context); } + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String clusterName, AttachedDatabaseConfigurationsCheckNameRequest resourceName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } else { + resourceName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String clusterName, + AttachedDatabaseConfigurationsCheckNameRequest resourceName, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } else { + resourceName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceName, + accept, + context); + } + + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, String clusterName, AttachedDatabaseConfigurationsCheckNameRequest resourceName) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability( + String resourceGroupName, String clusterName, AttachedDatabaseConfigurationsCheckNameRequest resourceName) { + return checkNameAvailabilityAsync(resourceGroupName, clusterName, resourceName).block(); + } + + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + AttachedDatabaseConfigurationsCheckNameRequest resourceName, + Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, resourceName, context).block(); + } + /** * Returns the list of attached database configurations of the given Kusto cluster. * diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsImpl.java index 19bbfb50864b..c9b4eafba5e3 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsImpl.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/AttachedDatabaseConfigurationsImpl.java @@ -11,8 +11,11 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.kusto.fluent.AttachedDatabaseConfigurationsClient; import com.azure.resourcemanager.kusto.fluent.models.AttachedDatabaseConfigurationInner; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfiguration; import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurations; +import com.azure.resourcemanager.kusto.models.AttachedDatabaseConfigurationsCheckNameRequest; +import com.azure.resourcemanager.kusto.models.CheckNameResult; import com.fasterxml.jackson.annotation.JsonIgnore; public final class AttachedDatabaseConfigurationsImpl implements AttachedDatabaseConfigurations { @@ -28,6 +31,37 @@ public AttachedDatabaseConfigurationsImpl( this.serviceManager = serviceManager; } + public CheckNameResult checkNameAvailability( + String resourceGroupName, String clusterName, AttachedDatabaseConfigurationsCheckNameRequest resourceName) { + CheckNameResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, clusterName, resourceName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + AttachedDatabaseConfigurationsCheckNameRequest resourceName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse(resourceGroupName, clusterName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterImpl.java index 2dcff23c77c5..46c8052bfe46 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterImpl.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClusterImpl.java @@ -6,11 +6,14 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.kusto.fluent.models.ClusterInner; import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; +import com.azure.resourcemanager.kusto.models.AcceptedAudiences; import com.azure.resourcemanager.kusto.models.AzureSku; import com.azure.resourcemanager.kusto.models.Cluster; +import com.azure.resourcemanager.kusto.models.ClusterNetworkAccessFlag; import com.azure.resourcemanager.kusto.models.ClusterUpdate; import com.azure.resourcemanager.kusto.models.DiagnoseVirtualNetworkResult; import com.azure.resourcemanager.kusto.models.EngineType; @@ -21,6 +24,7 @@ import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; import com.azure.resourcemanager.kusto.models.OptimizedAutoscale; import com.azure.resourcemanager.kusto.models.ProvisioningState; +import com.azure.resourcemanager.kusto.models.PublicNetworkAccess; import com.azure.resourcemanager.kusto.models.State; import com.azure.resourcemanager.kusto.models.TrustedExternalTenant; import com.azure.resourcemanager.kusto.models.VirtualNetworkConfiguration; @@ -62,6 +66,10 @@ public AzureSku sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public List zones() { List inner = this.innerModel().zones(); if (inner != null) { @@ -140,10 +148,49 @@ public Boolean enableDoubleEncryption() { return this.innerModel().enableDoubleEncryption(); } + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public List allowedIpRangeList() { + List inner = this.innerModel().allowedIpRangeList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public EngineType engineType() { return this.innerModel().engineType(); } + public List acceptedAudiences() { + List inner = this.innerModel().acceptedAudiences(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableAutoStop() { + return this.innerModel().enableAutoStop(); + } + + public ClusterNetworkAccessFlag restrictOutboundNetworkAccess() { + return this.innerModel().restrictOutboundNetworkAccess(); + } + + public List allowedFqdnList() { + List inner = this.innerModel().allowedFqdnList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -451,6 +498,26 @@ public ClusterImpl withEnableDoubleEncryption(Boolean enableDoubleEncryption) { } } + public ClusterImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public ClusterImpl withAllowedIpRangeList(List allowedIpRangeList) { + if (isInCreateMode()) { + this.innerModel().withAllowedIpRangeList(allowedIpRangeList); + return this; + } else { + this.updateParameters.withAllowedIpRangeList(allowedIpRangeList); + return this; + } + } + public ClusterImpl withEngineType(EngineType engineType) { if (isInCreateMode()) { this.innerModel().withEngineType(engineType); @@ -461,6 +528,46 @@ public ClusterImpl withEngineType(EngineType engineType) { } } + public ClusterImpl withAcceptedAudiences(List acceptedAudiences) { + if (isInCreateMode()) { + this.innerModel().withAcceptedAudiences(acceptedAudiences); + return this; + } else { + this.updateParameters.withAcceptedAudiences(acceptedAudiences); + return this; + } + } + + public ClusterImpl withEnableAutoStop(Boolean enableAutoStop) { + if (isInCreateMode()) { + this.innerModel().withEnableAutoStop(enableAutoStop); + return this; + } else { + this.updateParameters.withEnableAutoStop(enableAutoStop); + return this; + } + } + + public ClusterImpl withRestrictOutboundNetworkAccess(ClusterNetworkAccessFlag restrictOutboundNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withRestrictOutboundNetworkAccess(restrictOutboundNetworkAccess); + return this; + } else { + this.updateParameters.withRestrictOutboundNetworkAccess(restrictOutboundNetworkAccess); + return this; + } + } + + public ClusterImpl withAllowedFqdnList(List allowedFqdnList) { + if (isInCreateMode()) { + this.innerModel().withAllowedFqdnList(allowedFqdnList); + return this; + } else { + this.updateParameters.withAllowedFqdnList(allowedFqdnList); + return this; + } + } + public ClusterImpl withIfMatch(String ifMatch) { if (isInCreateMode()) { this.createIfMatch = ifMatch; diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersClientImpl.java index 102cf4cc0637..2f2806372824 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersClientImpl.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersClientImpl.java @@ -41,6 +41,7 @@ import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; +import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner; import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; import com.azure.resourcemanager.kusto.models.ClusterCheckNameRequest; import com.azure.resourcemanager.kusto.models.ClusterListResult; @@ -48,6 +49,7 @@ import com.azure.resourcemanager.kusto.models.FollowerDatabaseListResult; import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; import com.azure.resourcemanager.kusto.models.ListResourceSkusResult; +import com.azure.resourcemanager.kusto.models.OutboundNetworkDependenciesEndpointListResult; import com.azure.resourcemanager.kusto.models.SkuDescriptionList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -283,6 +285,21 @@ Mono> listSkusByResource( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/outboundNetworkDependenciesEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOutboundNetworkDependenciesEndpoints( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" @@ -329,6 +346,16 @@ Mono>> removeLanguageExtensions( @BodyParam("application/json") LanguageExtensionsList languageExtensionsToRemove, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOutboundNetworkDependenciesEndpointsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -3270,6 +3297,190 @@ public PagedIterable listSkusByResource( return new PagedIterable<>(listSkusByResourceAsync(resourceGroupName, clusterName, context)); } + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOutboundNetworkDependenciesEndpoints( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOutboundNetworkDependenciesEndpoints( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOutboundNetworkDependenciesEndpointsAsync( + String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOutboundNetworkDependenciesEndpointsAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String clusterName) { + return new PagedIterable<>(listOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, clusterName)); + } + + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>( + listOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, clusterName, context)); + } + /** * Returns a list of language extensions that can run within KQL queries. * @@ -3983,4 +4194,81 @@ public void removeLanguageExtensions( Context context) { removeLanguageExtensionsAsync(resourceGroupName, clusterName, languageExtensionsToRemove, context).block(); } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Outbound Environment Endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(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 + .listOutboundNetworkDependenciesEndpointsNext( + nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Outbound Environment Endpoints. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(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 + .listOutboundNetworkDependenciesEndpointsNext(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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersImpl.java index 4c21e8b4fe0a..61505157f94d 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersImpl.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ClustersImpl.java @@ -16,6 +16,7 @@ import com.azure.resourcemanager.kusto.fluent.models.DiagnoseVirtualNetworkResultInner; import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; import com.azure.resourcemanager.kusto.fluent.models.LanguageExtensionInner; +import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner; import com.azure.resourcemanager.kusto.fluent.models.SkuDescriptionInner; import com.azure.resourcemanager.kusto.models.AzureResourceSku; import com.azure.resourcemanager.kusto.models.CheckNameResult; @@ -26,6 +27,7 @@ import com.azure.resourcemanager.kusto.models.FollowerDatabaseDefinition; import com.azure.resourcemanager.kusto.models.LanguageExtension; import com.azure.resourcemanager.kusto.models.LanguageExtensionsList; +import com.azure.resourcemanager.kusto.models.OutboundNetworkDependenciesEndpoint; import com.azure.resourcemanager.kusto.models.SkuDescription; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -204,6 +206,20 @@ public PagedIterable listSkusByResource( return Utils.mapPage(inner, inner1 -> new AzureResourceSkuImpl(inner1, this.manager())); } + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new OutboundNetworkDependenciesEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new OutboundNetworkDependenciesEndpointImpl(inner1, this.manager())); + } + public PagedIterable listLanguageExtensions(String resourceGroupName, String clusterName) { PagedIterable inner = this.serviceClient().listLanguageExtensions(resourceGroupName, clusterName); diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesClientImpl.java index 9ca7c4ed0dbd..ec3af72ed51e 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesClientImpl.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/DatabasesClientImpl.java @@ -223,7 +223,7 @@ Mono> removePrincipals( } /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. @@ -278,7 +278,7 @@ private Mono> checkNameAvailabilityWithResponseAs } /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. @@ -331,7 +331,7 @@ private Mono> checkNameAvailabilityWithResponseAs } /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. @@ -356,7 +356,7 @@ private Mono checkNameAvailabilityAsync( } /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. @@ -373,7 +373,7 @@ public CheckNameResultInner checkNameAvailability( } /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientImpl.java index 80d68878097d..b3c03de2eb52 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientImpl.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/KustoManagementClientImpl.java @@ -28,8 +28,11 @@ import com.azure.resourcemanager.kusto.fluent.DatabasePrincipalAssignmentsClient; import com.azure.resourcemanager.kusto.fluent.DatabasesClient; import com.azure.resourcemanager.kusto.fluent.KustoManagementClient; +import com.azure.resourcemanager.kusto.fluent.ManagedPrivateEndpointsClient; import com.azure.resourcemanager.kusto.fluent.OperationsClient; import com.azure.resourcemanager.kusto.fluent.OperationsResultsClient; +import com.azure.resourcemanager.kusto.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kusto.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.kusto.fluent.ScriptsClient; import java.io.IOException; import java.lang.reflect.Type; @@ -158,6 +161,30 @@ public DatabasesClient getDatabases() { return this.databases; } + /** The AttachedDatabaseConfigurationsClient object to access its operations. */ + private final AttachedDatabaseConfigurationsClient attachedDatabaseConfigurations; + + /** + * Gets the AttachedDatabaseConfigurationsClient object to access its operations. + * + * @return the AttachedDatabaseConfigurationsClient object. + */ + public AttachedDatabaseConfigurationsClient getAttachedDatabaseConfigurations() { + return this.attachedDatabaseConfigurations; + } + + /** The ManagedPrivateEndpointsClient object to access its operations. */ + private final ManagedPrivateEndpointsClient managedPrivateEndpoints; + + /** + * Gets the ManagedPrivateEndpointsClient object to access its operations. + * + * @return the ManagedPrivateEndpointsClient object. + */ + public ManagedPrivateEndpointsClient getManagedPrivateEndpoints() { + return this.managedPrivateEndpoints; + } + /** The DatabasePrincipalAssignmentsClient object to access its operations. */ private final DatabasePrincipalAssignmentsClient databasePrincipalAssignments; @@ -182,16 +209,28 @@ public ScriptsClient getScripts() { return this.scripts; } - /** The AttachedDatabaseConfigurationsClient object to access its operations. */ - private final AttachedDatabaseConfigurationsClient attachedDatabaseConfigurations; + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; /** - * Gets the AttachedDatabaseConfigurationsClient object to access its operations. + * Gets the PrivateEndpointConnectionsClient object to access its operations. * - * @return the AttachedDatabaseConfigurationsClient object. + * @return the PrivateEndpointConnectionsClient object. */ - public AttachedDatabaseConfigurationsClient getAttachedDatabaseConfigurations() { - return this.attachedDatabaseConfigurations; + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** 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 DataConnectionsClient object to access its operations. */ @@ -253,13 +292,16 @@ public OperationsResultsClient getOperationsResults() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-01-01"; + this.apiVersion = "2021-08-27"; this.clusters = new ClustersClientImpl(this); this.clusterPrincipalAssignments = new ClusterPrincipalAssignmentsClientImpl(this); this.databases = new DatabasesClientImpl(this); + this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsClientImpl(this); + this.managedPrivateEndpoints = new ManagedPrivateEndpointsClientImpl(this); this.databasePrincipalAssignments = new DatabasePrincipalAssignmentsClientImpl(this); this.scripts = new ScriptsClientImpl(this); - this.attachedDatabaseConfigurations = new AttachedDatabaseConfigurationsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.dataConnections = new DataConnectionsClientImpl(this); this.operations = new OperationsClientImpl(this); this.operationsResults = new OperationsResultsClientImpl(this); diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointImpl.java new file mode 100644 index 000000000000..cc039aaf4b12 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner; +import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpoint; +import com.azure.resourcemanager.kusto.models.ProvisioningState; + +public final class ManagedPrivateEndpointImpl + implements ManagedPrivateEndpoint, ManagedPrivateEndpoint.Definition, ManagedPrivateEndpoint.Update { + private ManagedPrivateEndpointInner innerObject; + + private final com.azure.resourcemanager.kusto.KustoManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String privateLinkResourceId() { + return this.innerModel().privateLinkResourceId(); + } + + public String privateLinkResourceRegion() { + return this.innerModel().privateLinkResourceRegion(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public String requestMessage() { + return this.innerModel().requestMessage(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ManagedPrivateEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kusto.KustoManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String managedPrivateEndpointName; + + public ManagedPrivateEndpointImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public ManagedPrivateEndpoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .createOrUpdate( + resourceGroupName, clusterName, managedPrivateEndpointName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedPrivateEndpoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .createOrUpdate(resourceGroupName, clusterName, managedPrivateEndpointName, this.innerModel(), context); + return this; + } + + ManagedPrivateEndpointImpl(String name, com.azure.resourcemanager.kusto.KustoManager serviceManager) { + this.innerObject = new ManagedPrivateEndpointInner(); + this.serviceManager = serviceManager; + this.managedPrivateEndpointName = name; + } + + public ManagedPrivateEndpointImpl update() { + return this; + } + + public ManagedPrivateEndpoint apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .update(resourceGroupName, clusterName, managedPrivateEndpointName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedPrivateEndpoint apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .update(resourceGroupName, clusterName, managedPrivateEndpointName, this.innerModel(), context); + return this; + } + + ManagedPrivateEndpointImpl( + ManagedPrivateEndpointInner innerObject, com.azure.resourcemanager.kusto.KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.managedPrivateEndpointName = Utils.getValueFromIdByName(innerObject.id(), "managedPrivateEndpoints"); + } + + public ManagedPrivateEndpoint refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .getWithResponse(resourceGroupName, clusterName, managedPrivateEndpointName, Context.NONE) + .getValue(); + return this; + } + + public ManagedPrivateEndpoint refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedPrivateEndpoints() + .getWithResponse(resourceGroupName, clusterName, managedPrivateEndpointName, context) + .getValue(); + return this; + } + + public ManagedPrivateEndpointImpl withPrivateLinkResourceId(String privateLinkResourceId) { + this.innerModel().withPrivateLinkResourceId(privateLinkResourceId); + return this; + } + + public ManagedPrivateEndpointImpl withPrivateLinkResourceRegion(String privateLinkResourceRegion) { + this.innerModel().withPrivateLinkResourceRegion(privateLinkResourceRegion); + return this; + } + + public ManagedPrivateEndpointImpl withGroupId(String groupId) { + this.innerModel().withGroupId(groupId); + return this; + } + + public ManagedPrivateEndpointImpl withRequestMessage(String requestMessage) { + this.innerModel().withRequestMessage(requestMessage); + return this; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointsClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointsClientImpl.java new file mode 100644 index 000000000000..a68ee57a0a81 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointsClientImpl.java @@ -0,0 +1,1606 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kusto.fluent.ManagedPrivateEndpointsClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner; +import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpointListResult; +import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpointsCheckNameRequest; +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 ManagedPrivateEndpointsClient. */ +public final class ManagedPrivateEndpointsClientImpl implements ManagedPrivateEndpointsClient { + private final ClientLogger logger = new ClientLogger(ManagedPrivateEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedPrivateEndpointsService service; + + /** The service client containing this operation class. */ + private final KustoManagementClientImpl client; + + /** + * Initializes an instance of ManagedPrivateEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedPrivateEndpointsClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy + .create(ManagedPrivateEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientManagedPrivateEndpoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface ManagedPrivateEndpointsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/managedPrivateEndpointsCheckNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedPrivateEndpointsCheckNameRequest resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/managedPrivateEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedPrivateEndpointInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedPrivateEndpointInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, String clusterName, ManagedPrivateEndpointsCheckNameRequest resourceName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } else { + resourceName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String clusterName, + ManagedPrivateEndpointsCheckNameRequest resourceName, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } else { + resourceName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceName, + accept, + context); + } + + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, String clusterName, ManagedPrivateEndpointsCheckNameRequest resourceName) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameResultInner checkNameAvailability( + String resourceGroupName, String clusterName, ManagedPrivateEndpointsCheckNameRequest resourceName) { + return checkNameAvailabilityAsync(resourceGroupName, clusterName, resourceName).block(); + } + + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + ManagedPrivateEndpointsCheckNameRequest resourceName, + Context context) { + return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, resourceName, context).block(); + } + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + managedPrivateEndpointName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + managedPrivateEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + return getWithResponseAsync(resourceGroupName, clusterName, managedPrivateEndpointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointInner get( + String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + return getAsync(resourceGroupName, clusterName, managedPrivateEndpointName).block(); + } + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, managedPrivateEndpointName, context).block(); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + managedPrivateEndpointName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + managedPrivateEndpointName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedPrivateEndpointInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedPrivateEndpointInner.class, + ManagedPrivateEndpointInner.class, + Context.NONE); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedPrivateEndpointInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, managedPrivateEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedPrivateEndpointInner.class, + ManagedPrivateEndpointInner.class, + context); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedPrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedPrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointInner createOrUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters).block(); + } + + /** + * Creates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointInner createOrUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters, context) + .block(); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + managedPrivateEndpointName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + managedPrivateEndpointName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedPrivateEndpointInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedPrivateEndpointInner.class, + ManagedPrivateEndpointInner.class, + Context.NONE); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedPrivateEndpointInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedPrivateEndpointInner.class, + ManagedPrivateEndpointInner.class, + context); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedPrivateEndpointInner> beginUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters).getSyncPoller(); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedPrivateEndpointInner> beginUpdate( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointInner update( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters) { + return updateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters).block(); + } + + /** + * Updates a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param parameters The managed private endpoint parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return class representing a managed private endpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedPrivateEndpointInner update( + String resourceGroupName, + String clusterName, + String managedPrivateEndpointName, + ManagedPrivateEndpointInner parameters, + Context context) { + return updateAsync(resourceGroupName, clusterName, managedPrivateEndpointName, parameters, context).block(); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + managedPrivateEndpointName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (managedPrivateEndpointName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedPrivateEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + managedPrivateEndpointName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, managedPrivateEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, managedPrivateEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + return beginDeleteAsync(resourceGroupName, clusterName, managedPrivateEndpointName).getSyncPoller(); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, managedPrivateEndpointName, context).getSyncPoller(); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + return beginDeleteAsync(resourceGroupName, clusterName, managedPrivateEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, managedPrivateEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + deleteAsync(resourceGroupName, clusterName, managedPrivateEndpointName).block(); + } + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + deleteAsync(resourceGroupName, clusterName, managedPrivateEndpointName, context).block(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointsImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointsImpl.java new file mode 100644 index 000000000000..e82dfd237b7d --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ManagedPrivateEndpointsImpl.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.ManagedPrivateEndpointsClient; +import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; +import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner; +import com.azure.resourcemanager.kusto.models.CheckNameResult; +import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpoint; +import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpoints; +import com.azure.resourcemanager.kusto.models.ManagedPrivateEndpointsCheckNameRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedPrivateEndpointsImpl implements ManagedPrivateEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedPrivateEndpointsImpl.class); + + private final ManagedPrivateEndpointsClient innerClient; + + private final com.azure.resourcemanager.kusto.KustoManager serviceManager; + + public ManagedPrivateEndpointsImpl( + ManagedPrivateEndpointsClient innerClient, com.azure.resourcemanager.kusto.KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameResult checkNameAvailability( + String resourceGroupName, String clusterName, ManagedPrivateEndpointsCheckNameRequest resourceName) { + CheckNameResultInner inner = + this.serviceClient().checkNameAvailability(resourceGroupName, clusterName, resourceName); + if (inner != null) { + return new CheckNameResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + ManagedPrivateEndpointsCheckNameRequest resourceName, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse(resourceGroupName, clusterName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new ManagedPrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new ManagedPrivateEndpointImpl(inner1, this.manager())); + } + + public ManagedPrivateEndpoint get(String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + ManagedPrivateEndpointInner inner = + this.serviceClient().get(resourceGroupName, clusterName, managedPrivateEndpointName); + if (inner != null) { + return new ManagedPrivateEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, managedPrivateEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedPrivateEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String managedPrivateEndpointName) { + this.serviceClient().delete(resourceGroupName, clusterName, managedPrivateEndpointName); + } + + public void delete( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, managedPrivateEndpointName, context); + } + + public ManagedPrivateEndpoint 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String managedPrivateEndpointName = Utils.getValueFromIdByName(id, "managedPrivateEndpoints"); + if (managedPrivateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", + id))); + } + return this + .getWithResponse(resourceGroupName, clusterName, managedPrivateEndpointName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String managedPrivateEndpointName = Utils.getValueFromIdByName(id, "managedPrivateEndpoints"); + if (managedPrivateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", + id))); + } + return this.getWithResponse(resourceGroupName, clusterName, managedPrivateEndpointName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String managedPrivateEndpointName = Utils.getValueFromIdByName(id, "managedPrivateEndpoints"); + if (managedPrivateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", + id))); + } + this.delete(resourceGroupName, clusterName, managedPrivateEndpointName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String managedPrivateEndpointName = Utils.getValueFromIdByName(id, "managedPrivateEndpoints"); + if (managedPrivateEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedPrivateEndpoints'.", + id))); + } + this.delete(resourceGroupName, clusterName, managedPrivateEndpointName, context); + } + + private ManagedPrivateEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kusto.KustoManager manager() { + return this.serviceManager; + } + + public ManagedPrivateEndpointImpl define(String name) { + return new ManagedPrivateEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OutboundNetworkDependenciesEndpointImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OutboundNetworkDependenciesEndpointImpl.java new file mode 100644 index 000000000000..75a0b40eb66f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/OutboundNetworkDependenciesEndpointImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner; +import com.azure.resourcemanager.kusto.models.EndpointDependency; +import com.azure.resourcemanager.kusto.models.OutboundNetworkDependenciesEndpoint; +import com.azure.resourcemanager.kusto.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class OutboundNetworkDependenciesEndpointImpl implements OutboundNetworkDependenciesEndpoint { + private OutboundNetworkDependenciesEndpointInner innerObject; + + private final com.azure.resourcemanager.kusto.KustoManager serviceManager; + + OutboundNetworkDependenciesEndpointImpl( + OutboundNetworkDependenciesEndpointInner innerObject, + com.azure.resourcemanager.kusto.KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String category() { + return this.innerModel().category(); + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OutboundNetworkDependenciesEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kusto.KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..09cd40430637 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kusto.models.PrivateEndpointConnection; +import com.azure.resourcemanager.kusto.models.PrivateEndpointProperty; +import com.azure.resourcemanager.kusto.models.PrivateLinkServiceConnectionStateProperty; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.kusto.KustoManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpointProperty privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kusto.KustoManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, clusterName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, clusterName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.kusto.KustoManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, clusterName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, clusterName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, com.azure.resourcemanager.kusto.KustoManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, clusterName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..2e0757f77cd5 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1069 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.kusto.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kusto.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + 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 KustoManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, clusterName, privateEndpointConnectionName).block(); + } + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + privateEndpointConnectionName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + privateEndpointConnectionName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, clusterName, privateEndpointConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, privateEndpointConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, clusterName, privateEndpointConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters).block(); + } + + /** + * Approve or reject a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters A private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String clusterName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, 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 (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName).block(); + } + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, clusterName, privateEndpointConnectionName, context).block(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionsImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..55b7085c8276 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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.kusto.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.kusto.models.PrivateEndpointConnection; +import com.azure.resourcemanager.kusto.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.kusto.KustoManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, com.azure.resourcemanager.kusto.KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection get( + String resourceGroupName, String clusterName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, clusterName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, clusterName, 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 clusterName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, clusterName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", 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, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", 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, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", 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, clusterName, 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 clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", 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, clusterName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kusto.KustoManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourceImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..e1373998443e --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourceImpl.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.kusto.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kusto.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.kusto.KustoManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, com.azure.resourcemanager.kusto.KustoManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.kusto.KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourcesClientImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..e7acbf4d39ca --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kusto.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + 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 KustoManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(KustoManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KustoManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KustoManagementClien") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters" + + "/{clusterName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context)); + } + + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String privateLinkResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + privateLinkResourceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String privateLinkResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + privateLinkResourceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String clusterName, String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, clusterName, privateLinkResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String clusterName, String privateLinkResourceName) { + return getAsync(resourceGroupName, clusterName, privateLinkResourceName).block(); + } + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String privateLinkResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, privateLinkResourceName, context).block(); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourcesImpl.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..fbbc8a8fbf1f --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/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.kusto.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.kusto.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.kusto.models.PrivateLinkResource; +import com.azure.resourcemanager.kusto.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.kusto.KustoManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.kusto.KustoManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String clusterName, String privateLinkResourceName) { + PrivateLinkResourceInner inner = + this.serviceClient().get(resourceGroupName, clusterName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String privateLinkResourceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, privateLinkResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.kusto.KustoManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AcceptedAudiences.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AcceptedAudiences.java new file mode 100644 index 000000000000..55dcd8293fb4 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AcceptedAudiences.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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; + +/** Represents an accepted audience trusted by the cluster. */ +@Fluent +public final class AcceptedAudiences { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AcceptedAudiences.class); + + /* + * GUID or valid URL representing an accepted audience. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value property: GUID or valid URL representing an accepted audience. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: GUID or valid URL representing an accepted audience. + * + * @param value the value value to set. + * @return the AcceptedAudiences object itself. + */ + public AcceptedAudiences withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurations.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurations.java index 5b888e8f2f85..1685cda3865a 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurations.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurations.java @@ -10,6 +10,38 @@ /** Resource collection API of AttachedDatabaseConfigurations. */ public interface AttachedDatabaseConfigurations { + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + CheckNameResult checkNameAvailability( + String resourceGroupName, String clusterName, AttachedDatabaseConfigurationsCheckNameRequest resourceName); + + /** + * Checks that the attached database configuration resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + AttachedDatabaseConfigurationsCheckNameRequest resourceName, + Context context); + /** * Returns the list of attached database configurations of the given Kusto cluster. * diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurationsCheckNameRequest.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurationsCheckNameRequest.java new file mode 100644 index 000000000000..35495f219fb8 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/AttachedDatabaseConfigurationsCheckNameRequest.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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 result returned from a AttachedDatabaseConfigurations check name availability request. */ +@Fluent +public final class AttachedDatabaseConfigurationsCheckNameRequest { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AttachedDatabaseConfigurationsCheckNameRequest.class); + + /* + * Attached database resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, for instance + * Microsoft.Kusto/clusters/attachedDatabaseConfigurations. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of AttachedDatabaseConfigurationsCheckNameRequest class. */ + public AttachedDatabaseConfigurationsCheckNameRequest() { + type = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations"; + } + + /** + * Get the name property: Attached database resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Attached database resource name. + * + * @param name the name value to set. + * @return the AttachedDatabaseConfigurationsCheckNameRequest object itself. + */ + public AttachedDatabaseConfigurationsCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, for instance + * Microsoft.Kusto/clusters/attachedDatabaseConfigurations. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, for instance + * Microsoft.Kusto/clusters/attachedDatabaseConfigurations. + * + * @param type the type value to set. + * @return the AttachedDatabaseConfigurationsCheckNameRequest object itself. + */ + public AttachedDatabaseConfigurationsCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model AttachedDatabaseConfigurationsCheckNameRequest")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Cluster.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Cluster.java index 620b5c977db3..0e205adb7680 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Cluster.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Cluster.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.kusto.fluent.models.ClusterInner; import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner; @@ -56,6 +57,13 @@ public interface Cluster { */ AzureSku sku(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the zones property: The availability zones of the cluster. * @@ -175,6 +183,21 @@ public interface Cluster { */ Boolean enableDoubleEncryption(); + /** + * Gets the publicNetworkAccess property: Public network access to the cluster is enabled by default. When disabled, + * only private endpoint connection to the cluster is allowed. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the allowedIpRangeList property: The list of ips in the format of CIDR allowed to connect to the cluster. + * + * @return the allowedIpRangeList value. + */ + List allowedIpRangeList(); + /** * Gets the engineType property: The engine type. * @@ -182,6 +205,36 @@ public interface Cluster { */ EngineType engineType(); + /** + * Gets the acceptedAudiences property: The cluster's accepted audiences. + * + * @return the acceptedAudiences value. + */ + List acceptedAudiences(); + + /** + * Gets the enableAutoStop property: A boolean value that indicates if the cluster could be automatically stopped + * (due to lack of data or no activity for many days). + * + * @return the enableAutoStop value. + */ + Boolean enableAutoStop(); + + /** + * Gets the restrictOutboundNetworkAccess property: Whether or not to restrict outbound network access. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the restrictOutboundNetworkAccess value. + */ + ClusterNetworkAccessFlag restrictOutboundNetworkAccess(); + + /** + * Gets the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + * + * @return the allowedFqdnList value. + */ + List allowedFqdnList(); + /** * Gets the region of the resource. * @@ -270,7 +323,13 @@ interface WithCreate DefinitionStages.WithKeyVaultProperties, DefinitionStages.WithEnablePurge, DefinitionStages.WithEnableDoubleEncryption, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithAllowedIpRangeList, DefinitionStages.WithEngineType, + DefinitionStages.WithAcceptedAudiences, + DefinitionStages.WithEnableAutoStop, + DefinitionStages.WithRestrictOutboundNetworkAccess, + DefinitionStages.WithAllowedFqdnList, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { /** @@ -401,6 +460,29 @@ interface WithEnableDoubleEncryption { */ WithCreate withEnableDoubleEncryption(Boolean enableDoubleEncryption); } + /** The stage of the Cluster definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Public network access to the cluster is enabled by default. + * When disabled, only private endpoint connection to the cluster is allowed. + * + * @param publicNetworkAccess Public network access to the cluster is enabled by default. When disabled, + * only private endpoint connection to the cluster is allowed. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Cluster definition allowing to specify allowedIpRangeList. */ + interface WithAllowedIpRangeList { + /** + * Specifies the allowedIpRangeList property: The list of ips in the format of CIDR allowed to connect to + * the cluster.. + * + * @param allowedIpRangeList The list of ips in the format of CIDR allowed to connect to the cluster. + * @return the next definition stage. + */ + WithCreate withAllowedIpRangeList(List allowedIpRangeList); + } /** The stage of the Cluster definition allowing to specify engineType. */ interface WithEngineType { /** @@ -411,6 +493,51 @@ interface WithEngineType { */ WithCreate withEngineType(EngineType engineType); } + /** The stage of the Cluster definition allowing to specify acceptedAudiences. */ + interface WithAcceptedAudiences { + /** + * Specifies the acceptedAudiences property: The cluster's accepted audiences.. + * + * @param acceptedAudiences The cluster's accepted audiences. + * @return the next definition stage. + */ + WithCreate withAcceptedAudiences(List acceptedAudiences); + } + /** The stage of the Cluster definition allowing to specify enableAutoStop. */ + interface WithEnableAutoStop { + /** + * Specifies the enableAutoStop property: A boolean value that indicates if the cluster could be + * automatically stopped (due to lack of data or no activity for many days).. + * + * @param enableAutoStop A boolean value that indicates if the cluster could be automatically stopped (due + * to lack of data or no activity for many days). + * @return the next definition stage. + */ + WithCreate withEnableAutoStop(Boolean enableAutoStop); + } + /** The stage of the Cluster definition allowing to specify restrictOutboundNetworkAccess. */ + interface WithRestrictOutboundNetworkAccess { + /** + * Specifies the restrictOutboundNetworkAccess property: Whether or not to restrict outbound network access. + * Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param restrictOutboundNetworkAccess Whether or not to restrict outbound network access. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withRestrictOutboundNetworkAccess(ClusterNetworkAccessFlag restrictOutboundNetworkAccess); + } + /** The stage of the Cluster definition allowing to specify allowedFqdnList. */ + interface WithAllowedFqdnList { + /** + * Specifies the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress + * from Cluster.. + * + * @param allowedFqdnList List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + * @return the next definition stage. + */ + WithCreate withAllowedFqdnList(List allowedFqdnList); + } /** The stage of the Cluster definition allowing to specify ifMatch. */ interface WithIfMatch { /** @@ -456,7 +583,13 @@ interface Update UpdateStages.WithKeyVaultProperties, UpdateStages.WithEnablePurge, UpdateStages.WithEnableDoubleEncryption, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithAllowedIpRangeList, UpdateStages.WithEngineType, + UpdateStages.WithAcceptedAudiences, + UpdateStages.WithEnableAutoStop, + UpdateStages.WithRestrictOutboundNetworkAccess, + UpdateStages.WithAllowedFqdnList, UpdateStages.WithIfMatch { /** * Executes the update request. @@ -588,6 +721,29 @@ interface WithEnableDoubleEncryption { */ Update withEnableDoubleEncryption(Boolean enableDoubleEncryption); } + /** The stage of the Cluster update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Public network access to the cluster is enabled by default. + * When disabled, only private endpoint connection to the cluster is allowed. + * + * @param publicNetworkAccess Public network access to the cluster is enabled by default. When disabled, + * only private endpoint connection to the cluster is allowed. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Cluster update allowing to specify allowedIpRangeList. */ + interface WithAllowedIpRangeList { + /** + * Specifies the allowedIpRangeList property: The list of ips in the format of CIDR allowed to connect to + * the cluster.. + * + * @param allowedIpRangeList The list of ips in the format of CIDR allowed to connect to the cluster. + * @return the next definition stage. + */ + Update withAllowedIpRangeList(List allowedIpRangeList); + } /** The stage of the Cluster update allowing to specify engineType. */ interface WithEngineType { /** @@ -598,6 +754,51 @@ interface WithEngineType { */ Update withEngineType(EngineType engineType); } + /** The stage of the Cluster update allowing to specify acceptedAudiences. */ + interface WithAcceptedAudiences { + /** + * Specifies the acceptedAudiences property: The cluster's accepted audiences.. + * + * @param acceptedAudiences The cluster's accepted audiences. + * @return the next definition stage. + */ + Update withAcceptedAudiences(List acceptedAudiences); + } + /** The stage of the Cluster update allowing to specify enableAutoStop. */ + interface WithEnableAutoStop { + /** + * Specifies the enableAutoStop property: A boolean value that indicates if the cluster could be + * automatically stopped (due to lack of data or no activity for many days).. + * + * @param enableAutoStop A boolean value that indicates if the cluster could be automatically stopped (due + * to lack of data or no activity for many days). + * @return the next definition stage. + */ + Update withEnableAutoStop(Boolean enableAutoStop); + } + /** The stage of the Cluster update allowing to specify restrictOutboundNetworkAccess. */ + interface WithRestrictOutboundNetworkAccess { + /** + * Specifies the restrictOutboundNetworkAccess property: Whether or not to restrict outbound network access. + * Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param restrictOutboundNetworkAccess Whether or not to restrict outbound network access. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + Update withRestrictOutboundNetworkAccess(ClusterNetworkAccessFlag restrictOutboundNetworkAccess); + } + /** The stage of the Cluster update allowing to specify allowedFqdnList. */ + interface WithAllowedFqdnList { + /** + * Specifies the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress + * from Cluster.. + * + * @param allowedFqdnList List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + * @return the next definition stage. + */ + Update withAllowedFqdnList(List allowedFqdnList); + } /** The stage of the Cluster update allowing to specify ifMatch. */ interface WithIfMatch { /** diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterNetworkAccessFlag.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterNetworkAccessFlag.java new file mode 100644 index 000000000000..5285b72556a8 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterNetworkAccessFlag.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.kusto.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterNetworkAccessFlag. */ +public final class ClusterNetworkAccessFlag extends ExpandableStringEnum { + /** Static value Enabled for ClusterNetworkAccessFlag. */ + public static final ClusterNetworkAccessFlag ENABLED = fromString("Enabled"); + + /** Static value Disabled for ClusterNetworkAccessFlag. */ + public static final ClusterNetworkAccessFlag DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ClusterNetworkAccessFlag from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterNetworkAccessFlag. + */ + @JsonCreator + public static ClusterNetworkAccessFlag fromString(String name) { + return fromString(name, ClusterNetworkAccessFlag.class); + } + + /** @return known ClusterNetworkAccessFlag values. */ + public static Collection values() { + return values(ClusterNetworkAccessFlag.class); + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterUpdate.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterUpdate.java index bcd5f3062f45..aceefb465845 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterUpdate.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ClusterUpdate.java @@ -9,6 +9,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -23,6 +24,7 @@ public class ClusterUpdate extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -127,12 +129,52 @@ public class ClusterUpdate extends ProxyResource { @JsonProperty(value = "properties.enableDoubleEncryption") private Boolean enableDoubleEncryption; + /* + * Public network access to the cluster is enabled by default. When + * disabled, only private endpoint connection to the cluster is allowed + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * The list of ips in the format of CIDR allowed to connect to the cluster. + */ + @JsonProperty(value = "properties.allowedIpRangeList") + private List allowedIpRangeList; + /* * The engine type */ @JsonProperty(value = "properties.engineType") private EngineType engineType; + /* + * The cluster's accepted audiences. + */ + @JsonProperty(value = "properties.acceptedAudiences") + private List acceptedAudiences; + + /* + * A boolean value that indicates if the cluster could be automatically + * stopped (due to lack of data or no activity for many days). + */ + @JsonProperty(value = "properties.enableAutoStop") + private Boolean enableAutoStop; + + /* + * Whether or not to restrict outbound network access. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled' + */ + @JsonProperty(value = "properties.restrictOutboundNetworkAccess") + private ClusterNetworkAccessFlag restrictOutboundNetworkAccess; + + /* + * List of allowed FQDNs(Fully Qualified Domain Name) for egress from + * Cluster. + */ + @JsonProperty(value = "properties.allowedFqdnList") + private List allowedFqdnList; + /** * Get the tags property: Resource tags. * @@ -427,6 +469,48 @@ public ClusterUpdate withEnableDoubleEncryption(Boolean enableDoubleEncryption) return this; } + /** + * Get the publicNetworkAccess property: Public network access to the cluster is enabled by default. When disabled, + * only private endpoint connection to the cluster is allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Public network access to the cluster is enabled by default. When disabled, + * only private endpoint connection to the cluster is allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the allowedIpRangeList property: The list of ips in the format of CIDR allowed to connect to the cluster. + * + * @return the allowedIpRangeList value. + */ + public List allowedIpRangeList() { + return this.allowedIpRangeList; + } + + /** + * Set the allowedIpRangeList property: The list of ips in the format of CIDR allowed to connect to the cluster. + * + * @param allowedIpRangeList the allowedIpRangeList value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withAllowedIpRangeList(List allowedIpRangeList) { + this.allowedIpRangeList = allowedIpRangeList; + return this; + } + /** * Get the engineType property: The engine type. * @@ -447,6 +531,90 @@ public ClusterUpdate withEngineType(EngineType engineType) { return this; } + /** + * Get the acceptedAudiences property: The cluster's accepted audiences. + * + * @return the acceptedAudiences value. + */ + public List acceptedAudiences() { + return this.acceptedAudiences; + } + + /** + * Set the acceptedAudiences property: The cluster's accepted audiences. + * + * @param acceptedAudiences the acceptedAudiences value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withAcceptedAudiences(List acceptedAudiences) { + this.acceptedAudiences = acceptedAudiences; + return this; + } + + /** + * Get the enableAutoStop property: A boolean value that indicates if the cluster could be automatically stopped + * (due to lack of data or no activity for many days). + * + * @return the enableAutoStop value. + */ + public Boolean enableAutoStop() { + return this.enableAutoStop; + } + + /** + * Set the enableAutoStop property: A boolean value that indicates if the cluster could be automatically stopped + * (due to lack of data or no activity for many days). + * + * @param enableAutoStop the enableAutoStop value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withEnableAutoStop(Boolean enableAutoStop) { + this.enableAutoStop = enableAutoStop; + return this; + } + + /** + * Get the restrictOutboundNetworkAccess property: Whether or not to restrict outbound network access. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the restrictOutboundNetworkAccess value. + */ + public ClusterNetworkAccessFlag restrictOutboundNetworkAccess() { + return this.restrictOutboundNetworkAccess; + } + + /** + * Set the restrictOutboundNetworkAccess property: Whether or not to restrict outbound network access. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param restrictOutboundNetworkAccess the restrictOutboundNetworkAccess value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withRestrictOutboundNetworkAccess(ClusterNetworkAccessFlag restrictOutboundNetworkAccess) { + this.restrictOutboundNetworkAccess = restrictOutboundNetworkAccess; + return this; + } + + /** + * Get the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + * + * @return the allowedFqdnList value. + */ + public List allowedFqdnList() { + return this.allowedFqdnList; + } + + /** + * Set the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Cluster. + * + * @param allowedFqdnList the allowedFqdnList value to set. + * @return the ClusterUpdate object itself. + */ + public ClusterUpdate withAllowedFqdnList(List allowedFqdnList) { + this.allowedFqdnList = allowedFqdnList; + return this; + } + /** * Validates the instance. * @@ -474,5 +642,8 @@ public void validate() { if (languageExtensions() != null) { languageExtensions().validate(); } + if (acceptedAudiences() != null) { + acceptedAudiences().forEach(e -> e.validate()); + } } } diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Clusters.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Clusters.java index 7b42da444d06..a2941b910fba 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Clusters.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Clusters.java @@ -300,6 +300,33 @@ Response checkNameAvailabilityWithResponse( */ PagedIterable listSkusByResource(String resourceGroupName, String clusterName, Context context); + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String clusterName); + + /** + * Gets the network endpoints of all outbound dependencies of a Kusto cluster. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network endpoints of all outbound dependencies of a Kusto cluster. + */ + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String clusterName, Context context); + /** * Returns a list of language extensions that can run within KQL queries. * diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Databases.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Databases.java index de3115cc4208..bf4b533fff46 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Databases.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Databases.java @@ -12,7 +12,7 @@ /** Resource collection API of Databases. */ public interface Databases { /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. @@ -25,7 +25,7 @@ public interface Databases { CheckNameResult checkNameAvailability(String resourceGroupName, String clusterName, CheckNameRequest resourceName); /** - * Checks that the database name is valid and is not already in use. + * Checks that the databases resource name is valid and is not already in use. * * @param resourceGroupName The name of the resource group containing the Kusto cluster. * @param clusterName The name of the Kusto cluster. diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EndpointDependency.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EndpointDependency.java new file mode 100644 index 000000000000..b87f45612bf3 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EndpointDependency.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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; + +/** A domain name that a service is reached at, including details of the current connection status. */ +@Fluent +public final class EndpointDependency { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointDependency.class); + + /* + * The domain name of the dependency. + */ + @JsonProperty(value = "domainName") + private String domainName; + + /* + * The ports used when connecting to DomainName. + */ + @JsonProperty(value = "endpointDetails") + private List endpointDetails; + + /** + * Get the domainName property: The domain name of the dependency. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: The domain name of the dependency. + * + * @param domainName the domainName value to set. + * @return the EndpointDependency object itself. + */ + public EndpointDependency withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the endpointDetails property: The ports used when connecting to DomainName. + * + * @return the endpointDetails value. + */ + public List endpointDetails() { + return this.endpointDetails; + } + + /** + * Set the endpointDetails property: The ports used when connecting to DomainName. + * + * @param endpointDetails the endpointDetails value to set. + * @return the EndpointDependency object itself. + */ + public EndpointDependency withEndpointDetails(List endpointDetails) { + this.endpointDetails = endpointDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpointDetails() != null) { + endpointDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EndpointDetail.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EndpointDetail.java new file mode 100644 index 000000000000..179c7c0800d9 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/EndpointDetail.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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; + +/** Current TCP connectivity information from the Kusto cluster to a single endpoint. */ +@Fluent +public final class EndpointDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointDetail.class); + + /* + * The port an endpoint is connected to. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the port property: The port an endpoint is connected to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port an endpoint is connected to. + * + * @param port the port value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Identity.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Identity.java index 3b6f5137cf60..74ec5a6ab0e3 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Identity.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Identity.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -41,6 +42,7 @@ public class Identity { * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /** diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/KeyVaultProperties.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/KeyVaultProperties.java index 19f5320998e6..7f87e7f3be15 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/KeyVaultProperties.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/KeyVaultProperties.java @@ -17,7 +17,7 @@ public final class KeyVaultProperties { /* * The name of the key vault key. */ - @JsonProperty(value = "keyName", required = true) + @JsonProperty(value = "keyName") private String keyName; /* @@ -29,7 +29,7 @@ public final class KeyVaultProperties { /* * The Uri of the key vault. */ - @JsonProperty(value = "keyVaultUri", required = true) + @JsonProperty(value = "keyVaultUri") private String keyVaultUri; /* @@ -124,15 +124,5 @@ public KeyVaultProperties withUserIdentity(String userIdentity) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (keyName() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property keyName in model KeyVaultProperties")); - } - if (keyVaultUri() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property keyVaultUri in model KeyVaultProperties")); - } } } diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpoint.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpoint.java new file mode 100644 index 000000000000..0057344e2709 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpoint.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner; + +/** An immutable client-side representation of ManagedPrivateEndpoint. */ +public interface ManagedPrivateEndpoint { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateLinkResourceId property: The ARM resource ID of the resource for which the managed private + * endpoint is created. + * + * @return the privateLinkResourceId value. + */ + String privateLinkResourceId(); + + /** + * Gets the privateLinkResourceRegion property: The region of the resource to which the managed private endpoint is + * created. + * + * @return the privateLinkResourceRegion value. + */ + String privateLinkResourceRegion(); + + /** + * Gets the groupId property: The groupId in which the managed private endpoint is created. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requestMessage property: The user request message. + * + * @return the requestMessage value. + */ + String requestMessage(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner object. + * + * @return the inner object. + */ + ManagedPrivateEndpointInner innerModel(); + + /** The entirety of the ManagedPrivateEndpoint definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ManagedPrivateEndpoint definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedPrivateEndpoint definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ManagedPrivateEndpoint definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the ManagedPrivateEndpoint definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateLinkResourceId, + DefinitionStages.WithPrivateLinkResourceRegion, + DefinitionStages.WithGroupId, + DefinitionStages.WithRequestMessage { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedPrivateEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedPrivateEndpoint create(Context context); + } + /** The stage of the ManagedPrivateEndpoint definition allowing to specify privateLinkResourceId. */ + interface WithPrivateLinkResourceId { + /** + * Specifies the privateLinkResourceId property: The ARM resource ID of the resource for which the managed + * private endpoint is created.. + * + * @param privateLinkResourceId The ARM resource ID of the resource for which the managed private endpoint + * is created. + * @return the next definition stage. + */ + WithCreate withPrivateLinkResourceId(String privateLinkResourceId); + } + /** The stage of the ManagedPrivateEndpoint definition allowing to specify privateLinkResourceRegion. */ + interface WithPrivateLinkResourceRegion { + /** + * Specifies the privateLinkResourceRegion property: The region of the resource to which the managed private + * endpoint is created.. + * + * @param privateLinkResourceRegion The region of the resource to which the managed private endpoint is + * created. + * @return the next definition stage. + */ + WithCreate withPrivateLinkResourceRegion(String privateLinkResourceRegion); + } + /** The stage of the ManagedPrivateEndpoint definition allowing to specify groupId. */ + interface WithGroupId { + /** + * Specifies the groupId property: The groupId in which the managed private endpoint is created.. + * + * @param groupId The groupId in which the managed private endpoint is created. + * @return the next definition stage. + */ + WithCreate withGroupId(String groupId); + } + /** The stage of the ManagedPrivateEndpoint definition allowing to specify requestMessage. */ + interface WithRequestMessage { + /** + * Specifies the requestMessage property: The user request message.. + * + * @param requestMessage The user request message. + * @return the next definition stage. + */ + WithCreate withRequestMessage(String requestMessage); + } + } + /** + * Begins update for the ManagedPrivateEndpoint resource. + * + * @return the stage of resource update. + */ + ManagedPrivateEndpoint.Update update(); + + /** The template for ManagedPrivateEndpoint update. */ + interface Update + extends UpdateStages.WithPrivateLinkResourceId, + UpdateStages.WithPrivateLinkResourceRegion, + UpdateStages.WithGroupId, + UpdateStages.WithRequestMessage { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedPrivateEndpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedPrivateEndpoint apply(Context context); + } + /** The ManagedPrivateEndpoint update stages. */ + interface UpdateStages { + /** The stage of the ManagedPrivateEndpoint update allowing to specify privateLinkResourceId. */ + interface WithPrivateLinkResourceId { + /** + * Specifies the privateLinkResourceId property: The ARM resource ID of the resource for which the managed + * private endpoint is created.. + * + * @param privateLinkResourceId The ARM resource ID of the resource for which the managed private endpoint + * is created. + * @return the next definition stage. + */ + Update withPrivateLinkResourceId(String privateLinkResourceId); + } + /** The stage of the ManagedPrivateEndpoint update allowing to specify privateLinkResourceRegion. */ + interface WithPrivateLinkResourceRegion { + /** + * Specifies the privateLinkResourceRegion property: The region of the resource to which the managed private + * endpoint is created.. + * + * @param privateLinkResourceRegion The region of the resource to which the managed private endpoint is + * created. + * @return the next definition stage. + */ + Update withPrivateLinkResourceRegion(String privateLinkResourceRegion); + } + /** The stage of the ManagedPrivateEndpoint update allowing to specify groupId. */ + interface WithGroupId { + /** + * Specifies the groupId property: The groupId in which the managed private endpoint is created.. + * + * @param groupId The groupId in which the managed private endpoint is created. + * @return the next definition stage. + */ + Update withGroupId(String groupId); + } + /** The stage of the ManagedPrivateEndpoint update allowing to specify requestMessage. */ + interface WithRequestMessage { + /** + * Specifies the requestMessage property: The user request message.. + * + * @param requestMessage The user request message. + * @return the next definition stage. + */ + Update withRequestMessage(String requestMessage); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedPrivateEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedPrivateEndpoint refresh(Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpointListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpointListResult.java new file mode 100644 index 000000000000..3a2bfd751961 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpointListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.ManagedPrivateEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list managed private endpoints operation response. */ +@Fluent +public final class ManagedPrivateEndpointListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedPrivateEndpointListResult.class); + + /* + * The list of managed private endpoints. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of managed private endpoints. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of managed private endpoints. + * + * @param value the value value to set. + * @return the ManagedPrivateEndpointListResult object itself. + */ + public ManagedPrivateEndpointListResult withValue(List value) { + this.value = value; + 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpoints.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpoints.java new file mode 100644 index 000000000000..978e359a401d --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpoints.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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 ManagedPrivateEndpoints. */ +public interface ManagedPrivateEndpoints { + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + CheckNameResult checkNameAvailability( + String resourceGroupName, String clusterName, ManagedPrivateEndpointsCheckNameRequest resourceName); + + /** + * Checks that the managed private endpoints resource name is valid and is not already in use. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param resourceName The name of the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result returned from a check name availability request. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String clusterName, + ManagedPrivateEndpointsCheckNameRequest resourceName, + Context context); + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Returns the list of managed private endpoints. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list managed private endpoints operation response. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + ManagedPrivateEndpoint get(String resourceGroupName, String clusterName, String managedPrivateEndpointName); + + /** + * Gets a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context); + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String managedPrivateEndpointName); + + /** + * Deletes a managed private endpoint. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param managedPrivateEndpointName The name of the managed private endpoint. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String managedPrivateEndpointName, Context context); + + /** + * Gets a managed private endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + ManagedPrivateEndpoint getById(String id); + + /** + * Gets a managed private endpoint. + * + * @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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a managed private endpoint. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a managed private endpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a managed private endpoint. + * + * @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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedPrivateEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new ManagedPrivateEndpoint definition. + */ + ManagedPrivateEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpointsCheckNameRequest.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpointsCheckNameRequest.java new file mode 100644 index 000000000000..230bbbc00133 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/ManagedPrivateEndpointsCheckNameRequest.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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 result returned from a managedPrivateEndpoints check name availability request. */ +@Fluent +public final class ManagedPrivateEndpointsCheckNameRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedPrivateEndpointsCheckNameRequest.class); + + /* + * Managed private endpoint resource name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The type of resource, for instance + * Microsoft.Kusto/clusters/managedPrivateEndpoints. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of ManagedPrivateEndpointsCheckNameRequest class. */ + public ManagedPrivateEndpointsCheckNameRequest() { + type = "Microsoft.Kusto/clusters/managedPrivateEndpoints"; + } + + /** + * Get the name property: Managed private endpoint resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Managed private endpoint resource name. + * + * @param name the name value to set. + * @return the ManagedPrivateEndpointsCheckNameRequest object itself. + */ + public ManagedPrivateEndpointsCheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, for instance Microsoft.Kusto/clusters/managedPrivateEndpoints. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of resource, for instance Microsoft.Kusto/clusters/managedPrivateEndpoints. + * + * @param type the type value to set. + * @return the ManagedPrivateEndpointsCheckNameRequest object itself. + */ + public ManagedPrivateEndpointsCheckNameRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ManagedPrivateEndpointsCheckNameRequest")); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operation.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operation.java index 1bdf41daaaf1..d7b268ac0b88 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operation.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Operation.java @@ -9,7 +9,7 @@ /** An immutable client-side representation of Operation. */ public interface Operation { /** - * Gets the name property: This is of the format {provider}/{resource}/{operation}. + * Gets the name property: The operation name. This is of the format {provider}/{resource}/{operation}. * * @return the name value. */ diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationDisplay.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationDisplay.java index 3ae7b56abbd4..4872b4da81c0 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationDisplay.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OperationDisplay.java @@ -21,7 +21,7 @@ public final class OperationDisplay { private String provider; /* - * For example: read, write, delete. + * The operation type. For example: read, write, delete. */ @JsonProperty(value = "operation") private String operation; @@ -59,7 +59,7 @@ public OperationDisplay withProvider(String provider) { } /** - * Get the operation property: For example: read, write, delete. + * Get the operation property: The operation type. For example: read, write, delete. * * @return the operation value. */ @@ -68,7 +68,7 @@ public String operation() { } /** - * Set the operation property: For example: read, write, delete. + * Set the operation property: The operation type. For example: read, write, delete. * * @param operation the operation value to set. * @return the OperationDisplay object itself. diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OutboundNetworkDependenciesEndpoint.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OutboundNetworkDependenciesEndpoint.java new file mode 100644 index 000000000000..276958779607 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OutboundNetworkDependenciesEndpoint.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner; +import java.util.List; + +/** An immutable client-side representation of OutboundNetworkDependenciesEndpoint. */ +public interface OutboundNetworkDependenciesEndpoint { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the category property: The type of service accessed by the Kusto Service Environment, e.g., Azure Storage, + * Azure SQL Database, and Azure Active Directory. + * + * @return the category value. + */ + String category(); + + /** + * Gets the endpoints property: The endpoints that the Kusto Service Environment reaches the service at. + * + * @return the endpoints value. + */ + List endpoints(); + + /** + * Gets the provisioningState property: The provisioned state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner object. + * + * @return the inner object. + */ + OutboundNetworkDependenciesEndpointInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OutboundNetworkDependenciesEndpointListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OutboundNetworkDependenciesEndpointListResult.java new file mode 100644 index 000000000000..b6d5485406db --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/OutboundNetworkDependenciesEndpointListResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Outbound Environment Endpoints. */ +@Fluent +public final class OutboundNetworkDependenciesEndpointListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(OutboundNetworkDependenciesEndpointListResult.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the OutboundNetworkDependenciesEndpointListResult object itself. + */ + public OutboundNetworkDependenciesEndpointListResult withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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 OutboundNetworkDependenciesEndpointListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnection.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..60fda4815e82 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnection.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.kusto.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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateEndpoint property: Private endpoint which the connection belongs to. + * + * @return the privateEndpoint value. + */ + PrivateEndpointProperty privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Connection State of the Private Endpoint Connection. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState(); + + /** + * Gets the groupId property: Group id of the private endpoint. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the provisioningState property: Provisioning state of the private endpoint. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Connection State of the Private Endpoint + * Connection.. + * + * @param privateLinkServiceConnectionState Connection State of the Private Endpoint Connection. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Connection State of the Private Endpoint + * Connection.. + * + * @param privateLinkServiceConnectionState Connection State of the Private Endpoint Connection. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnectionListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..6e8239f436b6 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private endpoint connections. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * Array of private endpoint connections + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnections.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..3f9a59f59e5b --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointConnections.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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 { + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Returns the list of private endpoint connections. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String clusterName, String privateEndpointConnectionName); + + /** + * Gets a private endpoint connection. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String privateEndpointConnectionName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a private endpoint connection. + * + * @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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a private endpoint connection with a given name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a private endpoint connection with a given 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.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointProperty.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointProperty.java new file mode 100644 index 000000000000..461ccce2c636 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateEndpointProperty.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.kusto.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; + +/** Private endpoint which the connection belongs to. */ +@Immutable +public final class PrivateEndpointProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointProperty.class); + + /* + * Resource id of the private endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Resource id of the private endpoint. + * + * @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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResource.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResource.java new file mode 100644 index 000000000000..117f8c708941 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * 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 systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource required zone names. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResourceListResult.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..c6df90cbf574 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResourceListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.kusto.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); + + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + 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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResources.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResources.java new file mode 100644 index 000000000000..1451c88ce807 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkResources.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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 { + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * Returns the list of private link resources. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + PagedIterable list(String resourceGroupName, String clusterName, Context context); + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + PrivateLinkResource get(String resourceGroupName, String clusterName, String privateLinkResourceName); + + /** + * Gets a private link resource. + * + * @param resourceGroupName The name of the resource group containing the Kusto cluster. + * @param clusterName The name of the Kusto cluster. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String privateLinkResourceName, Context context); +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkServiceConnectionStateProperty.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkServiceConnectionStateProperty.java new file mode 100644 index 000000000000..35dda3c0fabe --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PrivateLinkServiceConnectionStateProperty.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.kusto.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; + +/** Connection State of the Private Endpoint Connection. */ +@Fluent +public final class PrivateLinkServiceConnectionStateProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionStateProperty.class); + + /* + * The private link service connection status. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The private link service connection description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Any action that is required beyond basic workflow (approve/ reject/ + * disconnect) + */ + @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) + private String actionsRequired; + + /** + * Get the status property: The private link service connection status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The private link service connection status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionStateProperty object itself. + */ + public PrivateLinkServiceConnectionStateProperty withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the description property: The private link service connection description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The private link service connection description. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionStateProperty object itself. + */ + public PrivateLinkServiceConnectionStateProperty withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: Any action that is required beyond basic workflow (approve/ reject/ + * disconnect). + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PublicNetworkAccess.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..5a5046443c06 --- /dev/null +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/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.kusto.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/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Script.java b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Script.java index 745463f1af4d..73adfe1003d4 100644 --- a/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Script.java +++ b/sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/models/Script.java @@ -176,10 +176,7 @@ interface WithContinueOnErrors { /** The template for Script update. */ interface Update - extends UpdateStages.WithScriptUrl, - UpdateStages.WithScriptUrlSasToken, - UpdateStages.WithForceUpdateTag, - UpdateStages.WithContinueOnErrors { + extends UpdateStages.WithScriptUrl, UpdateStages.WithForceUpdateTag, UpdateStages.WithContinueOnErrors { /** * Executes the update request. * @@ -207,16 +204,6 @@ interface WithScriptUrl { */ Update withScriptUrl(String scriptUrl); } - /** The stage of the Script update allowing to specify scriptUrlSasToken. */ - interface WithScriptUrlSasToken { - /** - * Specifies the scriptUrlSasToken property: The SaS token.. - * - * @param scriptUrlSasToken The SaS token. - * @return the next definition stage. - */ - Update withScriptUrlSasToken(String scriptUrlSasToken); - } /** The stage of the Script update allowing to specify forceUpdateTag. */ interface WithForceUpdateTag { /**