From d908a3a9e548d7b9911e09431ebb04a6e56eca28 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 11 Aug 2020 22:00:51 +0000 Subject: [PATCH] Generated from bdc2d880473a600ccc03b2806aabce463fceef8e Add Extension Identity --- .../mgmt-v2020_07_01_preview/pom.xml | 135 +++ .../ComplianceStateType.java | 50 ++ .../v2020_07_01_preview/ComplianceStatus.java | 113 +++ .../ConfigurationIdentity.java | 78 ++ .../v2020_07_01_preview/ErrorDefinition.java | 70 ++ .../v2020_07_01_preview/ErrorResponse.java | 43 + .../ErrorResponseException.java | 44 + .../ExtensionInstance.java | 310 +++++++ .../ExtensionInstanceForCreate.java | 237 ++++++ .../ExtensionInstanceForList.java | 90 ++ .../ExtensionInstanceUpdate.java | 101 +++ .../v2020_07_01_preview/ExtensionStatus.java | 148 ++++ .../v2020_07_01_preview/Extensions.java | 59 ++ .../HelmOperatorProperties.java | 69 ++ .../v2020_07_01_preview/InstallStateType.java | 44 + .../v2020_07_01_preview/LevelType.java | 44 + .../v2020_07_01_preview/MessageLevelType.java | 44 + .../v2020_07_01_preview/Operations.java | 27 + .../OperatorScopeType.java | 41 + .../v2020_07_01_preview/OperatorType.java | 38 + .../ProvisioningStateType.java | 50 ++ .../ResourceIdentityType.java | 53 ++ .../ResourceProviderOperation.java | 30 + .../ResourceProviderOperationDisplay.java | 121 +++ .../v2020_07_01_preview/Result.java | 43 + .../v2020_07_01_preview/Scope.java | 70 ++ .../v2020_07_01_preview/ScopeCluster.java | 45 + .../v2020_07_01_preview/ScopeNamespace.java | 45 + .../SourceControlConfiguration.java | 393 +++++++++ .../SourceControlConfigurationForCreate.java | 274 ++++++ .../SourceControlConfigurations.java | 59 ++ .../ExtensionInstanceForListImpl.java | 100 +++ .../ExtensionInstanceForListInner.java | 275 ++++++ .../implementation/ExtensionInstanceImpl.java | 269 ++++++ .../ExtensionInstanceInner.java | 331 ++++++++ .../implementation/ExtensionsImpl.java | 82 ++ .../implementation/ExtensionsInner.java | 787 ++++++++++++++++++ .../implementation/IdParsingUtils.java | 57 ++ .../KubernetesConfigurationManager.java | 123 +++ .../implementation/OperationsImpl.java | 49 ++ .../implementation/OperationsInner.java | 283 +++++++ .../implementation/PageImpl.java | 75 ++ .../ResourceProviderOperationImpl.java | 37 + .../ResourceProviderOperationInner.java | 70 ++ .../SourceControlConfigurationClientImpl.java | 224 +++++ .../SourceControlConfigurationImpl.java | 257 ++++++ .../SourceControlConfigurationInner.java | 314 +++++++ .../SourceControlConfigurationsImpl.java | 81 ++ .../SourceControlConfigurationsInner.java | 760 +++++++++++++++++ .../implementation/package-info.java | 11 + .../v2020_07_01_preview/package-info.java | 11 + 51 files changed, 7164 insertions(+) create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/pom.xml create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ComplianceStateType.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ComplianceStatus.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ConfigurationIdentity.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorDefinition.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorResponse.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorResponseException.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstance.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceForCreate.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceForList.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceUpdate.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionStatus.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Extensions.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/HelmOperatorProperties.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/InstallStateType.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/LevelType.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/MessageLevelType.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Operations.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/OperatorScopeType.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/OperatorType.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ProvisioningStateType.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceIdentityType.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceProviderOperation.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceProviderOperationDisplay.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Result.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Scope.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ScopeCluster.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ScopeNamespace.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfiguration.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfigurationForCreate.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfigurations.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceForListImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceForListInner.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceInner.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionsImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionsInner.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/IdParsingUtils.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/KubernetesConfigurationManager.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/OperationsImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/OperationsInner.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/PageImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ResourceProviderOperationImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ResourceProviderOperationInner.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationClientImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationInner.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationsImpl.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationsInner.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/package-info.java create mode 100644 sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/package-info.java diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/pom.xml b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/pom.xml new file mode 100644 index 0000000000000..f30327ed49dbe --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.kubernetesconfiguration.v2020_07_01_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-kubernetesconfiguration + 1.0.0-beta + jar + Microsoft Azure SDK for KubernetesConfiguration Management + This package contains Microsoft KubernetesConfiguration Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ComplianceStateType.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ComplianceStateType.java new file mode 100644 index 0000000000000..1eac07ae5c5a4 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ComplianceStateType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ComplianceStatus.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ComplianceStatus.java new file mode 100644 index 0000000000000..bc6ffc1b2f2d3 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ComplianceStatus.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Compliance Status details. + */ +public class ComplianceStatus { + /** + * The compliance state of the configuration. Possible values include: + * 'Pending', 'Compliant', 'Noncompliant', 'Installed', 'Failed'. + */ + @JsonProperty(value = "complianceState", access = JsonProperty.Access.WRITE_ONLY) + private ComplianceStateType complianceState; + + /** + * Datetime the configuration was last applied. + */ + @JsonProperty(value = "lastConfigApplied") + private DateTime lastConfigApplied; + + /** + * Message from when the configuration was applied. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Level of the message. Possible values include: 'Error', 'Warning', + * 'Information'. + */ + @JsonProperty(value = "messageLevel") + private MessageLevelType messageLevel; + + /** + * Get the compliance state of the configuration. Possible values include: 'Pending', 'Compliant', 'Noncompliant', 'Installed', 'Failed'. + * + * @return the complianceState value + */ + public ComplianceStateType complianceState() { + return this.complianceState; + } + + /** + * Get datetime the configuration was last applied. + * + * @return the lastConfigApplied value + */ + public DateTime lastConfigApplied() { + return this.lastConfigApplied; + } + + /** + * Set datetime the configuration was last applied. + * + * @param lastConfigApplied the lastConfigApplied value to set + * @return the ComplianceStatus object itself. + */ + public ComplianceStatus withLastConfigApplied(DateTime lastConfigApplied) { + this.lastConfigApplied = lastConfigApplied; + return this; + } + + /** + * Get message from when the configuration was applied. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set 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 level of the message. Possible values include: 'Error', 'Warning', 'Information'. + * + * @return the messageLevel value + */ + public MessageLevelType messageLevel() { + return this.messageLevel; + } + + /** + * Set level of the message. Possible values include: 'Error', 'Warning', 'Information'. + * + * @param messageLevel the messageLevel value to set + * @return the ComplianceStatus object itself. + */ + public ComplianceStatus withMessageLevel(MessageLevelType messageLevel) { + this.messageLevel = messageLevel; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ConfigurationIdentity.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ConfigurationIdentity.java new file mode 100644 index 0000000000000..571cdbd35a7a3 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ConfigurationIdentity.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the managed cluster. + */ +public class ConfigurationIdentity { + /** + * The principal id of the system assigned identity which is used by the + * configuration. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id of the system assigned identity which is used by the + * configuration. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The type of identity used for the configuration. Type 'SystemAssigned' + * will use an implicitly created identity. Type 'None' will not use + * Managed Identity for the configuraiton. Possible values include: + * 'SystemAssigned', 'None'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principal id of the system assigned identity which is used by the configuration. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant id of the system assigned identity which is used by the configuration. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly created identity. Type 'None' will not use Managed Identity for the configuraiton. Possible values include: 'SystemAssigned', 'None'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type of identity used for the configuration. Type 'SystemAssigned' will use an implicitly created identity. Type 'None' will not use Managed Identity for the configuraiton. Possible values include: 'SystemAssigned', 'None'. + * + * @param type the type value to set + * @return the ConfigurationIdentity object itself. + */ + public ConfigurationIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorDefinition.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorDefinition.java new file mode 100644 index 0000000000000..00d8582fea9b7 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorDefinition.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error definition. + */ +public class ErrorDefinition { + /** + * Service specific error code which serves as the substatus for the HTTP + * error code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * Description of the error. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Get service specific error code which serves as the substatus for the HTTP error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set service specific error code which serves as the substatus for the HTTP error code. + * + * @param code the code value to set + * @return the ErrorDefinition object itself. + */ + public ErrorDefinition withCode(String code) { + this.code = code; + return this; + } + + /** + * Get description of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set description of the error. + * + * @param message the message value to set + * @return the ErrorDefinition object itself. + */ + public ErrorDefinition withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorResponse.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorResponse.java new file mode 100644 index 0000000000000..0f4d173d60ed9 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response. + */ +public class ErrorResponse { + /** + * Error definition. + */ + @JsonProperty(value = "error") + private ErrorDefinition error; + + /** + * Get error definition. + * + * @return the error value + */ + public ErrorDefinition error() { + return this.error; + } + + /** + * Set error definition. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDefinition error) { + this.error = error; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorResponseException.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorResponseException.java new file mode 100644 index 0000000000000..7b4c0d33184fd --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstance.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstance.java new file mode 100644 index 0000000000000..e1289cab251d1 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstance.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.ExtensionInstanceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.KubernetesConfigurationManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing ExtensionInstance. + */ +public interface ExtensionInstance extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * @return the configurationSettings value. + */ + Map configurationSettings(); + + /** + * @return the creationTime value. + */ + String creationTime(); + + /** + * @return the errorInfo value. + */ + ErrorDefinition errorInfo(); + + /** + * @return the extensionType value. + */ + String extensionType(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the identity value. + */ + ConfigurationIdentity identity(); + + /** + * @return the installState value. + */ + InstallStateType installState(); + + /** + * @return the lastModifiedTime value. + */ + String lastModifiedTime(); + + /** + * @return the lastStatusTime value. + */ + String lastStatusTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the releaseTrain value. + */ + String releaseTrain(); + + /** + * @return the scope value. + */ + Scope scope(); + + /** + * @return the statuses value. + */ + List statuses(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + + /** + * The entirety of the ExtensionInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProvider, DefinitionStages.WithClusterResourceName, DefinitionStages.WithClusterName, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExtensionInstance definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExtensionInstance definition. + */ + interface Blank extends WithProvider { + } + + /** + * The stage of the extensioninstance definition allowing to specify Provider. + */ + interface WithProvider { + /** + * Specifies resourceGroupName, clusterRp. + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @return the next definition stage + */ + WithClusterResourceName withExistingProvider(String resourceGroupName, String clusterRp); + } + + /** + * The stage of the extensioninstance definition allowing to specify ClusterResourceName. + */ + interface WithClusterResourceName { + /** + * Specifies clusterResourceName. + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @return the next definition stage + */ + WithClusterName withClusterResourceName(String clusterResourceName); + } + + /** + * The stage of the extensioninstance definition allowing to specify ClusterName. + */ + interface WithClusterName { + /** + * Specifies clusterName. + * @param clusterName The name of the kubernetes cluster + * @return the next definition stage + */ + WithCreate withClusterName(String clusterName); + } + + /** + * The stage of the extensioninstance definition allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Flag to note if this instance participates in auto upgrade of minor version, or not + * @return the next definition stage + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the extensioninstance definition allowing to specify ConfigurationProtectedSettings. + */ + interface WithConfigurationProtectedSettings { + /** + * Specifies configurationProtectedSettings. + * @param configurationProtectedSettings Configuration settings that are sensitive, as name-value pairs for configuring this instance of the extension + * @return the next definition stage + */ + WithCreate withConfigurationProtectedSettings(Map configurationProtectedSettings); + } + + /** + * The stage of the extensioninstance definition allowing to specify ConfigurationSettings. + */ + interface WithConfigurationSettings { + /** + * Specifies configurationSettings. + * @param configurationSettings Configuration settings, as name-value pairs for configuring this instance of the extension + * @return the next definition stage + */ + WithCreate withConfigurationSettings(Map configurationSettings); + } + + /** + * The stage of the extensioninstance definition allowing to specify ExtensionType. + */ + interface WithExtensionType { + /** + * Specifies extensionType. + * @param extensionType Type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher + * @return the next definition stage + */ + WithCreate withExtensionType(String extensionType); + } + + /** + * The stage of the extensioninstance definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the configuration + * @return the next definition stage + */ + WithCreate withIdentity(ConfigurationIdentity identity); + } + + /** + * The stage of the extensioninstance definition allowing to specify ReleaseTrain. + */ + interface WithReleaseTrain { + /** + * Specifies releaseTrain. + * @param releaseTrain ReleaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true' + * @return the next definition stage + */ + WithCreate withReleaseTrain(String releaseTrain); + } + + /** + * The stage of the extensioninstance definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope Scope at which the extension instance is installed + * @return the next definition stage + */ + WithCreate withScope(Scope scope); + } + + /** + * The stage of the extensioninstance definition allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + * @param version Version of the extension for this extension instance, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false' + * @return the next definition stage + */ + WithCreate withVersion(String version); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAutoUpgradeMinorVersion, DefinitionStages.WithConfigurationProtectedSettings, DefinitionStages.WithConfigurationSettings, DefinitionStages.WithExtensionType, DefinitionStages.WithIdentity, DefinitionStages.WithReleaseTrain, DefinitionStages.WithScope, DefinitionStages.WithVersion { + } + } + /** + * The template for a ExtensionInstance update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAutoUpgradeMinorVersion, UpdateStages.WithReleaseTrain, UpdateStages.WithVersion { + } + + /** + * Grouping of ExtensionInstance update stages. + */ + interface UpdateStages { + /** + * The stage of the extensioninstance update allowing to specify AutoUpgradeMinorVersion. + */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies autoUpgradeMinorVersion. + * @param autoUpgradeMinorVersion Flag to note if this instance participates in Extension Lifecycle Management or not + * @return the next update stage + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + + /** + * The stage of the extensioninstance update allowing to specify ReleaseTrain. + */ + interface WithReleaseTrain { + /** + * Specifies releaseTrain. + * @param releaseTrain ReleaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true' + * @return the next update stage + */ + Update withReleaseTrain(String releaseTrain); + } + + /** + * The stage of the extensioninstance update allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + * @param version Version number of extension, to 'pin' to a specific version. autoUpgradeMinorVersion must be 'false' + * @return the next update stage + */ + Update withVersion(String version); + } + + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceForCreate.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceForCreate.java new file mode 100644 index 0000000000000..311010bdffc6f --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceForCreate.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Object to create a new Extension Instance. + */ +@JsonFlatten +public class ExtensionInstanceForCreate extends ProxyResource { + /** + * Type of the Extension, of which this resource is an instance of. It + * must be one of the Extension Types registered with + * Microsoft.KubernetesConfiguration by the Extension publisher. + */ + @JsonProperty(value = "properties.extensionType") + private String extensionType; + + /** + * Flag to note if this instance participates in auto upgrade of minor + * version, or not. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * ReleaseTrain this extension instance participates in for auto-upgrade + * (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is + * 'true'. + */ + @JsonProperty(value = "properties.releaseTrain") + private String releaseTrain; + + /** + * Version of the extension for this extension instance, if it is 'pinned' + * to a specific version. autoUpgradeMinorVersion must be 'false'. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Scope at which the extension instance is installed. + */ + @JsonProperty(value = "properties.scope") + private Scope scope; + + /** + * Configuration settings, as name-value pairs for configuring this + * instance of the extension. + */ + @JsonProperty(value = "properties.configurationSettings") + private Map configurationSettings; + + /** + * Configuration settings that are sensitive, as name-value pairs for + * configuring this instance of the extension. + */ + @JsonProperty(value = "properties.configurationProtectedSettings") + private Map configurationProtectedSettings; + + /** + * The identity of the configuration. + */ + @JsonProperty(value = "identity") + private ConfigurationIdentity identity; + + /** + * Get type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. + * + * @return the extensionType value + */ + public String extensionType() { + return this.extensionType; + } + + /** + * Set type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. + * + * @param extensionType the extensionType value to set + * @return the ExtensionInstanceForCreate object itself. + */ + public ExtensionInstanceForCreate withExtensionType(String extensionType) { + this.extensionType = extensionType; + return this; + } + + /** + * Get flag to note if this instance participates in auto upgrade of minor version, or not. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set flag to note if this instance participates in auto upgrade of minor version, or not. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the ExtensionInstanceForCreate object itself. + */ + public ExtensionInstanceForCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get releaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + * + * @return the releaseTrain value + */ + public String releaseTrain() { + return this.releaseTrain; + } + + /** + * Set releaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + * + * @param releaseTrain the releaseTrain value to set + * @return the ExtensionInstanceForCreate object itself. + */ + public ExtensionInstanceForCreate withReleaseTrain(String releaseTrain) { + this.releaseTrain = releaseTrain; + return this; + } + + /** + * Get version of the extension for this extension instance, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set version of the extension for this extension instance, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. + * + * @param version the version value to set + * @return the ExtensionInstanceForCreate object itself. + */ + public ExtensionInstanceForCreate withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get scope at which the extension instance is installed. + * + * @return the scope value + */ + public Scope scope() { + return this.scope; + } + + /** + * Set scope at which the extension instance is installed. + * + * @param scope the scope value to set + * @return the ExtensionInstanceForCreate object itself. + */ + public ExtensionInstanceForCreate withScope(Scope scope) { + this.scope = scope; + return this; + } + + /** + * Get configuration settings, as name-value pairs for configuring this instance of the extension. + * + * @return the configurationSettings value + */ + public Map configurationSettings() { + return this.configurationSettings; + } + + /** + * Set configuration settings, as name-value pairs for configuring this instance of the extension. + * + * @param configurationSettings the configurationSettings value to set + * @return the ExtensionInstanceForCreate object itself. + */ + public ExtensionInstanceForCreate withConfigurationSettings(Map configurationSettings) { + this.configurationSettings = configurationSettings; + return this; + } + + /** + * Get configuration settings that are sensitive, as name-value pairs for configuring this instance of the extension. + * + * @return the configurationProtectedSettings value + */ + public Map configurationProtectedSettings() { + return this.configurationProtectedSettings; + } + + /** + * Set configuration settings that are sensitive, as name-value pairs for configuring this instance of the extension. + * + * @param configurationProtectedSettings the configurationProtectedSettings value to set + * @return the ExtensionInstanceForCreate object itself. + */ + public ExtensionInstanceForCreate withConfigurationProtectedSettings(Map configurationProtectedSettings) { + this.configurationProtectedSettings = configurationProtectedSettings; + return this; + } + + /** + * Get the identity of the configuration. + * + * @return the identity value + */ + public ConfigurationIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the configuration. + * + * @param identity the identity value to set + * @return the ExtensionInstanceForCreate object itself. + */ + public ExtensionInstanceForCreate withIdentity(ConfigurationIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceForList.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceForList.java new file mode 100644 index 0000000000000..137ee60f252cc --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceForList.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.KubernetesConfigurationManager; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.ExtensionInstanceForListInner; + +/** + * Type representing ExtensionInstanceForList. + */ +public interface ExtensionInstanceForList extends HasInner, HasManager { + /** + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * @return the creationTime value. + */ + String creationTime(); + + /** + * @return the errorInfo value. + */ + ErrorDefinition errorInfo(); + + /** + * @return the extensionType value. + */ + String extensionType(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the identity value. + */ + ConfigurationIdentity identity(); + + /** + * @return the installState value. + */ + InstallStateType installState(); + + /** + * @return the lastModifiedTime value. + */ + String lastModifiedTime(); + + /** + * @return the lastStatusTime value. + */ + String lastStatusTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the releaseTrain value. + */ + String releaseTrain(); + + /** + * @return the scope value. + */ + Scope scope(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + String version(); + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceUpdate.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceUpdate.java new file mode 100644 index 0000000000000..b3da9d76e4651 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionInstanceUpdate.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Update Extension Instance request object. + */ +@JsonFlatten +public class ExtensionInstanceUpdate { + /** + * Flag to note if this instance participates in Extension Lifecycle + * Management or not. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * ReleaseTrain this extension instance participates in for auto-upgrade + * (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is + * 'true'. + */ + @JsonProperty(value = "properties.releaseTrain") + private String releaseTrain; + + /** + * Version number of extension, to 'pin' to a specific version. + * autoUpgradeMinorVersion must be 'false'. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Get flag to note if this instance participates in Extension Lifecycle Management or not. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set flag to note if this instance participates in Extension Lifecycle Management or not. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the ExtensionInstanceUpdate object itself. + */ + public ExtensionInstanceUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get releaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + * + * @return the releaseTrain value + */ + public String releaseTrain() { + return this.releaseTrain; + } + + /** + * Set releaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + * + * @param releaseTrain the releaseTrain value to set + * @return the ExtensionInstanceUpdate object itself. + */ + public ExtensionInstanceUpdate withReleaseTrain(String releaseTrain) { + this.releaseTrain = releaseTrain; + return this; + } + + /** + * Get version number of extension, to 'pin' to a specific version. autoUpgradeMinorVersion must be 'false'. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set version number of extension, to 'pin' to a specific version. autoUpgradeMinorVersion must be 'false'. + * + * @param version the version value to set + * @return the ExtensionInstanceUpdate object itself. + */ + public ExtensionInstanceUpdate withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionStatus.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionStatus.java new file mode 100644 index 0000000000000..26a189862ffb3 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ExtensionStatus.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Status from this instance of the extension. + */ +public class ExtensionStatus { + /** + * Status code provided by the Extension. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Short description of status of this instance of the extension. + */ + @JsonProperty(value = "displayStatus") + private String displayStatus; + + /** + * Level of the status. Possible values include: 'Error', 'Warning', + * 'Information'. + */ + @JsonProperty(value = "level") + private LevelType level; + + /** + * Detailed message of the status from the Extension instance. + */ + @JsonProperty(value = "message") + private String message; + + /** + * DateLiteral (per ISO8601) noting the time of installation status. + */ + @JsonProperty(value = "time") + private String time; + + /** + * Get status code provided by the Extension. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set status code provided by the Extension. + * + * @param code the code value to set + * @return the ExtensionStatus object itself. + */ + public ExtensionStatus withCode(String code) { + this.code = code; + return this; + } + + /** + * Get short description of status of this instance of the extension. + * + * @return the displayStatus value + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Set short description of status of this instance of the extension. + * + * @param displayStatus the displayStatus value to set + * @return the ExtensionStatus object itself. + */ + public ExtensionStatus withDisplayStatus(String displayStatus) { + this.displayStatus = displayStatus; + return this; + } + + /** + * Get level of the status. Possible values include: 'Error', 'Warning', 'Information'. + * + * @return the level value + */ + public LevelType level() { + return this.level; + } + + /** + * Set level of the status. Possible values include: 'Error', 'Warning', 'Information'. + * + * @param level the level value to set + * @return the ExtensionStatus object itself. + */ + public ExtensionStatus withLevel(LevelType level) { + this.level = level; + return this; + } + + /** + * Get detailed message of the status from the Extension instance. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set detailed message of the status from the Extension instance. + * + * @param message the message value to set + * @return the ExtensionStatus object itself. + */ + public ExtensionStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get dateLiteral (per ISO8601) noting the time of installation status. + * + * @return the time value + */ + public String time() { + return this.time; + } + + /** + * Set dateLiteral (per ISO8601) noting the time of installation status. + * + * @param time the time value to set + * @return the ExtensionStatus object itself. + */ + public ExtensionStatus withTime(String time) { + this.time = time; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Extensions.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Extensions.java new file mode 100644 index 0000000000000..c94d92a468b7a --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Extensions.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.ExtensionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Extensions. + */ +public interface Extensions extends SupportsCreating, HasInner { + /** + * Gets details of the Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName); + + /** + * Delete a Kubernetes Cluster Extension Instance. This will cause the Agent to Uninstall the extension instance from the cluster. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName); + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName); + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/HelmOperatorProperties.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/HelmOperatorProperties.java new file mode 100644 index 0000000000000..b8a2152ed2aa1 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/HelmOperatorProperties.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties for Helm operator. + */ +public class HelmOperatorProperties { + /** + * 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 version of the operator Helm chart. + * + * @return the chartVersion value + */ + public String chartVersion() { + return this.chartVersion; + } + + /** + * Set 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 values override for the operator Helm chart. + * + * @return the chartValues value + */ + public String chartValues() { + return this.chartValues; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/InstallStateType.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/InstallStateType.java new file mode 100644 index 0000000000000..c276d20ac2cf6 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/InstallStateType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InstallStateType. + */ +public final class InstallStateType extends ExpandableStringEnum { + /** Static value Pending for InstallStateType. */ + public static final InstallStateType PENDING = fromString("Pending"); + + /** Static value Installed for InstallStateType. */ + public static final InstallStateType INSTALLED = fromString("Installed"); + + /** Static value Failed for InstallStateType. */ + public static final InstallStateType FAILED = fromString("Failed"); + + /** + * Creates or finds a InstallStateType from its string representation. + * @param name a name to look for + * @return the corresponding InstallStateType + */ + @JsonCreator + public static InstallStateType fromString(String name) { + return fromString(name, InstallStateType.class); + } + + /** + * @return known InstallStateType values + */ + public static Collection values() { + return values(InstallStateType.class); + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/LevelType.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/LevelType.java new file mode 100644 index 0000000000000..51da17b37d368 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/LevelType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LevelType. + */ +public final class LevelType extends ExpandableStringEnum { + /** Static value Error for LevelType. */ + public static final LevelType ERROR = fromString("Error"); + + /** Static value Warning for LevelType. */ + public static final LevelType WARNING = fromString("Warning"); + + /** Static value Information for LevelType. */ + public static final LevelType INFORMATION = fromString("Information"); + + /** + * Creates or finds a LevelType from its string representation. + * @param name a name to look for + * @return the corresponding LevelType + */ + @JsonCreator + public static LevelType fromString(String name) { + return fromString(name, LevelType.class); + } + + /** + * @return known LevelType values + */ + public static Collection values() { + return values(LevelType.class); + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/MessageLevelType.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/MessageLevelType.java new file mode 100644 index 0000000000000..445f94ed81404 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/MessageLevelType.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Operations.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Operations.java new file mode 100644 index 0000000000000..f8a9f968113e1 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/OperatorScopeType.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/OperatorScopeType.java new file mode 100644 index 0000000000000..1cf37c26ca56a --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/OperatorScopeType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/OperatorType.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/OperatorType.java new file mode 100644 index 0000000000000..b6e5e54311947 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/OperatorType.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ProvisioningStateType.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ProvisioningStateType.java new file mode 100644 index 0000000000000..534daa06050fb --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ProvisioningStateType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * 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/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceIdentityType.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceIdentityType.java new file mode 100644 index 0000000000000..2127078f4116c --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceIdentityType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceProviderOperation.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceProviderOperation.java new file mode 100644 index 0000000000000..4817677cd21f5 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceProviderOperation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.KubernetesConfigurationManager; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.ResourceProviderOperationInner; + +/** + * Type representing ResourceProviderOperation. + */ +public interface ResourceProviderOperation extends HasInner, HasManager { + /** + * @return the display value. + */ + ResourceProviderOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceProviderOperationDisplay.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceProviderOperationDisplay.java new file mode 100644 index 0000000000000..a3aee5f1ae45e --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ResourceProviderOperationDisplay.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class ResourceProviderOperationDisplay { + /** + * 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 resource provider: Microsoft KubernetesConfiguration. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set 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 resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set 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 type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set 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 description of this operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Result.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Result.java new file mode 100644 index 0000000000000..6698d1de44789 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Result.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Sample result definition. + */ +public class Result { + /** + * Sample property of type string. + */ + @JsonProperty(value = "sampleProperty") + private String sampleProperty; + + /** + * Get sample property of type string. + * + * @return the sampleProperty value + */ + public String sampleProperty() { + return this.sampleProperty; + } + + /** + * Set sample property of type string. + * + * @param sampleProperty the sampleProperty value to set + * @return the Result object itself. + */ + public Result withSampleProperty(String sampleProperty) { + this.sampleProperty = sampleProperty; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Scope.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Scope.java new file mode 100644 index 0000000000000..fc3a15c7ca0e4 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/Scope.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Scope of the extensionInstance. It can be either Cluster or Namespace; but + * not both. + */ +public class Scope { + /** + * Specifies that the scope of the extensionInstance is Cluster. + */ + @JsonProperty(value = "cluster") + private ScopeCluster cluster; + + /** + * Specifies that the scope of the extensionInstance is Namespace. + */ + @JsonProperty(value = "namespace") + private ScopeNamespace namespace; + + /** + * Get specifies that the scope of the extensionInstance is Cluster. + * + * @return the cluster value + */ + public ScopeCluster cluster() { + return this.cluster; + } + + /** + * Set specifies that the scope of the extensionInstance is Cluster. + * + * @param cluster the cluster value to set + * @return the Scope object itself. + */ + public Scope withCluster(ScopeCluster cluster) { + this.cluster = cluster; + return this; + } + + /** + * Get specifies that the scope of the extensionInstance is Namespace. + * + * @return the namespace value + */ + public ScopeNamespace namespace() { + return this.namespace; + } + + /** + * Set specifies that the scope of the extensionInstance is Namespace. + * + * @param namespace the namespace value to set + * @return the Scope object itself. + */ + public Scope withNamespace(ScopeNamespace namespace) { + this.namespace = namespace; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ScopeCluster.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ScopeCluster.java new file mode 100644 index 0000000000000..3b11455574724 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ScopeCluster.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies that the scope of the extensionInstance is Cluster. + */ +public class ScopeCluster { + /** + * Namespace where the extension Release must be placed, for a Cluster + * scoped extensionInstance. If this namespace does not exist, it will be + * created. + */ + @JsonProperty(value = "releaseNamespace") + private String releaseNamespace; + + /** + * Get namespace where the extension Release must be placed, for a Cluster scoped extensionInstance. If this namespace does not exist, it will be created. + * + * @return the releaseNamespace value + */ + public String releaseNamespace() { + return this.releaseNamespace; + } + + /** + * Set namespace where the extension Release must be placed, for a Cluster scoped extensionInstance. If this namespace does not exist, it will be created. + * + * @param releaseNamespace the releaseNamespace value to set + * @return the ScopeCluster object itself. + */ + public ScopeCluster withReleaseNamespace(String releaseNamespace) { + this.releaseNamespace = releaseNamespace; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ScopeNamespace.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ScopeNamespace.java new file mode 100644 index 0000000000000..9ab85fd5db752 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/ScopeNamespace.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies that the scope of the extensionInstance is Namespace. + */ +public class ScopeNamespace { + /** + * Namespace where the extensionInstance will be created for an Namespace + * scoped extensionInstance. If this namespace does not exist, it will be + * created. + */ + @JsonProperty(value = "targetNamespace") + private String targetNamespace; + + /** + * Get namespace where the extensionInstance will be created for an Namespace scoped extensionInstance. If this namespace does not exist, it will be created. + * + * @return the targetNamespace value + */ + public String targetNamespace() { + return this.targetNamespace; + } + + /** + * Set namespace where the extensionInstance will be created for an Namespace scoped extensionInstance. If this namespace does not exist, it will be created. + * + * @param targetNamespace the targetNamespace value to set + * @return the ScopeNamespace object itself. + */ + public ScopeNamespace withTargetNamespace(String targetNamespace) { + this.targetNamespace = targetNamespace; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfiguration.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfiguration.java new file mode 100644 index 0000000000000..2636a98877b3c --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfiguration.java @@ -0,0 +1,393 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.SourceControlConfigurationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.KubernetesConfigurationManager; +import java.util.Map; + +/** + * Type representing SourceControlConfiguration. + */ +public interface SourceControlConfiguration extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the complianceStatus value. + */ + ComplianceStatus complianceStatus(); + + /** + * @return the creationTime value. + */ + String creationTime(); + + /** + * @return the enableHelmOperator value. + */ + Boolean enableHelmOperator(); + + /** + * @return the helmOperatorProperties value. + */ + HelmOperatorProperties helmOperatorProperties(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedTime value. + */ + String lastModifiedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operatorInstanceName value. + */ + String operatorInstanceName(); + + /** + * @return the operatorNamespace value. + */ + String operatorNamespace(); + + /** + * @return the operatorParams value. + */ + String operatorParams(); + + /** + * @return the operatorScope value. + */ + OperatorScopeType operatorScope(); + + /** + * @return the operatorType value. + */ + OperatorType operatorType(); + + /** + * @return the provisioningState value. + */ + ProvisioningStateType provisioningState(); + + /** + * @return the repositoryPublicKey value. + */ + String repositoryPublicKey(); + + /** + * @return the repositoryUrl value. + */ + String repositoryUrl(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the SourceControlConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProvider, DefinitionStages.WithClusterResourceName, DefinitionStages.WithClusterName, DefinitionStages.WithCreate { + } + + /** + * Grouping of SourceControlConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SourceControlConfiguration definition. + */ + interface Blank extends WithProvider { + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify Provider. + */ + interface WithProvider { + /** + * Specifies resourceGroupName, clusterRp. + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @return the next definition stage + */ + WithClusterResourceName withExistingProvider(String resourceGroupName, String clusterRp); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify ClusterResourceName. + */ + interface WithClusterResourceName { + /** + * Specifies clusterResourceName. + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @return the next definition stage + */ + WithClusterName withClusterResourceName(String clusterResourceName); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify ClusterName. + */ + interface WithClusterName { + /** + * Specifies clusterName. + * @param clusterName The name of the kubernetes cluster + * @return the next definition stage + */ + WithCreate withClusterName(String clusterName); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify ConfigurationProtectedSettings. + */ + interface WithConfigurationProtectedSettings { + /** + * Specifies configurationProtectedSettings. + * @param configurationProtectedSettings Name-value pairs of protected configuration settings for the configuration + * @return the next definition stage + */ + WithCreate withConfigurationProtectedSettings(Map configurationProtectedSettings); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify EnableHelmOperator. + */ + interface WithEnableHelmOperator { + /** + * Specifies enableHelmOperator. + * @param enableHelmOperator Option to enable Helm Operator for this git configuration + * @return the next definition stage + */ + WithCreate withEnableHelmOperator(Boolean enableHelmOperator); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify HelmOperatorProperties. + */ + interface WithHelmOperatorProperties { + /** + * Specifies helmOperatorProperties. + * @param helmOperatorProperties Properties for Helm operator + * @return the next definition stage + */ + WithCreate withHelmOperatorProperties(HelmOperatorProperties helmOperatorProperties); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify OperatorInstanceName. + */ + interface WithOperatorInstanceName { + /** + * Specifies operatorInstanceName. + * @param operatorInstanceName Instance name of the operator - identifying the specific configuration + * @return the next definition stage + */ + WithCreate withOperatorInstanceName(String operatorInstanceName); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify OperatorNamespace. + */ + interface WithOperatorNamespace { + /** + * Specifies operatorNamespace. + * @param operatorNamespace The namespace to which this operator is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only + * @return the next definition stage + */ + WithCreate withOperatorNamespace(String operatorNamespace); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify OperatorParams. + */ + interface WithOperatorParams { + /** + * Specifies operatorParams. + * @param operatorParams Any Parameters for the Operator instance in string format + * @return the next definition stage + */ + WithCreate withOperatorParams(String operatorParams); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify OperatorScope. + */ + interface WithOperatorScope { + /** + * Specifies operatorScope. + * @param operatorScope Scope at which the operator will be installed. Possible values include: 'cluster', 'namespace' + * @return the next definition stage + */ + WithCreate withOperatorScope(OperatorScopeType operatorScope); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify OperatorType. + */ + interface WithOperatorType { + /** + * Specifies operatorType. + * @param operatorType Type of the operator. Possible values include: 'Flux' + * @return the next definition stage + */ + WithCreate withOperatorType(OperatorType operatorType); + } + + /** + * The stage of the sourcecontrolconfiguration definition allowing to specify RepositoryUrl. + */ + interface WithRepositoryUrl { + /** + * Specifies repositoryUrl. + * @param repositoryUrl Url of the SourceControl Repository + * @return the next definition stage + */ + WithCreate withRepositoryUrl(String repositoryUrl); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithConfigurationProtectedSettings, DefinitionStages.WithEnableHelmOperator, DefinitionStages.WithHelmOperatorProperties, DefinitionStages.WithOperatorInstanceName, DefinitionStages.WithOperatorNamespace, DefinitionStages.WithOperatorParams, DefinitionStages.WithOperatorScope, DefinitionStages.WithOperatorType, DefinitionStages.WithRepositoryUrl { + } + } + /** + * The template for a SourceControlConfiguration update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithConfigurationProtectedSettings, UpdateStages.WithEnableHelmOperator, UpdateStages.WithHelmOperatorProperties, UpdateStages.WithOperatorInstanceName, UpdateStages.WithOperatorNamespace, UpdateStages.WithOperatorParams, UpdateStages.WithOperatorScope, UpdateStages.WithOperatorType, UpdateStages.WithRepositoryUrl { + } + + /** + * Grouping of SourceControlConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the sourcecontrolconfiguration update allowing to specify ConfigurationProtectedSettings. + */ + interface WithConfigurationProtectedSettings { + /** + * Specifies configurationProtectedSettings. + * @param configurationProtectedSettings Name-value pairs of protected configuration settings for the configuration + * @return the next update stage + */ + Update withConfigurationProtectedSettings(Map configurationProtectedSettings); + } + + /** + * The stage of the sourcecontrolconfiguration update allowing to specify EnableHelmOperator. + */ + interface WithEnableHelmOperator { + /** + * Specifies enableHelmOperator. + * @param enableHelmOperator Option to enable Helm Operator for this git configuration + * @return the next update stage + */ + Update withEnableHelmOperator(Boolean enableHelmOperator); + } + + /** + * The stage of the sourcecontrolconfiguration update allowing to specify HelmOperatorProperties. + */ + interface WithHelmOperatorProperties { + /** + * Specifies helmOperatorProperties. + * @param helmOperatorProperties Properties for Helm operator + * @return the next update stage + */ + Update withHelmOperatorProperties(HelmOperatorProperties helmOperatorProperties); + } + + /** + * The stage of the sourcecontrolconfiguration update allowing to specify OperatorInstanceName. + */ + interface WithOperatorInstanceName { + /** + * Specifies operatorInstanceName. + * @param operatorInstanceName Instance name of the operator - identifying the specific configuration + * @return the next update stage + */ + Update withOperatorInstanceName(String operatorInstanceName); + } + + /** + * The stage of the sourcecontrolconfiguration update allowing to specify OperatorNamespace. + */ + interface WithOperatorNamespace { + /** + * Specifies operatorNamespace. + * @param operatorNamespace The namespace to which this operator is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only + * @return the next update stage + */ + Update withOperatorNamespace(String operatorNamespace); + } + + /** + * The stage of the sourcecontrolconfiguration update allowing to specify OperatorParams. + */ + interface WithOperatorParams { + /** + * Specifies operatorParams. + * @param operatorParams Any Parameters for the Operator instance in string format + * @return the next update stage + */ + Update withOperatorParams(String operatorParams); + } + + /** + * The stage of the sourcecontrolconfiguration update allowing to specify OperatorScope. + */ + interface WithOperatorScope { + /** + * Specifies operatorScope. + * @param operatorScope Scope at which the operator will be installed. Possible values include: 'cluster', 'namespace' + * @return the next update stage + */ + Update withOperatorScope(OperatorScopeType operatorScope); + } + + /** + * The stage of the sourcecontrolconfiguration update allowing to specify OperatorType. + */ + interface WithOperatorType { + /** + * Specifies operatorType. + * @param operatorType Type of the operator. Possible values include: 'Flux' + * @return the next update stage + */ + Update withOperatorType(OperatorType operatorType); + } + + /** + * The stage of the sourcecontrolconfiguration update allowing to specify RepositoryUrl. + */ + interface WithRepositoryUrl { + /** + * Specifies repositoryUrl. + * @param repositoryUrl Url of the SourceControl Repository + * @return the next update stage + */ + Update withRepositoryUrl(String repositoryUrl); + } + + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfigurationForCreate.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfigurationForCreate.java new file mode 100644 index 0000000000000..5a36136248a98 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfigurationForCreate.java @@ -0,0 +1,274 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The SourceControl Configuration object to create a new configuration. + */ +@JsonFlatten +public class SourceControlConfigurationForCreate extends ProxyResource { + /** + * 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. Possible values include: 'Flux'. + */ + @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. Possible values include: + * 'cluster', 'namespace'. + */ + @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; + + /** + * 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; + + /** + * Get url of the SourceControl Repository. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set url of the SourceControl Repository. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get 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 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 SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withOperatorNamespace(String operatorNamespace) { + this.operatorNamespace = operatorNamespace; + return this; + } + + /** + * Get instance name of the operator - identifying the specific configuration. + * + * @return the operatorInstanceName value + */ + public String operatorInstanceName() { + return this.operatorInstanceName; + } + + /** + * Set instance name of the operator - identifying the specific configuration. + * + * @param operatorInstanceName the operatorInstanceName value to set + * @return the SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withOperatorInstanceName(String operatorInstanceName) { + this.operatorInstanceName = operatorInstanceName; + return this; + } + + /** + * Get type of the operator. Possible values include: 'Flux'. + * + * @return the operatorType value + */ + public OperatorType operatorType() { + return this.operatorType; + } + + /** + * Set type of the operator. Possible values include: 'Flux'. + * + * @param operatorType the operatorType value to set + * @return the SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withOperatorType(OperatorType operatorType) { + this.operatorType = operatorType; + return this; + } + + /** + * Get any Parameters for the Operator instance in string format. + * + * @return the operatorParams value + */ + public String operatorParams() { + return this.operatorParams; + } + + /** + * Set any Parameters for the Operator instance in string format. + * + * @param operatorParams the operatorParams value to set + * @return the SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withOperatorParams(String operatorParams) { + this.operatorParams = operatorParams; + return this; + } + + /** + * Get name-value pairs of protected configuration settings for the configuration. + * + * @return the configurationProtectedSettings value + */ + public Map configurationProtectedSettings() { + return this.configurationProtectedSettings; + } + + /** + * Set name-value pairs of protected configuration settings for the configuration. + * + * @param configurationProtectedSettings the configurationProtectedSettings value to set + * @return the SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withConfigurationProtectedSettings(Map configurationProtectedSettings) { + this.configurationProtectedSettings = configurationProtectedSettings; + return this; + } + + /** + * Get scope at which the operator will be installed. Possible values include: 'cluster', 'namespace'. + * + * @return the operatorScope value + */ + public OperatorScopeType operatorScope() { + return this.operatorScope; + } + + /** + * Set scope at which the operator will be installed. Possible values include: 'cluster', 'namespace'. + * + * @param operatorScope the operatorScope value to set + * @return the SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withOperatorScope(OperatorScopeType operatorScope) { + this.operatorScope = operatorScope; + return this; + } + + /** + * Get 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 option to enable Helm Operator for this git configuration. + * + * @return the enableHelmOperator value + */ + public Boolean enableHelmOperator() { + return this.enableHelmOperator; + } + + /** + * Set option to enable Helm Operator for this git configuration. + * + * @param enableHelmOperator the enableHelmOperator value to set + * @return the SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withEnableHelmOperator(Boolean enableHelmOperator) { + this.enableHelmOperator = enableHelmOperator; + return this; + } + + /** + * Get properties for Helm operator. + * + * @return the helmOperatorProperties value + */ + public HelmOperatorProperties helmOperatorProperties() { + return this.helmOperatorProperties; + } + + /** + * Set properties for Helm operator. + * + * @param helmOperatorProperties the helmOperatorProperties value to set + * @return the SourceControlConfigurationForCreate object itself. + */ + public SourceControlConfigurationForCreate withHelmOperatorProperties(HelmOperatorProperties helmOperatorProperties) { + this.helmOperatorProperties = helmOperatorProperties; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfigurations.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfigurations.java new file mode 100644 index 0000000000000..eb92573d3fda8 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/SourceControlConfigurations.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation.SourceControlConfigurationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SourceControlConfigurations. + */ +public interface SourceControlConfigurations extends SupportsCreating, HasInner { + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterRp, String 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName); + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName); + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceForListImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceForListImpl.java new file mode 100644 index 0000000000000..f15fb23e1b6f3 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceForListImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionInstanceForList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ErrorDefinition; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ConfigurationIdentity; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.InstallStateType; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Scope; + +class ExtensionInstanceForListImpl extends WrapperImpl implements ExtensionInstanceForList { + private final KubernetesConfigurationManager manager; + ExtensionInstanceForListImpl(ExtensionInstanceForListInner inner, KubernetesConfigurationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KubernetesConfigurationManager manager() { + return this.manager; + } + + @Override + public Boolean autoUpgradeMinorVersion() { + return this.inner().autoUpgradeMinorVersion(); + } + + @Override + public String creationTime() { + return this.inner().creationTime(); + } + + @Override + public ErrorDefinition errorInfo() { + return this.inner().errorInfo(); + } + + @Override + public String extensionType() { + return this.inner().extensionType(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ConfigurationIdentity identity() { + return this.inner().identity(); + } + + @Override + public InstallStateType installState() { + return this.inner().installState(); + } + + @Override + public String lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String lastStatusTime() { + return this.inner().lastStatusTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String releaseTrain() { + return this.inner().releaseTrain(); + } + + @Override + public Scope scope() { + return this.inner().scope(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceForListInner.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceForListInner.java new file mode 100644 index 0000000000000..6ffa77bf4ebaa --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceForListInner.java @@ -0,0 +1,275 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Scope; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.InstallStateType; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ErrorDefinition; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ConfigurationIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Extension Instance object. + */ +@JsonFlatten +public class ExtensionInstanceForListInner extends ProxyResource { + /** + * Type of the Extension, of which this resource is an instance of. It + * must be one of the Extension Types registered with + * Microsoft.KubernetesConfiguration by the Extension publisher. + */ + @JsonProperty(value = "properties.extensionType") + private String extensionType; + + /** + * Flag to note if this instance participates in auto upgrade of minor + * version, or not. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * ReleaseTrain this extension instance participates in for auto-upgrade + * (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is + * 'true'. + */ + @JsonProperty(value = "properties.releaseTrain") + private String releaseTrain; + + /** + * Version of the extension for this extension instance, if it is 'pinned' + * to a specific version. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Scope at which the extension instance is installed. + */ + @JsonProperty(value = "properties.scope") + private Scope scope; + + /** + * Status of installation of this instance of the extension. Possible + * values include: 'Pending', 'Installed', 'Failed'. + */ + @JsonProperty(value = "properties.installState") + private InstallStateType installState; + + /** + * DateLiteral (per ISO8601) noting the time the resource was created by + * the client (user). + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private String creationTime; + + /** + * DateLiteral (per ISO8601) noting the time the resource was modified by + * the client (user). + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedTime; + + /** + * DateLiteral (per ISO8601) noting the time of last status from the agent. + */ + @JsonProperty(value = "properties.lastStatusTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastStatusTime; + + /** + * Error information from the Agent - e.g. errors during installation. + */ + @JsonProperty(value = "properties.errorInfo", access = JsonProperty.Access.WRITE_ONLY) + private ErrorDefinition errorInfo; + + /** + * The identity of the configuration. + */ + @JsonProperty(value = "identity") + private ConfigurationIdentity identity; + + /** + * Get type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. + * + * @return the extensionType value + */ + public String extensionType() { + return this.extensionType; + } + + /** + * Set type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. + * + * @param extensionType the extensionType value to set + * @return the ExtensionInstanceForListInner object itself. + */ + public ExtensionInstanceForListInner withExtensionType(String extensionType) { + this.extensionType = extensionType; + return this; + } + + /** + * Get flag to note if this instance participates in auto upgrade of minor version, or not. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set flag to note if this instance participates in auto upgrade of minor version, or not. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the ExtensionInstanceForListInner object itself. + */ + public ExtensionInstanceForListInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get releaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + * + * @return the releaseTrain value + */ + public String releaseTrain() { + return this.releaseTrain; + } + + /** + * Set releaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + * + * @param releaseTrain the releaseTrain value to set + * @return the ExtensionInstanceForListInner object itself. + */ + public ExtensionInstanceForListInner withReleaseTrain(String releaseTrain) { + this.releaseTrain = releaseTrain; + return this; + } + + /** + * Get version of the extension for this extension instance, if it is 'pinned' to a specific version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set version of the extension for this extension instance, if it is 'pinned' to a specific version. + * + * @param version the version value to set + * @return the ExtensionInstanceForListInner object itself. + */ + public ExtensionInstanceForListInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get scope at which the extension instance is installed. + * + * @return the scope value + */ + public Scope scope() { + return this.scope; + } + + /** + * Set scope at which the extension instance is installed. + * + * @param scope the scope value to set + * @return the ExtensionInstanceForListInner object itself. + */ + public ExtensionInstanceForListInner withScope(Scope scope) { + this.scope = scope; + return this; + } + + /** + * Get status of installation of this instance of the extension. Possible values include: 'Pending', 'Installed', 'Failed'. + * + * @return the installState value + */ + public InstallStateType installState() { + return this.installState; + } + + /** + * Set status of installation of this instance of the extension. Possible values include: 'Pending', 'Installed', 'Failed'. + * + * @param installState the installState value to set + * @return the ExtensionInstanceForListInner object itself. + */ + public ExtensionInstanceForListInner withInstallState(InstallStateType installState) { + this.installState = installState; + return this; + } + + /** + * Get dateLiteral (per ISO8601) noting the time the resource was created by the client (user). + * + * @return the creationTime value + */ + public String creationTime() { + return this.creationTime; + } + + /** + * Get dateLiteral (per ISO8601) noting the time the resource was modified by the client (user). + * + * @return the lastModifiedTime value + */ + public String lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get dateLiteral (per ISO8601) noting the time of last status from the agent. + * + * @return the lastStatusTime value + */ + public String lastStatusTime() { + return this.lastStatusTime; + } + + /** + * Get error information from the Agent - e.g. errors during installation. + * + * @return the errorInfo value + */ + public ErrorDefinition errorInfo() { + return this.errorInfo; + } + + /** + * Get the identity of the configuration. + * + * @return the identity value + */ + public ConfigurationIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the configuration. + * + * @param identity the identity value to set + * @return the ExtensionInstanceForListInner object itself. + */ + public ExtensionInstanceForListInner withIdentity(ConfigurationIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceImpl.java new file mode 100644 index 0000000000000..578ac7b5d7513 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceImpl.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionInstance; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionInstanceUpdate; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionInstanceForCreate; +import java.util.Map; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ErrorDefinition; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ConfigurationIdentity; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.InstallStateType; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Scope; +import java.util.List; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionStatus; +import rx.functions.Func1; + +class ExtensionInstanceImpl extends CreatableUpdatableImpl implements ExtensionInstance, ExtensionInstance.Definition, ExtensionInstance.Update { + private final KubernetesConfigurationManager manager; + private String resourceGroupName; + private String clusterRp; + private String clusterResourceName; + private String clusterName; + private String extensionInstanceName; + private ExtensionInstanceForCreate createParameter; + private ExtensionInstanceUpdate updateParameter; + + ExtensionInstanceImpl(String name, KubernetesConfigurationManager manager) { + super(name, new ExtensionInstanceInner()); + this.manager = manager; + // Set resource name + this.extensionInstanceName = name; + // + this.createParameter = new ExtensionInstanceForCreate(); + this.updateParameter = new ExtensionInstanceUpdate(); + } + + ExtensionInstanceImpl(ExtensionInstanceInner inner, KubernetesConfigurationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.extensionInstanceName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterRp = String.fromString(IdParsingUtils.getValueFromIdByName(inner.id(), "providers")); + this.extensionInstanceName = IdParsingUtils.getValueFromIdByName(inner.id(), "extensions"); + this.clusterResourceName = String.fromString(IdParsingUtils.getValueFromIdByPosition(inner.id(), 6)); + this.clusterName = IdParsingUtils.getValueFromIdByPosition(inner.id(), 7); + // + this.createParameter = new ExtensionInstanceForCreate(); + this.updateParameter = new ExtensionInstanceUpdate(); + } + + @Override + public KubernetesConfigurationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExtensionsInner client = this.manager().inner().extensions(); + return client.createAsync(this.resourceGroupName, this.clusterRp, this.clusterResourceName, this.clusterName, this.extensionInstanceName, this.createParameter) + .map(new Func1() { + @Override + public ExtensionInstanceInner call(ExtensionInstanceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExtensionsInner client = this.manager().inner().extensions(); + return client.updateAsync(this.resourceGroupName, this.clusterRp, this.clusterResourceName, this.clusterName, this.extensionInstanceName, this.updateParameter) + .map(new Func1() { + @Override + public ExtensionInstanceInner call(ExtensionInstanceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExtensionsInner client = this.manager().inner().extensions(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new ExtensionInstanceForCreate(); + this.updateParameter = new ExtensionInstanceUpdate(); + } + + @Override + public Boolean autoUpgradeMinorVersion() { + return this.inner().autoUpgradeMinorVersion(); + } + + @Override + public Map configurationSettings() { + return this.inner().configurationSettings(); + } + + @Override + public String creationTime() { + return this.inner().creationTime(); + } + + @Override + public ErrorDefinition errorInfo() { + return this.inner().errorInfo(); + } + + @Override + public String extensionType() { + return this.inner().extensionType(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ConfigurationIdentity identity() { + return this.inner().identity(); + } + + @Override + public InstallStateType installState() { + return this.inner().installState(); + } + + @Override + public String lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String lastStatusTime() { + return this.inner().lastStatusTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String releaseTrain() { + return this.inner().releaseTrain(); + } + + @Override + public Scope scope() { + return this.inner().scope(); + } + + @Override + public List statuses() { + return this.inner().statuses(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String version() { + return this.inner().version(); + } + + @Override + public ExtensionInstanceImpl withExistingProvider(String resourceGroupName, String clusterRp) { + this.resourceGroupName = resourceGroupName; + this.clusterRp = clusterRp; + return this; + } + + @Override + public ExtensionInstanceImpl withClusterResourceName(String clusterResourceName) { + this.clusterResourceName = clusterResourceName; + return this; + } + + @Override + public ExtensionInstanceImpl withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + @Override + public ExtensionInstanceImpl withConfigurationProtectedSettings(Map configurationProtectedSettings) { + this.createParameter.withConfigurationProtectedSettings(configurationProtectedSettings); + return this; + } + + @Override + public ExtensionInstanceImpl withConfigurationSettings(Map configurationSettings) { + this.createParameter.withConfigurationSettings(configurationSettings); + return this; + } + + @Override + public ExtensionInstanceImpl withExtensionType(String extensionType) { + this.createParameter.withExtensionType(extensionType); + return this; + } + + @Override + public ExtensionInstanceImpl withIdentity(ConfigurationIdentity identity) { + this.createParameter.withIdentity(identity); + return this; + } + + @Override + public ExtensionInstanceImpl withScope(Scope scope) { + this.createParameter.withScope(scope); + return this; + } + + @Override + public ExtensionInstanceImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.createParameter.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } else { + this.updateParameter.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + } + return this; + } + + @Override + public ExtensionInstanceImpl withReleaseTrain(String releaseTrain) { + if (isInCreateMode()) { + this.createParameter.withReleaseTrain(releaseTrain); + } else { + this.updateParameter.withReleaseTrain(releaseTrain); + } + return this; + } + + @Override + public ExtensionInstanceImpl withVersion(String version) { + if (isInCreateMode()) { + this.createParameter.withVersion(version); + } else { + this.updateParameter.withVersion(version); + } + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceInner.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceInner.java new file mode 100644 index 0000000000000..8c76c6bf84b3b --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionInstanceInner.java @@ -0,0 +1,331 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Scope; +import java.util.Map; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.InstallStateType; +import java.util.List; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionStatus; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ErrorDefinition; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ConfigurationIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The Extension Instance object. + */ +@JsonFlatten +public class ExtensionInstanceInner extends ProxyResource { + /** + * Type of the Extension, of which this resource is an instance of. It + * must be one of the Extension Types registered with + * Microsoft.KubernetesConfiguration by the Extension publisher. + */ + @JsonProperty(value = "properties.extensionType") + private String extensionType; + + /** + * Flag to note if this instance participates in auto upgrade of minor + * version, or not. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /** + * ReleaseTrain this extension instance participates in for auto-upgrade + * (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is + * 'true'. + */ + @JsonProperty(value = "properties.releaseTrain") + private String releaseTrain; + + /** + * Version of the extension for this extension instance, if it is 'pinned' + * to a specific version. autoUpgradeMinorVersion must be 'false'. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * Scope at which the extension instance is installed. + */ + @JsonProperty(value = "properties.scope") + private Scope scope; + + /** + * Configuration settings, as name-value pairs for configuring this + * instance of the extension. + */ + @JsonProperty(value = "properties.configurationSettings") + private Map configurationSettings; + + /** + * Status of installation of this instance of the extension. Possible + * values include: 'Pending', 'Installed', 'Failed'. + */ + @JsonProperty(value = "properties.installState") + private InstallStateType installState; + + /** + * Status from this instance of the extension. + */ + @JsonProperty(value = "properties.statuses") + private List statuses; + + /** + * DateLiteral (per ISO8601) noting the time the resource was created by + * the client (user). + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private String creationTime; + + /** + * DateLiteral (per ISO8601) noting the time the resource was modified by + * the client (user). + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedTime; + + /** + * DateLiteral (per ISO8601) noting the time of last status from the agent. + */ + @JsonProperty(value = "properties.lastStatusTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastStatusTime; + + /** + * Error information from the Agent - e.g. errors during installation. + */ + @JsonProperty(value = "properties.errorInfo", access = JsonProperty.Access.WRITE_ONLY) + private ErrorDefinition errorInfo; + + /** + * The identity of the configuration. + */ + @JsonProperty(value = "identity") + private ConfigurationIdentity identity; + + /** + * Get type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. + * + * @return the extensionType value + */ + public String extensionType() { + return this.extensionType; + } + + /** + * Set type of the Extension, of which this resource is an instance of. It must be one of the Extension Types registered with Microsoft.KubernetesConfiguration by the Extension publisher. + * + * @param extensionType the extensionType value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withExtensionType(String extensionType) { + this.extensionType = extensionType; + return this; + } + + /** + * Get flag to note if this instance participates in auto upgrade of minor version, or not. + * + * @return the autoUpgradeMinorVersion value + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set flag to note if this instance participates in auto upgrade of minor version, or not. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get releaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + * + * @return the releaseTrain value + */ + public String releaseTrain() { + return this.releaseTrain; + } + + /** + * Set releaseTrain this extension instance participates in for auto-upgrade (e.g. Stable, Preview, etc.) - only if autoUpgradeMinorVersion is 'true'. + * + * @param releaseTrain the releaseTrain value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withReleaseTrain(String releaseTrain) { + this.releaseTrain = releaseTrain; + return this; + } + + /** + * Get version of the extension for this extension instance, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set version of the extension for this extension instance, if it is 'pinned' to a specific version. autoUpgradeMinorVersion must be 'false'. + * + * @param version the version value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get scope at which the extension instance is installed. + * + * @return the scope value + */ + public Scope scope() { + return this.scope; + } + + /** + * Set scope at which the extension instance is installed. + * + * @param scope the scope value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withScope(Scope scope) { + this.scope = scope; + return this; + } + + /** + * Get configuration settings, as name-value pairs for configuring this instance of the extension. + * + * @return the configurationSettings value + */ + public Map configurationSettings() { + return this.configurationSettings; + } + + /** + * Set configuration settings, as name-value pairs for configuring this instance of the extension. + * + * @param configurationSettings the configurationSettings value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withConfigurationSettings(Map configurationSettings) { + this.configurationSettings = configurationSettings; + return this; + } + + /** + * Get status of installation of this instance of the extension. Possible values include: 'Pending', 'Installed', 'Failed'. + * + * @return the installState value + */ + public InstallStateType installState() { + return this.installState; + } + + /** + * Set status of installation of this instance of the extension. Possible values include: 'Pending', 'Installed', 'Failed'. + * + * @param installState the installState value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withInstallState(InstallStateType installState) { + this.installState = installState; + return this; + } + + /** + * Get status from this instance of the extension. + * + * @return the statuses value + */ + public List statuses() { + return this.statuses; + } + + /** + * Set status from this instance of the extension. + * + * @param statuses the statuses value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withStatuses(List statuses) { + this.statuses = statuses; + return this; + } + + /** + * Get dateLiteral (per ISO8601) noting the time the resource was created by the client (user). + * + * @return the creationTime value + */ + public String creationTime() { + return this.creationTime; + } + + /** + * Get dateLiteral (per ISO8601) noting the time the resource was modified by the client (user). + * + * @return the lastModifiedTime value + */ + public String lastModifiedTime() { + return this.lastModifiedTime; + } + + /** + * Get dateLiteral (per ISO8601) noting the time of last status from the agent. + * + * @return the lastStatusTime value + */ + public String lastStatusTime() { + return this.lastStatusTime; + } + + /** + * Get error information from the Agent - e.g. errors during installation. + * + * @return the errorInfo value + */ + public ErrorDefinition errorInfo() { + return this.errorInfo; + } + + /** + * Get the identity of the configuration. + * + * @return the identity value + */ + public ConfigurationIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the configuration. + * + * @param identity the identity value to set + * @return the ExtensionInstanceInner object itself. + */ + public ExtensionInstanceInner withIdentity(ConfigurationIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionsImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionsImpl.java new file mode 100644 index 0000000000000..9919ba5613017 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionsImpl.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Extensions; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionInstance; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionInstanceForList; + +class ExtensionsImpl extends WrapperImpl implements Extensions { + private final KubernetesConfigurationManager manager; + + ExtensionsImpl(KubernetesConfigurationManager manager) { + super(manager.inner().extensions()); + this.manager = manager; + } + + public KubernetesConfigurationManager manager() { + return this.manager; + } + + @Override + public ExtensionInstanceImpl define(String name) { + return wrapModel(name); + } + + private ExtensionInstanceImpl wrapModel(ExtensionInstanceInner inner) { + return new ExtensionInstanceImpl(inner, manager()); + } + + private ExtensionInstanceImpl wrapModel(String name) { + return new ExtensionInstanceImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName) { + ExtensionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName) + .map(new Func1() { + @Override + public ExtensionInstance call(ExtensionInstanceInner inner) { + return new ExtensionInstanceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName) { + ExtensionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + ExtensionsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExtensionInstanceForList call(ExtensionInstanceForListInner inner) { + return new ExtensionInstanceForListImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionsInner.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionsInner.java new file mode 100644 index 0000000000000..c8281cd3253c3 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ExtensionsInner.java @@ -0,0 +1,787 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ErrorResponseException; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionInstanceForCreate; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ExtensionInstanceUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Extensions. + */ +public class ExtensionsInner { + /** The Retrofit service to perform REST calls. */ + private ExtensionsService service; + /** The service client containing this operation class. */ + private SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of ExtensionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExtensionsInner(Retrofit retrofit, SourceControlConfigurationClientImpl client) { + this.service = retrofit.create(ExtensionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Extensions to be + * used by Retrofit to perform actually REST calls. + */ + interface ExtensionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Extensions create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Path("extensionInstanceName") String extensionInstanceName, @Query("api-version") String apiVersion, @Body ExtensionInstanceForCreate extensionInstance, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Extensions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Path("extensionInstanceName") String extensionInstanceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Extensions update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Path("extensionInstanceName") String extensionInstanceName, @Query("api-version") String apiVersion, @Body ExtensionInstanceUpdate extensionInstance, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Extensions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions/{extensionInstanceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Path("extensionInstanceName") String extensionInstanceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Extensions list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/extensions") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Extensions listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create a new Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties necessary to Create an Extension Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtensionInstanceInner object if successful. + */ + public ExtensionInstanceInner create(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, ExtensionInstanceForCreate extensionInstance) { + return createWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, extensionInstance).toBlocking().single().body(); + } + + /** + * Create a new Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties necessary to Create an Extension Instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, ExtensionInstanceForCreate extensionInstance, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, extensionInstance), serviceCallback); + } + + /** + * Create a new Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties necessary to Create an Extension Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInstanceInner object + */ + public Observable createAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, ExtensionInstanceForCreate extensionInstance) { + return createWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, extensionInstance).map(new Func1, ExtensionInstanceInner>() { + @Override + public ExtensionInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a new Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties necessary to Create an Extension Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInstanceInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, ExtensionInstanceForCreate extensionInstance) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionInstanceName == null) { + throw new IllegalArgumentException("Parameter extensionInstanceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (extensionInstance == null) { + throw new IllegalArgumentException("Parameter extensionInstance is required and cannot be null."); + } + Validator.validate(extensionInstance); + return service.create(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, this.client.apiVersion(), extensionInstance, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets details of the Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtensionInstanceInner object if successful. + */ + public ExtensionInstanceInner get(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName) { + return getWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName).toBlocking().single().body(); + } + + /** + * Gets details of the Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName), serviceCallback); + } + + /** + * Gets details of the Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInstanceInner object + */ + public Observable getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName) { + return getWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName).map(new Func1, ExtensionInstanceInner>() { + @Override + public ExtensionInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details of the Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInstanceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionInstanceName == null) { + throw new IllegalArgumentException("Parameter extensionInstanceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update an existing Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties to Update in the Extension Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtensionInstanceInner object if successful. + */ + public ExtensionInstanceInner update(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, ExtensionInstanceUpdate extensionInstance) { + return updateWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, extensionInstance).toBlocking().single().body(); + } + + /** + * Update an existing Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties to Update in the Extension Instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, ExtensionInstanceUpdate extensionInstance, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, extensionInstance), serviceCallback); + } + + /** + * Update an existing Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties to Update in the Extension Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInstanceInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, ExtensionInstanceUpdate extensionInstance) { + return updateWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, extensionInstance).map(new Func1, ExtensionInstanceInner>() { + @Override + public ExtensionInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an existing Kubernetes Cluster Extension Instance. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param extensionInstance Properties to Update in the Extension Instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInstanceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, ExtensionInstanceUpdate extensionInstance) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionInstanceName == null) { + throw new IllegalArgumentException("Parameter extensionInstanceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (extensionInstance == null) { + throw new IllegalArgumentException("Parameter extensionInstance is required and cannot be null."); + } + Validator.validate(extensionInstance); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, this.client.apiVersion(), extensionInstance, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete a Kubernetes Cluster Extension Instance. This will cause the Agent to Uninstall the extension instance from the cluster. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName).toBlocking().single().body(); + } + + /** + * Delete a Kubernetes Cluster Extension Instance. This will cause the Agent to Uninstall the extension instance from the cluster. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName), serviceCallback); + } + + /** + * Delete a Kubernetes Cluster Extension Instance. This will cause the Agent to Uninstall the extension instance from the cluster. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Kubernetes Cluster Extension Instance. This will cause the Agent to Uninstall the extension instance from the cluster. + * + * @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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param extensionInstanceName Name of an instance of the Extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String extensionInstanceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionInstanceName == null) { + throw new IllegalArgumentException("Parameter extensionInstanceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, extensionInstanceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExtensionInstanceForListInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExtensionInstanceForListInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExtensionInstanceForListInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + return listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all Source Control Configurations. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + ServiceResponse> * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + ServiceResponse> * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExtensionInstanceForListInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * List all Source Control Configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExtensionInstanceForListInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all Source Control Configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all Source Control Configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExtensionInstanceForListInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all Source Control Configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExtensionInstanceForListInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all Source Control Configurations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExtensionInstanceForListInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/IdParsingUtils.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..4e54bde61396b --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/KubernetesConfigurationManager.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/KubernetesConfigurationManager.java new file mode 100644 index 0000000000000..0beab7b0927df --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/KubernetesConfigurationManager.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurations; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Operations; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Extensions; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure KubernetesConfiguration resource management. + */ +public final class KubernetesConfigurationManager extends ManagerCore { + private SourceControlConfigurations sourceControlConfigurations; + private Operations operations; + private Extensions extensions; + /** + * Get a Configurable instance that can be used to create KubernetesConfigurationManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new KubernetesConfigurationManager.ConfigurableImpl(); + } + /** + * Creates an instance of KubernetesConfigurationManager that exposes KubernetesConfiguration resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the KubernetesConfigurationManager + */ + public static KubernetesConfigurationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new KubernetesConfigurationManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of KubernetesConfigurationManager that exposes KubernetesConfiguration resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the KubernetesConfigurationManager + */ + public static KubernetesConfigurationManager authenticate(RestClient restClient, String subscriptionId) { + return new KubernetesConfigurationManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of KubernetesConfigurationManager that exposes KubernetesConfiguration management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing KubernetesConfiguration management API entry points that work across subscriptions + */ + KubernetesConfigurationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage SourceControlConfigurations. + */ + public SourceControlConfigurations sourceControlConfigurations() { + if (this.sourceControlConfigurations == null) { + this.sourceControlConfigurations = new SourceControlConfigurationsImpl(this); + } + return this.sourceControlConfigurations; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Extensions. + */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(this); + } + return this.extensions; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public KubernetesConfigurationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return KubernetesConfigurationManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private KubernetesConfigurationManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new SourceControlConfigurationClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/OperationsImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..5f13c206fbb1e --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ResourceProviderOperation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final KubernetesConfigurationManager manager; + + OperationsImpl(KubernetesConfigurationManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public KubernetesConfigurationManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ResourceProviderOperation call(ResourceProviderOperationInner inner) { + return new ResourceProviderOperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/OperationsInner.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..32f87bf34f681 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, SourceControlConfigurationClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Operations list" }) + @GET("providers/Microsoft.KubernetesConfiguration/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceProviderOperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceProviderOperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceProviderOperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceProviderOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ResourceProviderOperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceProviderOperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ResourceProviderOperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the available operations the KubernetesConfiguration resource provider supports. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ResourceProviderOperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/PageImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..5236a4f817ea0 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ResourceProviderOperationImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ResourceProviderOperationImpl.java new file mode 100644 index 0000000000000..5a6a1a378e508 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ResourceProviderOperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ResourceProviderOperation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ResourceProviderOperationDisplay; + +class ResourceProviderOperationImpl extends WrapperImpl implements ResourceProviderOperation { + private final KubernetesConfigurationManager manager; + ResourceProviderOperationImpl(ResourceProviderOperationInner inner, KubernetesConfigurationManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public KubernetesConfigurationManager manager() { + return this.manager; + } + + @Override + public ResourceProviderOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ResourceProviderOperationInner.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ResourceProviderOperationInner.java new file mode 100644 index 0000000000000..03a15e8476c4e --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/ResourceProviderOperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ResourceProviderOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Supported operation of this resource provider. + */ +public class ResourceProviderOperationInner { + /** + * 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; + + /** + * Get operation name, in format of {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set 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 display metadata associated with the operation. + * + * @return the display value + */ + public ResourceProviderOperationDisplay display() { + return this.display; + } + + /** + * Set 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; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationClientImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationClientImpl.java new file mode 100644 index 0000000000000..ae2d71a40f19a --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationClientImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the SourceControlConfigurationClientImpl class. + */ +public class SourceControlConfigurationClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ + private 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 subscriptionId() { + return this.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 service client itself + */ + public SourceControlConfigurationClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to be used with the HTTP request. */ + private String apiVersion; + + /** + * Gets The API version to be used with the HTTP request. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public SourceControlConfigurationClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public SourceControlConfigurationClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public SourceControlConfigurationClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The SourceControlConfigurationsInner object to access its operations. + */ + private SourceControlConfigurationsInner sourceControlConfigurations; + + /** + * Gets the SourceControlConfigurationsInner object to access its operations. + * @return the SourceControlConfigurationsInner object. + */ + public SourceControlConfigurationsInner sourceControlConfigurations() { + return this.sourceControlConfigurations; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ExtensionsInner object to access its operations. + */ + private ExtensionsInner extensions; + + /** + * Gets the ExtensionsInner object to access its operations. + * @return the ExtensionsInner object. + */ + public ExtensionsInner extensions() { + return this.extensions; + } + + /** + * Initializes an instance of SourceControlConfigurationClient client. + * + * @param credentials the management credentials for Azure + */ + public SourceControlConfigurationClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of SourceControlConfigurationClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public SourceControlConfigurationClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of SourceControlConfigurationClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public SourceControlConfigurationClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-07-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.sourceControlConfigurations = new SourceControlConfigurationsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.extensions = new ExtensionsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "SourceControlConfigurationClient", "2020-07-01-preview"); + } +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationImpl.java new file mode 100644 index 0000000000000..01f63fddbe68e --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationImpl.java @@ -0,0 +1,257 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfiguration; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurationForCreate; +import java.util.Map; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ComplianceStatus; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.HelmOperatorProperties; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.OperatorScopeType; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.OperatorType; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ProvisioningStateType; +import rx.functions.Func1; + +class SourceControlConfigurationImpl extends CreatableUpdatableImpl implements SourceControlConfiguration, SourceControlConfiguration.Definition, SourceControlConfiguration.Update { + private final KubernetesConfigurationManager manager; + private String resourceGroupName; + private String clusterRp; + private String clusterResourceName; + private String clusterName; + private String sourceControlConfigurationName; + private SourceControlConfigurationForCreate createOrUpdateParameter; + + SourceControlConfigurationImpl(String name, KubernetesConfigurationManager manager) { + super(name, new SourceControlConfigurationInner()); + this.manager = manager; + // Set resource name + this.sourceControlConfigurationName = name; + // + this.createOrUpdateParameter = new SourceControlConfigurationForCreate(); + } + + SourceControlConfigurationImpl(SourceControlConfigurationInner inner, KubernetesConfigurationManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.sourceControlConfigurationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterRp = String.fromString(IdParsingUtils.getValueFromIdByName(inner.id(), "providers")); + this.sourceControlConfigurationName = IdParsingUtils.getValueFromIdByName(inner.id(), "sourceControlConfigurations"); + this.clusterResourceName = String.fromString(IdParsingUtils.getValueFromIdByPosition(inner.id(), 6)); + this.clusterName = IdParsingUtils.getValueFromIdByPosition(inner.id(), 7); + // + this.createOrUpdateParameter = new SourceControlConfigurationForCreate(); + } + + @Override + public KubernetesConfigurationManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SourceControlConfigurationsInner client = this.manager().inner().sourceControlConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterRp, this.clusterResourceName, this.clusterName, this.sourceControlConfigurationName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SourceControlConfigurationInner call(SourceControlConfigurationInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SourceControlConfigurationsInner client = this.manager().inner().sourceControlConfigurations(); + return client.createOrUpdateAsync(this.resourceGroupName, this.clusterRp, this.clusterResourceName, this.clusterName, this.sourceControlConfigurationName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SourceControlConfigurationInner call(SourceControlConfigurationInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SourceControlConfigurationsInner client = this.manager().inner().sourceControlConfigurations(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SourceControlConfigurationForCreate(); + } + + @Override + public ComplianceStatus complianceStatus() { + return this.inner().complianceStatus(); + } + + @Override + public String creationTime() { + return this.inner().creationTime(); + } + + @Override + public Boolean enableHelmOperator() { + return this.inner().enableHelmOperator(); + } + + @Override + public HelmOperatorProperties helmOperatorProperties() { + return this.inner().helmOperatorProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String lastModifiedTime() { + return this.inner().lastModifiedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operatorInstanceName() { + return this.inner().operatorInstanceName(); + } + + @Override + public String operatorNamespace() { + return this.inner().operatorNamespace(); + } + + @Override + public String operatorParams() { + return this.inner().operatorParams(); + } + + @Override + public OperatorScopeType operatorScope() { + return this.inner().operatorScope(); + } + + @Override + public OperatorType operatorType() { + return this.inner().operatorType(); + } + + @Override + public ProvisioningStateType provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String repositoryPublicKey() { + return this.inner().repositoryPublicKey(); + } + + @Override + public String repositoryUrl() { + return this.inner().repositoryUrl(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SourceControlConfigurationImpl withExistingProvider(String resourceGroupName, String clusterRp) { + this.resourceGroupName = resourceGroupName; + this.clusterRp = clusterRp; + return this; + } + + @Override + public SourceControlConfigurationImpl withClusterResourceName(String clusterResourceName) { + this.clusterResourceName = clusterResourceName; + return this; + } + + @Override + public SourceControlConfigurationImpl withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + @Override + public SourceControlConfigurationImpl withConfigurationProtectedSettings(Map configurationProtectedSettings) { + this.createOrUpdateParameter.withConfigurationProtectedSettings(configurationProtectedSettings); + return this; + } + + @Override + public SourceControlConfigurationImpl withEnableHelmOperator(Boolean enableHelmOperator) { + this.createOrUpdateParameter.withEnableHelmOperator(enableHelmOperator); + return this; + } + + @Override + public SourceControlConfigurationImpl withHelmOperatorProperties(HelmOperatorProperties helmOperatorProperties) { + this.createOrUpdateParameter.withHelmOperatorProperties(helmOperatorProperties); + return this; + } + + @Override + public SourceControlConfigurationImpl withOperatorInstanceName(String operatorInstanceName) { + this.createOrUpdateParameter.withOperatorInstanceName(operatorInstanceName); + return this; + } + + @Override + public SourceControlConfigurationImpl withOperatorNamespace(String operatorNamespace) { + this.createOrUpdateParameter.withOperatorNamespace(operatorNamespace); + return this; + } + + @Override + public SourceControlConfigurationImpl withOperatorParams(String operatorParams) { + this.createOrUpdateParameter.withOperatorParams(operatorParams); + return this; + } + + @Override + public SourceControlConfigurationImpl withOperatorScope(OperatorScopeType operatorScope) { + this.createOrUpdateParameter.withOperatorScope(operatorScope); + return this; + } + + @Override + public SourceControlConfigurationImpl withOperatorType(OperatorType operatorType) { + this.createOrUpdateParameter.withOperatorType(operatorType); + return this; + } + + @Override + public SourceControlConfigurationImpl withRepositoryUrl(String repositoryUrl) { + this.createOrUpdateParameter.withRepositoryUrl(repositoryUrl); + return this; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationInner.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationInner.java new file mode 100644 index 0000000000000..93bb122a8f0b1 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationInner.java @@ -0,0 +1,314 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.OperatorType; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.OperatorScopeType; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.HelmOperatorProperties; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ProvisioningStateType; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ComplianceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The SourceControl Configuration object returned in Get & Put response. + */ +@JsonFlatten +public class SourceControlConfigurationInner extends ProxyResource { + /** + * 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. Possible values include: 'Flux'. + */ + @JsonProperty(value = "properties.operatorType") + private OperatorType operatorType; + + /** + * Any Parameters for the Operator instance in string format. + */ + @JsonProperty(value = "properties.operatorParams") + private String operatorParams; + + /** + * Scope at which the operator will be installed. Possible values include: + * 'cluster', 'namespace'. + */ + @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; + + /** + * 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. Possible values + * include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed'. + */ + @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; + + /** + * DateLiteral (per ISO8601) noting the time the resource was created by + * the client (user). + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private String creationTime; + + /** + * DateLiteral (per ISO8601) noting the time the resource was modified by + * the client (user). + */ + @JsonProperty(value = "properties.lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedTime; + + /** + * Get url of the SourceControl Repository. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set 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 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 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 instance name of the operator - identifying the specific configuration. + * + * @return the operatorInstanceName value + */ + public String operatorInstanceName() { + return this.operatorInstanceName; + } + + /** + * Set 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 type of the operator. Possible values include: 'Flux'. + * + * @return the operatorType value + */ + public OperatorType operatorType() { + return this.operatorType; + } + + /** + * Set type of the operator. Possible values include: 'Flux'. + * + * @param operatorType the operatorType value to set + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withOperatorType(OperatorType operatorType) { + this.operatorType = operatorType; + return this; + } + + /** + * Get any Parameters for the Operator instance in string format. + * + * @return the operatorParams value + */ + public String operatorParams() { + return this.operatorParams; + } + + /** + * Set 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 scope at which the operator will be installed. Possible values include: 'cluster', 'namespace'. + * + * @return the operatorScope value + */ + public OperatorScopeType operatorScope() { + return this.operatorScope; + } + + /** + * Set scope at which the operator will be installed. Possible values include: 'cluster', 'namespace'. + * + * @param operatorScope the operatorScope value to set + * @return the SourceControlConfigurationInner object itself. + */ + public SourceControlConfigurationInner withOperatorScope(OperatorScopeType operatorScope) { + this.operatorScope = operatorScope; + return this; + } + + /** + * Get 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 option to enable Helm Operator for this git configuration. + * + * @return the enableHelmOperator value + */ + public Boolean enableHelmOperator() { + return this.enableHelmOperator; + } + + /** + * Set 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 properties for Helm operator. + * + * @return the helmOperatorProperties value + */ + public HelmOperatorProperties helmOperatorProperties() { + return this.helmOperatorProperties; + } + + /** + * Set 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 provisioning state of the resource provider. Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed'. + * + * @return the provisioningState value + */ + public ProvisioningStateType provisioningState() { + return this.provisioningState; + } + + /** + * Get compliance Status of the Configuration. + * + * @return the complianceStatus value + */ + public ComplianceStatus complianceStatus() { + return this.complianceStatus; + } + + /** + * Get dateLiteral (per ISO8601) noting the time the resource was created by the client (user). + * + * @return the creationTime value + */ + public String creationTime() { + return this.creationTime; + } + + /** + * Get dateLiteral (per ISO8601) noting the time the resource was modified by the client (user). + * + * @return the lastModifiedTime value + */ + public String lastModifiedTime() { + return this.lastModifiedTime; + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationsImpl.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationsImpl.java new file mode 100644 index 0000000000000..f568c8ebbd309 --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurations; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfiguration; + +class SourceControlConfigurationsImpl extends WrapperImpl implements SourceControlConfigurations { + private final KubernetesConfigurationManager manager; + + SourceControlConfigurationsImpl(KubernetesConfigurationManager manager) { + super(manager.inner().sourceControlConfigurations()); + this.manager = manager; + } + + public KubernetesConfigurationManager manager() { + return this.manager; + } + + @Override + public SourceControlConfigurationImpl define(String name) { + return wrapModel(name); + } + + private SourceControlConfigurationImpl wrapModel(SourceControlConfigurationInner inner) { + return new SourceControlConfigurationImpl(inner, manager()); + } + + private SourceControlConfigurationImpl wrapModel(String name) { + return new SourceControlConfigurationImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + SourceControlConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) + .map(new Func1() { + @Override + public SourceControlConfiguration call(SourceControlConfigurationInner inner) { + return new SourceControlConfigurationImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + SourceControlConfigurationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + SourceControlConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SourceControlConfiguration call(SourceControlConfigurationInner inner) { + return new SourceControlConfigurationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationsInner.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationsInner.java new file mode 100644 index 0000000000000..5465f5df4e2be --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/SourceControlConfigurationsInner.java @@ -0,0 +1,760 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.ErrorResponseException; +import com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurationForCreate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SourceControlConfigurations. + */ +public class SourceControlConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private SourceControlConfigurationsService service; + /** The service client containing this operation class. */ + private SourceControlConfigurationClientImpl client; + + /** + * Initializes an instance of SourceControlConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SourceControlConfigurationsInner(Retrofit retrofit, SourceControlConfigurationClientImpl client) { + this.service = retrofit.create(SourceControlConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SourceControlConfigurations to be + * used by Retrofit to perform actually REST calls. + */ + interface SourceControlConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Path("sourceControlConfigurationName") String sourceControlConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurations createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Path("sourceControlConfigurationName") String sourceControlConfigurationName, @Query("api-version") String apiVersion, @Body SourceControlConfigurationForCreate sourceControlConfiguration, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurations delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Path("sourceControlConfigurationName") String sourceControlConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurations beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Path("sourceControlConfigurationName") String sourceControlConfigurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurations list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterRp") String clusterRp, @Path("clusterResourceName") String clusterResourceName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.SourceControlConfigurations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SourceControlConfigurationInner object if successful. + */ + public SourceControlConfigurationInner get(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).toBlocking().single().body(); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName), serviceCallback); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SourceControlConfigurationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).map(new Func1, SourceControlConfigurationInner>() { + @Override + public SourceControlConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SourceControlConfigurationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (sourceControlConfigurationName == null) { + throw new IllegalArgumentException("Parameter sourceControlConfigurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SourceControlConfigurationInner object if successful. + */ + public SourceControlConfigurationInner createOrUpdate(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, SourceControlConfigurationForCreate sourceControlConfiguration) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, sourceControlConfiguration).toBlocking().single().body(); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param sourceControlConfiguration Properties necessary to Create KubernetesConfiguration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, SourceControlConfigurationForCreate sourceControlConfiguration, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, sourceControlConfiguration), serviceCallback); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @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 + * @return the observable to the SourceControlConfigurationInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, SourceControlConfigurationForCreate sourceControlConfiguration) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, sourceControlConfiguration).map(new Func1, SourceControlConfigurationInner>() { + @Override + public SourceControlConfigurationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @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 + * @return the observable to the SourceControlConfigurationInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, SourceControlConfigurationForCreate sourceControlConfiguration) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (sourceControlConfigurationName == null) { + throw new IllegalArgumentException("Parameter sourceControlConfigurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (sourceControlConfiguration == null) { + throw new IllegalArgumentException("Parameter sourceControlConfiguration is required and cannot be null."); + } + Validator.validate(sourceControlConfiguration); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, this.client.apiVersion(), sourceControlConfiguration, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).toBlocking().last().body(); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName), serviceCallback); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (sourceControlConfigurationName == null) { + throw new IllegalArgumentException("Parameter sourceControlConfigurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).toBlocking().single().body(); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName), serviceCallback); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param sourceControlConfigurationName Name of the Source Control Configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterRp, String clusterResourceName, String clusterName, String sourceControlConfigurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (sourceControlConfigurationName == null) { + throw new IllegalArgumentException("Parameter sourceControlConfigurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SourceControlConfigurationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SourceControlConfigurationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SourceControlConfigurationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + return listSinglePageAsync(resourceGroupName, clusterRp, clusterResourceName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all Source Control Configurations. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterRp The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters). Possible values include: 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + ServiceResponse> * @param clusterResourceName The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters). Possible values include: 'managedClusters', 'connectedClusters' + ServiceResponse> * @param clusterName The name of the kubernetes cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SourceControlConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String clusterRp, final String clusterResourceName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterRp == null) { + throw new IllegalArgumentException("Parameter clusterRp is required and cannot be null."); + } + if (clusterResourceName == null) { + throw new IllegalArgumentException("Parameter clusterResourceName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterRp, clusterResourceName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * List all Source Control Configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SourceControlConfigurationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all Source Control Configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all Source Control Configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SourceControlConfigurationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all Source Control Configurations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SourceControlConfigurationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all Source Control Configurations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SourceControlConfigurationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/package-info.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..7fd524c6c565b --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for SourceControlConfigurationClient. + * KubernetesConfiguration Client. + */ +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview.implementation; diff --git a/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/package-info.java b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/package-info.java new file mode 100644 index 0000000000000..bdcd67f5b3b3b --- /dev/null +++ b/sdk/kubernetesconfiguration/mgmt-v2020_07_01_preview/src/main/java/com/microsoft/azure/management/kubernetesconfiguration/v2020_07_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for SourceControlConfigurationClient. + * KubernetesConfiguration Client. + */ +package com.microsoft.azure.management.kubernetesconfiguration.v2020_07_01_preview;