diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/SourceControlConfigurationManager.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/SourceControlConfigurationManager.java deleted file mode 100644 index 5da53e29427fb..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/SourceControlConfigurationManager.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -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; -import com.azure.core.http.policy.HttpPolicyProviders; -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.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.SourceControlConfigurationClient; -import com.azure.resourcemanager.kubernetesconfiguration.implementation.OperationsImpl; -import com.azure.resourcemanager.kubernetesconfiguration.implementation.SourceControlConfigurationClientBuilder; -import com.azure.resourcemanager.kubernetesconfiguration.implementation.SourceControlConfigurationsImpl; -import com.azure.resourcemanager.kubernetesconfiguration.models.Operations; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurations; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** Entry point to SourceControlConfigurationManager. KubernetesConfiguration Client. */ -public final class SourceControlConfigurationManager { - private SourceControlConfigurations sourceControlConfigurations; - - private Operations operations; - - private final SourceControlConfigurationClient clientObject; - - private SourceControlConfigurationManager( - HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new SourceControlConfigurationClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of SourceControlConfiguration service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the SourceControlConfiguration service API instance. - */ - public static SourceControlConfigurationManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Gets a Configurable instance that can be used to create SourceControlConfigurationManager with optional - * configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new SourceControlConfigurationManager.Configurable(); - } - - /** The Configurable allowing configurations to be set. */ - public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private RetryPolicy retryPolicy; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of SourceControlConfiguration service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the SourceControlConfiguration service API instance. - */ - public SourceControlConfigurationManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - - StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.kubernetesconfiguration") - .append("/") - .append("1.0.0-beta.1"); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new RequestIdPolicy()); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new SourceControlConfigurationManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** @return Resource collection API of SourceControlConfigurations. */ - public SourceControlConfigurations sourceControlConfigurations() { - if (this.sourceControlConfigurations == null) { - this.sourceControlConfigurations = - new SourceControlConfigurationsImpl(clientObject.getSourceControlConfigurations(), this); - } - return sourceControlConfigurations; - } - - /** @return Resource collection API of Operations. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * @return Wrapped service client SourceControlConfigurationClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. - */ - public SourceControlConfigurationClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationsClient.java deleted file mode 100644 index 05a3722376503..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/OperationsClient.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ResourceProviderOperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @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 result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @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 result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationClient.java deleted file mode 100644 index 659028b4939a1..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for SourceControlConfigurationClient class. */ -public interface SourceControlConfigurationClient { - /** - * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the SourceControlConfigurationsClient object to access its operations. - * - * @return the SourceControlConfigurationsClient object. - */ - SourceControlConfigurationsClient getSourceControlConfigurations(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationsClient.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationsClient.java deleted file mode 100644 index 66cfdab965d31..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/SourceControlConfigurationsClient.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.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.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurationsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurationsClusterRp; - -/** An instance of this class provides access to all the operations defined in SourceControlConfigurationsClient. */ -public interface SourceControlConfigurationsClient { - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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 details of the Source Control Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SourceControlConfigurationInner get( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName); - - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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 details of the Source Control Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context); - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @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 SourceControl Configuration object returned in Get & Put response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SourceControlConfigurationInner createOrUpdate( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration); - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @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 SourceControl Configuration object returned in Get & Put response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration, - Context context); - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName); - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context); - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName); - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context); - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName); - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - Context context); -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ResourceProviderOperationInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ResourceProviderOperationInner.java deleted file mode 100644 index bf530e97fea4e..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/ResourceProviderOperationInner.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.kubernetesconfiguration.models.ResourceProviderOperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Supported operation of this resource provider. */ -@Fluent -public final class ResourceProviderOperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderOperationInner.class); - - /* - * Operation name, in format of {provider}/{resource}/{operation} - */ - @JsonProperty(value = "name") - private String name; - - /* - * Display metadata associated with the operation. - */ - @JsonProperty(value = "display") - private ResourceProviderOperationDisplay display; - - /* - * The flag that indicates whether the operation applies to data plane. - */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDataAction; - - /** - * Get the name property: Operation name, in format of {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name, in format of {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the ResourceProviderOperationInner object itself. - */ - public ResourceProviderOperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: Display metadata associated with the operation. - * - * @return the display value. - */ - public ResourceProviderOperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Display metadata associated with the operation. - * - * @param display the display value to set. - * @return the ResourceProviderOperationInner object itself. - */ - public ResourceProviderOperationInner withDisplay(ResourceProviderOperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the isDataAction property: The flag that indicates whether the operation applies to data plane. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationInner.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationInner.java deleted file mode 100644 index 78443984e9dc1..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/SourceControlConfigurationInner.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.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.kubernetesconfiguration.models.ComplianceStatus; -import com.azure.resourcemanager.kubernetesconfiguration.models.HelmOperatorProperties; -import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorScopeType; -import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorType; -import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningStateType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The SourceControl Configuration object returned in Get & Put response. */ -@JsonFlatten -@Fluent -public class SourceControlConfigurationInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlConfigurationInner.class); - - /* - * Top level metadata - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Url of the SourceControl Repository. - */ - @JsonProperty(value = "properties.repositoryUrl") - private String repositoryUrl; - - /* - * The namespace to which this operator is installed to. Maximum of 253 - * lower case alphanumeric characters, hyphen and period only. - */ - @JsonProperty(value = "properties.operatorNamespace") - private String operatorNamespace; - - /* - * Instance name of the operator - identifying the specific configuration. - */ - @JsonProperty(value = "properties.operatorInstanceName") - private String operatorInstanceName; - - /* - * Type of the operator - */ - @JsonProperty(value = "properties.operatorType") - private OperatorType operatorType; - - /* - * Any Parameters for the Operator instance in string format. - */ - @JsonProperty(value = "properties.operatorParams") - private String operatorParams; - - /* - * Name-value pairs of protected configuration settings for the - * configuration - */ - @JsonProperty(value = "properties.configurationProtectedSettings") - private Map configurationProtectedSettings; - - /* - * Scope at which the operator will be installed. - */ - @JsonProperty(value = "properties.operatorScope") - private OperatorScopeType operatorScope; - - /* - * Public Key associated with this SourceControl configuration (either - * generated within the cluster or provided by the user). - */ - @JsonProperty(value = "properties.repositoryPublicKey", access = JsonProperty.Access.WRITE_ONLY) - private String repositoryPublicKey; - - /* - * Base64-encoded known_hosts contents containing public SSH keys required - * to access private Git instances - */ - @JsonProperty(value = "properties.sshKnownHostsContents") - private String sshKnownHostsContents; - - /* - * Option to enable Helm Operator for this git configuration. - */ - @JsonProperty(value = "properties.enableHelmOperator") - private Boolean enableHelmOperator; - - /* - * Properties for Helm operator. - */ - @JsonProperty(value = "properties.helmOperatorProperties") - private HelmOperatorProperties helmOperatorProperties; - - /* - * The provisioning state of the resource provider. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningStateType provisioningState; - - /* - * Compliance Status of the Configuration - */ - @JsonProperty(value = "properties.complianceStatus", access = JsonProperty.Access.WRITE_ONLY) - private ComplianceStatus complianceStatus; - - /** - * Get the systemData property: Top level metadata - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the repositoryUrl property: Url of the SourceControl Repository. - * - * @return the repositoryUrl value. - */ - public String repositoryUrl() { - return this.repositoryUrl; - } - - /** - * Set the repositoryUrl property: Url of the SourceControl Repository. - * - * @param repositoryUrl the repositoryUrl value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - return this; - } - - /** - * Get the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower - * case alphanumeric characters, hyphen and period only. - * - * @return the operatorNamespace value. - */ - public String operatorNamespace() { - return this.operatorNamespace; - } - - /** - * Set the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower - * case alphanumeric characters, hyphen and period only. - * - * @param operatorNamespace the operatorNamespace value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withOperatorNamespace(String operatorNamespace) { - this.operatorNamespace = operatorNamespace; - return this; - } - - /** - * Get the operatorInstanceName property: Instance name of the operator - identifying the specific configuration. - * - * @return the operatorInstanceName value. - */ - public String operatorInstanceName() { - return this.operatorInstanceName; - } - - /** - * Set the operatorInstanceName property: Instance name of the operator - identifying the specific configuration. - * - * @param operatorInstanceName the operatorInstanceName value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withOperatorInstanceName(String operatorInstanceName) { - this.operatorInstanceName = operatorInstanceName; - return this; - } - - /** - * Get the operatorType property: Type of the operator. - * - * @return the operatorType value. - */ - public OperatorType operatorType() { - return this.operatorType; - } - - /** - * Set the operatorType property: Type of the operator. - * - * @param operatorType the operatorType value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withOperatorType(OperatorType operatorType) { - this.operatorType = operatorType; - return this; - } - - /** - * Get the operatorParams property: Any Parameters for the Operator instance in string format. - * - * @return the operatorParams value. - */ - public String operatorParams() { - return this.operatorParams; - } - - /** - * Set the operatorParams property: Any Parameters for the Operator instance in string format. - * - * @param operatorParams the operatorParams value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withOperatorParams(String operatorParams) { - this.operatorParams = operatorParams; - return this; - } - - /** - * Get the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the - * configuration. - * - * @return the configurationProtectedSettings value. - */ - public Map configurationProtectedSettings() { - return this.configurationProtectedSettings; - } - - /** - * Set the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the - * configuration. - * - * @param configurationProtectedSettings the configurationProtectedSettings value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withConfigurationProtectedSettings( - Map configurationProtectedSettings) { - this.configurationProtectedSettings = configurationProtectedSettings; - return this; - } - - /** - * Get the operatorScope property: Scope at which the operator will be installed. - * - * @return the operatorScope value. - */ - public OperatorScopeType operatorScope() { - return this.operatorScope; - } - - /** - * Set the operatorScope property: Scope at which the operator will be installed. - * - * @param operatorScope the operatorScope value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withOperatorScope(OperatorScopeType operatorScope) { - this.operatorScope = operatorScope; - return this; - } - - /** - * Get the repositoryPublicKey property: Public Key associated with this SourceControl configuration (either - * generated within the cluster or provided by the user). - * - * @return the repositoryPublicKey value. - */ - public String repositoryPublicKey() { - return this.repositoryPublicKey; - } - - /** - * Get the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required - * to access private Git instances. - * - * @return the sshKnownHostsContents value. - */ - public String sshKnownHostsContents() { - return this.sshKnownHostsContents; - } - - /** - * Set the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required - * to access private Git instances. - * - * @param sshKnownHostsContents the sshKnownHostsContents value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withSshKnownHostsContents(String sshKnownHostsContents) { - this.sshKnownHostsContents = sshKnownHostsContents; - return this; - } - - /** - * Get the enableHelmOperator property: Option to enable Helm Operator for this git configuration. - * - * @return the enableHelmOperator value. - */ - public Boolean enableHelmOperator() { - return this.enableHelmOperator; - } - - /** - * Set the enableHelmOperator property: Option to enable Helm Operator for this git configuration. - * - * @param enableHelmOperator the enableHelmOperator value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withEnableHelmOperator(Boolean enableHelmOperator) { - this.enableHelmOperator = enableHelmOperator; - return this; - } - - /** - * Get the helmOperatorProperties property: Properties for Helm operator. - * - * @return the helmOperatorProperties value. - */ - public HelmOperatorProperties helmOperatorProperties() { - return this.helmOperatorProperties; - } - - /** - * Set the helmOperatorProperties property: Properties for Helm operator. - * - * @param helmOperatorProperties the helmOperatorProperties value to set. - * @return the SourceControlConfigurationInner object itself. - */ - public SourceControlConfigurationInner withHelmOperatorProperties(HelmOperatorProperties helmOperatorProperties) { - this.helmOperatorProperties = helmOperatorProperties; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the resource provider. - * - * @return the provisioningState value. - */ - public ProvisioningStateType provisioningState() { - return this.provisioningState; - } - - /** - * Get the complianceStatus property: Compliance Status of the Configuration. - * - * @return the complianceStatus value. - */ - public ComplianceStatus complianceStatus() { - return this.complianceStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (helmOperatorProperties() != null) { - helmOperatorProperties().validate(); - } - if (complianceStatus() != null) { - complianceStatus().validate(); - } - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/package-info.java deleted file mode 100644 index 75b24bbbd0632..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for SourceControlConfigurationClient. KubernetesConfiguration Client. */ -package com.azure.resourcemanager.kubernetesconfiguration.fluent.models; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/package-info.java deleted file mode 100644 index 360d06c97d23c..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for SourceControlConfigurationClient. KubernetesConfiguration Client. */ -package com.azure.resourcemanager.kubernetesconfiguration.fluent; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsClientImpl.java deleted file mode 100644 index 6895da432bdf4..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.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.kubernetesconfiguration.fluent.OperationsClient; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ResourceProviderOperationInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ResourceProviderOperationList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final SourceControlConfigurationClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(SourceControlConfigurationClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SourceControlConfigurationClientOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SourceControlConfigu") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.KubernetesConfiguration/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @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 result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @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 result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @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 result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * 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 result of the request to list operations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsImpl.java deleted file mode 100644 index dae50a0566ae0..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/OperationsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.OperationsClient; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ResourceProviderOperationInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.Operations; -import com.azure.resourcemanager.kubernetesconfiguration.models.ResourceProviderOperation; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; - - public OperationsImpl( - OperationsClient innerClient, - com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ResourceProviderOperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ResourceProviderOperationImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ResourceProviderOperationImpl.java deleted file mode 100644 index c635d1f7e0299..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/ResourceProviderOperationImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.implementation; - -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ResourceProviderOperationInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ResourceProviderOperation; -import com.azure.resourcemanager.kubernetesconfiguration.models.ResourceProviderOperationDisplay; - -public final class ResourceProviderOperationImpl implements ResourceProviderOperation { - private ResourceProviderOperationInner innerObject; - - private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; - - ResourceProviderOperationImpl( - ResourceProviderOperationInner innerObject, - com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public ResourceProviderOperationDisplay display() { - return this.innerModel().display(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public ResourceProviderOperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientBuilder.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientBuilder.java deleted file mode 100644 index d98393f02fef3..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientBuilder.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the SourceControlConfigurationClientImpl type. */ -@ServiceClientBuilder(serviceClients = {SourceControlConfigurationClientImpl.class}) -public final class SourceControlConfigurationClientBuilder { - /* - * The Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000) - */ - private String subscriptionId; - - /** - * Sets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @param subscriptionId the subscriptionId value. - * @return the SourceControlConfigurationClientBuilder. - */ - public SourceControlConfigurationClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the SourceControlConfigurationClientBuilder. - */ - public SourceControlConfigurationClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the SourceControlConfigurationClientBuilder. - */ - public SourceControlConfigurationClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the SourceControlConfigurationClientBuilder. - */ - public SourceControlConfigurationClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the SourceControlConfigurationClientBuilder. - */ - public SourceControlConfigurationClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the SourceControlConfigurationClientBuilder. - */ - public SourceControlConfigurationClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of SourceControlConfigurationClientImpl with the provided parameters. - * - * @return an instance of SourceControlConfigurationClientImpl. - */ - public SourceControlConfigurationClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } - SourceControlConfigurationClientImpl client = - new SourceControlConfigurationClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); - return client; - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientImpl.java deleted file mode 100644 index 0ca2fdb4a8873..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationClientImpl.java +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.OperationsClient; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.SourceControlConfigurationClient; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.SourceControlConfigurationsClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Map; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the SourceControlConfigurationClientImpl type. */ -@ServiceClient(builder = SourceControlConfigurationClientBuilder.class) -public final class SourceControlConfigurationClientImpl implements SourceControlConfigurationClient { - private final ClientLogger logger = new ClientLogger(SourceControlConfigurationClientImpl.class); - - /** The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ - private final String subscriptionId; - - /** - * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The SourceControlConfigurationsClient object to access its operations. */ - private final SourceControlConfigurationsClient sourceControlConfigurations; - - /** - * Gets the SourceControlConfigurationsClient object to access its operations. - * - * @return the SourceControlConfigurationsClient object. - */ - public SourceControlConfigurationsClient getSourceControlConfigurations() { - return this.sourceControlConfigurations; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * Initializes an instance of SourceControlConfigurationClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000). - * @param endpoint server parameter. - */ - SourceControlConfigurationClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; - this.sourceControlConfigurations = new SourceControlConfigurationsClientImpl(this); - this.operations = new OperationsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationImpl.java deleted file mode 100644 index ac0dec7a30d91..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.ComplianceStatus; -import com.azure.resourcemanager.kubernetesconfiguration.models.HelmOperatorProperties; -import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorScopeType; -import com.azure.resourcemanager.kubernetesconfiguration.models.OperatorType; -import com.azure.resourcemanager.kubernetesconfiguration.models.ProvisioningStateType; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfiguration; -import java.util.Collections; -import java.util.Map; - -public final class SourceControlConfigurationImpl implements SourceControlConfiguration { - private SourceControlConfigurationInner innerObject; - - private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; - - SourceControlConfigurationImpl( - SourceControlConfigurationInner innerObject, - com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager 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 repositoryUrl() { - return this.innerModel().repositoryUrl(); - } - - public String operatorNamespace() { - return this.innerModel().operatorNamespace(); - } - - public String operatorInstanceName() { - return this.innerModel().operatorInstanceName(); - } - - public OperatorType operatorType() { - return this.innerModel().operatorType(); - } - - public String operatorParams() { - return this.innerModel().operatorParams(); - } - - public Map configurationProtectedSettings() { - Map inner = this.innerModel().configurationProtectedSettings(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public OperatorScopeType operatorScope() { - return this.innerModel().operatorScope(); - } - - public String repositoryPublicKey() { - return this.innerModel().repositoryPublicKey(); - } - - public String sshKnownHostsContents() { - return this.innerModel().sshKnownHostsContents(); - } - - public Boolean enableHelmOperator() { - return this.innerModel().enableHelmOperator(); - } - - public HelmOperatorProperties helmOperatorProperties() { - return this.innerModel().helmOperatorProperties(); - } - - public ProvisioningStateType provisioningState() { - return this.innerModel().provisioningState(); - } - - public ComplianceStatus complianceStatus() { - return this.innerModel().complianceStatus(); - } - - public SourceControlConfigurationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsClientImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsClientImpl.java deleted file mode 100644 index f69a98896ce65..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsClientImpl.java +++ /dev/null @@ -1,1380 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.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.kubernetesconfiguration.fluent.SourceControlConfigurationsClient; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurationList; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurationsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurationsClusterRp; -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 SourceControlConfigurationsClient. */ -public final class SourceControlConfigurationsClientImpl implements SourceControlConfigurationsClient { - private final ClientLogger logger = new ClientLogger(SourceControlConfigurationsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final SourceControlConfigurationsService service; - - /** The service client containing this operation class. */ - private final SourceControlConfigurationClientImpl client; - - /** - * Initializes an instance of SourceControlConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SourceControlConfigurationsClientImpl(SourceControlConfigurationClientImpl client) { - this.service = - RestProxy - .create( - SourceControlConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SourceControlConfigurationClientSourceControlConfigurations to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SourceControlConfigu") - private interface SourceControlConfigurationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" - + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration" - + "/sourceControlConfigurations/{sourceControlConfigurationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") SourceControlConfigurationsClusterRp clusterRp, - @PathParam("clusterResourceName") SourceControlConfigurationsClusterResourceName clusterResourceName, - @PathParam("clusterName") String clusterName, - @PathParam("sourceControlConfigurationName") String sourceControlConfigurationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" - + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration" - + "/sourceControlConfigurations/{sourceControlConfigurationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") SourceControlConfigurationsClusterRp clusterRp, - @PathParam("clusterResourceName") SourceControlConfigurationsClusterResourceName clusterResourceName, - @PathParam("clusterName") String clusterName, - @PathParam("sourceControlConfigurationName") String sourceControlConfigurationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SourceControlConfigurationInner sourceControlConfiguration, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" - + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration" - + "/sourceControlConfigurations/{sourceControlConfigurationName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") SourceControlConfigurationsClusterRp clusterRp, - @PathParam("clusterResourceName") SourceControlConfigurationsClusterResourceName clusterResourceName, - @PathParam("clusterName") String clusterName, - @PathParam("sourceControlConfigurationName") String sourceControlConfigurationName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}" - + "/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration" - + "/sourceControlConfigurations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("clusterRp") SourceControlConfigurationsClusterRp clusterRp, - @PathParam("clusterResourceName") SourceControlConfigurationsClusterResourceName clusterResourceName, - @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the Source Control Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - 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 (clusterRp == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); - } - if (clusterResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (sourceControlConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sourceControlConfigurationName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - this.client.getApiVersion(), - accept, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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 details of the Source Control Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - 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 (clusterRp == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); - } - if (clusterResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (sourceControlConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sourceControlConfigurationName 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, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the Source Control Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - return getWithResponseAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the Source Control Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SourceControlConfigurationInner get( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - return getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) - .block(); - } - - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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 details of the Source Control Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context) { - return getWithResponseAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, context) - .block(); - } - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 SourceControl Configuration object returned in Get & Put response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration) { - 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 (clusterRp == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); - } - if (clusterResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (sourceControlConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sourceControlConfigurationName is required and cannot be null.")); - } - if (sourceControlConfiguration == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sourceControlConfiguration is required and cannot be null.")); - } else { - sourceControlConfiguration.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - this.client.getApiVersion(), - sourceControlConfiguration, - accept, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @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 SourceControl Configuration object returned in Get & Put response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration, - 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 (clusterRp == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); - } - if (clusterResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (sourceControlConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sourceControlConfigurationName is required and cannot be null.")); - } - if (sourceControlConfiguration == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sourceControlConfiguration is required and cannot be null.")); - } else { - sourceControlConfiguration.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - this.client.getApiVersion(), - sourceControlConfiguration, - accept, - context); - } - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 SourceControl Configuration object returned in Get & Put response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration) { - return createOrUpdateWithResponseAsync( - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - sourceControlConfiguration) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 SourceControl Configuration object returned in Get & Put response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SourceControlConfigurationInner createOrUpdate( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration) { - return createOrUpdateAsync( - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - sourceControlConfiguration) - .block(); - } - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @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 SourceControl Configuration object returned in Get & Put response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - sourceControlConfiguration, - context) - .block(); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - 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 (clusterRp == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); - } - if (clusterResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (sourceControlConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sourceControlConfigurationName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - this.client.getApiVersion(), - accept, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - 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 (clusterRp == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); - } - if (clusterResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null.")); - } - if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - if (sourceControlConfigurationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter sourceControlConfigurationName 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, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - this.client.getApiVersion(), - accept, - context); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - return beginDeleteAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) - .getSyncPoller(); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context) { - return beginDeleteAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, context) - .getSyncPoller(); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - return beginDeleteAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context) { - return beginDeleteAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - deleteAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) - .block(); - } - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context) { - deleteAsync( - resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, context) - .block(); - } - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - 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 (clusterRp == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); - } - if (clusterResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter clusterResourceName 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, - clusterRp, - clusterResourceName, - clusterName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - 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 (clusterRp == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterRp is required and cannot be null.")); - } - if (clusterResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter clusterResourceName 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, - clusterRp, - clusterResourceName, - clusterName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName)); - } - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * 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 result of the request to list Source Control Configurations. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsImpl.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsImpl.java deleted file mode 100644 index 002655428ad4f..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/SourceControlConfigurationsImpl.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.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.kubernetesconfiguration.fluent.SourceControlConfigurationsClient; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfiguration; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurations; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurationsClusterResourceName; -import com.azure.resourcemanager.kubernetesconfiguration.models.SourceControlConfigurationsClusterRp; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class SourceControlConfigurationsImpl implements SourceControlConfigurations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlConfigurationsImpl.class); - - private final SourceControlConfigurationsClient innerClient; - - private final com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager; - - public SourceControlConfigurationsImpl( - SourceControlConfigurationsClient innerClient, - com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public SourceControlConfiguration get( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - SourceControlConfigurationInner inner = - this - .serviceClient() - .get(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName); - if (inner != null) { - return new SourceControlConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SourceControlConfigurationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SourceControlConfiguration createOrUpdate( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration) { - SourceControlConfigurationInner inner = - this - .serviceClient() - .createOrUpdate( - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - sourceControlConfiguration); - if (inner != null) { - return new SourceControlConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - sourceControlConfiguration, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SourceControlConfigurationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName) { - this - .serviceClient() - .delete(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName); - } - - public void delete( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context) { - this - .serviceClient() - .delete( - resourceGroupName, - clusterRp, - clusterResourceName, - clusterName, - sourceControlConfigurationName, - context); - } - - public PagedIterable list( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName); - return Utils.mapPage(inner, inner1 -> new SourceControlConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, clusterRp, clusterResourceName, clusterName, context); - return Utils.mapPage(inner, inner1 -> new SourceControlConfigurationImpl(inner1, this.manager())); - } - - private SourceControlConfigurationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.kubernetesconfiguration.SourceControlConfigurationManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/Utils.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/Utils.java deleted file mode 100644 index 49c478b9a7373..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/Utils.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class Utils { - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/package-info.java deleted file mode 100644 index 9f3e2d42c09ff..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/implementation/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the implementations for SourceControlConfigurationClient. KubernetesConfiguration Client. */ -package com.azure.resourcemanager.kubernetesconfiguration.implementation; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStateType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStateType.java deleted file mode 100644 index fe79e77156cd3..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStateType.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ComplianceStateType. */ -public final class ComplianceStateType extends ExpandableStringEnum { - /** Static value Pending for ComplianceStateType. */ - public static final ComplianceStateType PENDING = fromString("Pending"); - - /** Static value Compliant for ComplianceStateType. */ - public static final ComplianceStateType COMPLIANT = fromString("Compliant"); - - /** Static value Noncompliant for ComplianceStateType. */ - public static final ComplianceStateType NONCOMPLIANT = fromString("Noncompliant"); - - /** Static value Installed for ComplianceStateType. */ - public static final ComplianceStateType INSTALLED = fromString("Installed"); - - /** Static value Failed for ComplianceStateType. */ - public static final ComplianceStateType FAILED = fromString("Failed"); - - /** - * Creates or finds a ComplianceStateType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ComplianceStateType. - */ - @JsonCreator - public static ComplianceStateType fromString(String name) { - return fromString(name, ComplianceStateType.class); - } - - /** @return known ComplianceStateType values. */ - public static Collection values() { - return values(ComplianceStateType.class); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStatus.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStatus.java deleted file mode 100644 index c7baffee43f2a..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ComplianceStatus.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.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.time.OffsetDateTime; - -/** Compliance Status details. */ -@Fluent -public final class ComplianceStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ComplianceStatus.class); - - /* - * The compliance state of the configuration. - */ - @JsonProperty(value = "complianceState", access = JsonProperty.Access.WRITE_ONLY) - private ComplianceStateType complianceState; - - /* - * Datetime the configuration was last applied. - */ - @JsonProperty(value = "lastConfigApplied") - private OffsetDateTime lastConfigApplied; - - /* - * Message from when the configuration was applied. - */ - @JsonProperty(value = "message") - private String message; - - /* - * Level of the message. - */ - @JsonProperty(value = "messageLevel") - private MessageLevelType messageLevel; - - /** - * Get the complianceState property: The compliance state of the configuration. - * - * @return the complianceState value. - */ - public ComplianceStateType complianceState() { - return this.complianceState; - } - - /** - * Get the lastConfigApplied property: Datetime the configuration was last applied. - * - * @return the lastConfigApplied value. - */ - public OffsetDateTime lastConfigApplied() { - return this.lastConfigApplied; - } - - /** - * Set the lastConfigApplied property: Datetime the configuration was last applied. - * - * @param lastConfigApplied the lastConfigApplied value to set. - * @return the ComplianceStatus object itself. - */ - public ComplianceStatus withLastConfigApplied(OffsetDateTime lastConfigApplied) { - this.lastConfigApplied = lastConfigApplied; - return this; - } - - /** - * Get the message property: Message from when the configuration was applied. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Message from when the configuration was applied. - * - * @param message the message value to set. - * @return the ComplianceStatus object itself. - */ - public ComplianceStatus withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the messageLevel property: Level of the message. - * - * @return the messageLevel value. - */ - public MessageLevelType messageLevel() { - return this.messageLevel; - } - - /** - * Set the messageLevel property: Level of the message. - * - * @param messageLevel the messageLevel value to set. - * @return the ComplianceStatus object itself. - */ - public ComplianceStatus withMessageLevel(MessageLevelType messageLevel) { - this.messageLevel = messageLevel; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmOperatorProperties.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmOperatorProperties.java deleted file mode 100644 index 7b51cd3f8b3c6..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/HelmOperatorProperties.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.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; - -/** Properties for Helm operator. */ -@Fluent -public final class HelmOperatorProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(HelmOperatorProperties.class); - - /* - * Version of the operator Helm chart. - */ - @JsonProperty(value = "chartVersion") - private String chartVersion; - - /* - * Values override for the operator Helm chart. - */ - @JsonProperty(value = "chartValues") - private String chartValues; - - /** - * Get the chartVersion property: Version of the operator Helm chart. - * - * @return the chartVersion value. - */ - public String chartVersion() { - return this.chartVersion; - } - - /** - * Set the chartVersion property: Version of the operator Helm chart. - * - * @param chartVersion the chartVersion value to set. - * @return the HelmOperatorProperties object itself. - */ - public HelmOperatorProperties withChartVersion(String chartVersion) { - this.chartVersion = chartVersion; - return this; - } - - /** - * Get the chartValues property: Values override for the operator Helm chart. - * - * @return the chartValues value. - */ - public String chartValues() { - return this.chartValues; - } - - /** - * Set the chartValues property: Values override for the operator Helm chart. - * - * @param chartValues the chartValues value to set. - * @return the HelmOperatorProperties object itself. - */ - public HelmOperatorProperties withChartValues(String chartValues) { - this.chartValues = chartValues; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/MessageLevelType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/MessageLevelType.java deleted file mode 100644 index 6fc8db2a7b7f4..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/MessageLevelType.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for MessageLevelType. */ -public final class MessageLevelType extends ExpandableStringEnum { - /** Static value Error for MessageLevelType. */ - public static final MessageLevelType ERROR = fromString("Error"); - - /** Static value Warning for MessageLevelType. */ - public static final MessageLevelType WARNING = fromString("Warning"); - - /** Static value Information for MessageLevelType. */ - public static final MessageLevelType INFORMATION = fromString("Information"); - - /** - * Creates or finds a MessageLevelType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MessageLevelType. - */ - @JsonCreator - public static MessageLevelType fromString(String name) { - return fromString(name, MessageLevelType.class); - } - - /** @return known MessageLevelType values. */ - public static Collection values() { - return values(MessageLevelType.class); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Operations.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Operations.java deleted file mode 100644 index a085c84c1d275..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Operations.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Operations. */ -public interface Operations { - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @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 result of the request to list operations. - */ - PagedIterable list(); - - /** - * List all the available operations the KubernetesConfiguration resource provider supports. - * - * @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 result of the request to list operations. - */ - PagedIterable list(Context context); -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorScopeType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorScopeType.java deleted file mode 100644 index 2f7bb7464a80f..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorScopeType.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OperatorScopeType. */ -public final class OperatorScopeType extends ExpandableStringEnum { - /** Static value cluster for OperatorScopeType. */ - public static final OperatorScopeType CLUSTER = fromString("cluster"); - - /** Static value namespace for OperatorScopeType. */ - public static final OperatorScopeType NAMESPACE = fromString("namespace"); - - /** - * Creates or finds a OperatorScopeType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperatorScopeType. - */ - @JsonCreator - public static OperatorScopeType fromString(String name) { - return fromString(name, OperatorScopeType.class); - } - - /** @return known OperatorScopeType values. */ - public static Collection values() { - return values(OperatorScopeType.class); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorType.java deleted file mode 100644 index 984777577f852..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/OperatorType.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for OperatorType. */ -public final class OperatorType extends ExpandableStringEnum { - /** Static value Flux for OperatorType. */ - public static final OperatorType FLUX = fromString("Flux"); - - /** - * Creates or finds a OperatorType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperatorType. - */ - @JsonCreator - public static OperatorType fromString(String name) { - return fromString(name, OperatorType.class); - } - - /** @return known OperatorType values. */ - public static Collection values() { - return values(OperatorType.class); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ProvisioningStateType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ProvisioningStateType.java deleted file mode 100644 index 3ba7b515a1c24..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ProvisioningStateType.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ProvisioningStateType. */ -public final class ProvisioningStateType extends ExpandableStringEnum { - /** Static value Accepted for ProvisioningStateType. */ - public static final ProvisioningStateType ACCEPTED = fromString("Accepted"); - - /** Static value Deleting for ProvisioningStateType. */ - public static final ProvisioningStateType DELETING = fromString("Deleting"); - - /** Static value Running for ProvisioningStateType. */ - public static final ProvisioningStateType RUNNING = fromString("Running"); - - /** Static value Succeeded for ProvisioningStateType. */ - public static final ProvisioningStateType SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for ProvisioningStateType. */ - public static final ProvisioningStateType FAILED = fromString("Failed"); - - /** - * Creates or finds a ProvisioningStateType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningStateType. - */ - @JsonCreator - public static ProvisioningStateType fromString(String name) { - return fromString(name, ProvisioningStateType.class); - } - - /** @return known ProvisioningStateType values. */ - public static Collection values() { - return values(ProvisioningStateType.class); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperation.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperation.java deleted file mode 100644 index 6121074ccac1e..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperation.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ResourceProviderOperationInner; - -/** An immutable client-side representation of ResourceProviderOperation. */ -public interface ResourceProviderOperation { - /** - * Gets the name property: Operation name, in format of {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: Display metadata associated with the operation. - * - * @return the display value. - */ - ResourceProviderOperationDisplay display(); - - /** - * Gets the isDataAction property: The flag that indicates whether the operation applies to data plane. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the inner com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ResourceProviderOperationInner - * object. - * - * @return the inner object. - */ - ResourceProviderOperationInner innerModel(); -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperationDisplay.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperationDisplay.java deleted file mode 100644 index 33fe8b8b658c7..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.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; - -/** Display metadata associated with the operation. */ -@Fluent -public final class ResourceProviderOperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderOperationDisplay.class); - - /* - * Resource provider: Microsoft KubernetesConfiguration. - */ - @JsonProperty(value = "provider") - private String provider; - - /* - * Resource on which the operation is performed. - */ - @JsonProperty(value = "resource") - private String resource; - - /* - * Type of operation: get, read, delete, etc. - */ - @JsonProperty(value = "operation") - private String operation; - - /* - * Description of this operation. - */ - @JsonProperty(value = "description") - private String description; - - /** - * Get the provider property: Resource provider: Microsoft KubernetesConfiguration. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Resource provider: Microsoft KubernetesConfiguration. - * - * @param provider the provider value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Resource on which the operation is performed. - * - * @param resource the resource value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Type of operation: get, read, delete, etc. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Type of operation: get, read, delete, etc. - * - * @param operation the operation value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of this operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of this operation. - * - * @param description the description value to set. - * @return the ResourceProviderOperationDisplay object itself. - */ - public ResourceProviderOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperationList.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperationList.java deleted file mode 100644 index b07191661bb3f..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/ResourceProviderOperationList.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ResourceProviderOperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of the request to list operations. */ -@Fluent -public final class ResourceProviderOperationList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProviderOperationList.class); - - /* - * List of operations supported by this resource provider. - */ - @JsonProperty(value = "value") - private List value; - - /* - * URL to the next set of results, if any. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of operations supported by this resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of operations supported by this resource provider. - * - * @param value the value value to set. - * @return the ResourceProviderOperationList object itself. - */ - public ResourceProviderOperationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to the next set of results, if any. - * - * @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) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfiguration.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfiguration.java deleted file mode 100644 index ddbf2b65c02bc..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfiguration.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; -import java.util.Map; - -/** An immutable client-side representation of SourceControlConfiguration. */ -public interface SourceControlConfiguration { - /** - * 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: Top level metadata - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the repositoryUrl property: Url of the SourceControl Repository. - * - * @return the repositoryUrl value. - */ - String repositoryUrl(); - - /** - * Gets the operatorNamespace property: The namespace to which this operator is installed to. Maximum of 253 lower - * case alphanumeric characters, hyphen and period only. - * - * @return the operatorNamespace value. - */ - String operatorNamespace(); - - /** - * Gets the operatorInstanceName property: Instance name of the operator - identifying the specific configuration. - * - * @return the operatorInstanceName value. - */ - String operatorInstanceName(); - - /** - * Gets the operatorType property: Type of the operator. - * - * @return the operatorType value. - */ - OperatorType operatorType(); - - /** - * Gets the operatorParams property: Any Parameters for the Operator instance in string format. - * - * @return the operatorParams value. - */ - String operatorParams(); - - /** - * Gets the configurationProtectedSettings property: Name-value pairs of protected configuration settings for the - * configuration. - * - * @return the configurationProtectedSettings value. - */ - Map configurationProtectedSettings(); - - /** - * Gets the operatorScope property: Scope at which the operator will be installed. - * - * @return the operatorScope value. - */ - OperatorScopeType operatorScope(); - - /** - * Gets the repositoryPublicKey property: Public Key associated with this SourceControl configuration (either - * generated within the cluster or provided by the user). - * - * @return the repositoryPublicKey value. - */ - String repositoryPublicKey(); - - /** - * Gets the sshKnownHostsContents property: Base64-encoded known_hosts contents containing public SSH keys required - * to access private Git instances. - * - * @return the sshKnownHostsContents value. - */ - String sshKnownHostsContents(); - - /** - * Gets the enableHelmOperator property: Option to enable Helm Operator for this git configuration. - * - * @return the enableHelmOperator value. - */ - Boolean enableHelmOperator(); - - /** - * Gets the helmOperatorProperties property: Properties for Helm operator. - * - * @return the helmOperatorProperties value. - */ - HelmOperatorProperties helmOperatorProperties(); - - /** - * Gets the provisioningState property: The provisioning state of the resource provider. - * - * @return the provisioningState value. - */ - ProvisioningStateType provisioningState(); - - /** - * Gets the complianceStatus property: Compliance Status of the Configuration. - * - * @return the complianceStatus value. - */ - ComplianceStatus complianceStatus(); - - /** - * Gets the inner com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner - * object. - * - * @return the inner object. - */ - SourceControlConfigurationInner innerModel(); -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationList.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationList.java deleted file mode 100644 index e6f135d505baa..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationList.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects - * and a URL link to get the next set of results. - */ -@Immutable -public final class SourceControlConfigurationList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlConfigurationList.class); - - /* - * List of Source Control Configurations within a Kubernetes cluster. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to get the next set of configuration objects, if any. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** - * Get the value property: List of Source Control Configurations within a Kubernetes cluster. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to get the next set of configuration objects, if any. - * - * @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) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurations.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurations.java deleted file mode 100644 index caf2d5294bdbd..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurations.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.SourceControlConfigurationInner; - -/** Resource collection API of SourceControlConfigurations. */ -public interface SourceControlConfigurations { - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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 details of the Source Control Configuration. - */ - SourceControlConfiguration get( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName); - - /** - * Gets details of the Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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 details of the Source Control Configuration. - */ - Response getWithResponse( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context); - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @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 SourceControl Configuration object returned in Get & Put response. - */ - SourceControlConfiguration createOrUpdate( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration); - - /** - * Create a new Kubernetes Source Control Configuration. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. - * @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 SourceControl Configuration object returned in Get & Put response. - */ - Response createOrUpdateWithResponse( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - SourceControlConfigurationInner sourceControlConfiguration, - Context context); - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName); - - /** - * This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from - * the source repo. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes cluster. - * @param sourceControlConfigurationName Name of the Source Control Configuration. - * @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, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - String sourceControlConfigurationName, - Context context); - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - PagedIterable list( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName); - - /** - * List all Source Control Configurations. - * - * @param resourceGroupName The name of the resource group. - * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or - * Microsoft.Kubernetes (for OnPrem K8S clusters). - * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or - * connectedClusters (for OnPrem K8S clusters). - * @param clusterName The name of the kubernetes 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 result of the request to list Source Control Configurations. - */ - PagedIterable list( - String resourceGroupName, - SourceControlConfigurationsClusterRp clusterRp, - SourceControlConfigurationsClusterResourceName clusterResourceName, - String clusterName, - Context context); -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationsClusterResourceName.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationsClusterResourceName.java deleted file mode 100644 index 6541e224413c1..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationsClusterResourceName.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SourceControlConfigurationsClusterResourceName. */ -public final class SourceControlConfigurationsClusterResourceName - extends ExpandableStringEnum { - /** Static value managedClusters for SourceControlConfigurationsClusterResourceName. */ - public static final SourceControlConfigurationsClusterResourceName MANAGED_CLUSTERS = fromString("managedClusters"); - - /** Static value connectedClusters for SourceControlConfigurationsClusterResourceName. */ - public static final SourceControlConfigurationsClusterResourceName CONNECTED_CLUSTERS = - fromString("connectedClusters"); - - /** - * Creates or finds a SourceControlConfigurationsClusterResourceName from its string representation. - * - * @param name a name to look for. - * @return the corresponding SourceControlConfigurationsClusterResourceName. - */ - @JsonCreator - public static SourceControlConfigurationsClusterResourceName fromString(String name) { - return fromString(name, SourceControlConfigurationsClusterResourceName.class); - } - - /** @return known SourceControlConfigurationsClusterResourceName values. */ - public static Collection values() { - return values(SourceControlConfigurationsClusterResourceName.class); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationsClusterRp.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationsClusterRp.java deleted file mode 100644 index b74cbd1dbbb29..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/SourceControlConfigurationsClusterRp.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.kubernetesconfiguration.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SourceControlConfigurationsClusterRp. */ -public final class SourceControlConfigurationsClusterRp - extends ExpandableStringEnum { - /** Static value Microsoft.ContainerService for SourceControlConfigurationsClusterRp. */ - public static final SourceControlConfigurationsClusterRp MICROSOFT_CONTAINER_SERVICE = - fromString("Microsoft.ContainerService"); - - /** Static value Microsoft.Kubernetes for SourceControlConfigurationsClusterRp. */ - public static final SourceControlConfigurationsClusterRp MICROSOFT_KUBERNETES = fromString("Microsoft.Kubernetes"); - - /** - * Creates or finds a SourceControlConfigurationsClusterRp from its string representation. - * - * @param name a name to look for. - * @return the corresponding SourceControlConfigurationsClusterRp. - */ - @JsonCreator - public static SourceControlConfigurationsClusterRp fromString(String name) { - return fromString(name, SourceControlConfigurationsClusterRp.class); - } - - /** @return known SourceControlConfigurationsClusterRp values. */ - public static Collection values() { - return values(SourceControlConfigurationsClusterRp.class); - } -} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/package-info.java deleted file mode 100644 index 05e684c55d598..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for SourceControlConfigurationClient. KubernetesConfiguration Client. */ -package com.azure.resourcemanager.kubernetesconfiguration.models; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/package-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/package-info.java deleted file mode 100644 index e3549dcac844d..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for SourceControlConfigurationClient. KubernetesConfiguration Client. */ -package com.azure.resourcemanager.kubernetesconfiguration; diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/module-info.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/module-info.java deleted file mode 100644 index e8aedbd68e7ae..0000000000000 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/module-info.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -module com.azure.resourcemanager.kubernetesconfiguration { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.kubernetesconfiguration; - exports com.azure.resourcemanager.kubernetesconfiguration.fluent; - exports com.azure.resourcemanager.kubernetesconfiguration.fluent.models; - exports com.azure.resourcemanager.kubernetesconfiguration.models; - - opens com.azure.resourcemanager.kubernetesconfiguration.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.kubernetesconfiguration.models to - com.azure.core, - com.fasterxml.jackson.databind; -}