Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR containerservices/resource-manager] [AKS] specify byte format for base64-encoded kubeconfig #300

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
/**
* 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.containerservice.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 ContainerServiceClientImpl class.
*/
public class ContainerServiceClientImpl 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;
}

/** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */
private String subscriptionId;

/**
* Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
*
* @return the subscriptionId value.
*/
public String subscriptionId() {
return this.subscriptionId;
}

/**
* Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
*
* @param subscriptionId the subscriptionId value.
* @return the service client itself
*/
public ContainerServiceClientImpl withSubscriptionId(String subscriptionId) {
this.subscriptionId = subscriptionId;
return this;
}

/** Gets or sets the preferred language for the response. */
private String acceptLanguage;

/**
* Gets Gets or sets the preferred language for the response.
*
* @return the acceptLanguage value.
*/
public String acceptLanguage() {
return this.acceptLanguage;
}

/**
* Sets Gets or sets the preferred language for the response.
*
* @param acceptLanguage the acceptLanguage value.
* @return the service client itself
*/
public ContainerServiceClientImpl withAcceptLanguage(String acceptLanguage) {
this.acceptLanguage = acceptLanguage;
return this;
}

/** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */
private int longRunningOperationRetryTimeout;

/**
* Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
*
* @return the longRunningOperationRetryTimeout value.
*/
public int longRunningOperationRetryTimeout() {
return this.longRunningOperationRetryTimeout;
}

/**
* Sets Gets or 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 ContainerServiceClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
return this;
}

/** 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 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 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 ContainerServiceClientImpl withGenerateClientRequestId(boolean generateClientRequestId) {
this.generateClientRequestId = generateClientRequestId;
return this;
}

/**
* The ContainerServicesInner object to access its operations.
*/
private ContainerServicesInner containerServices;

/**
* Gets the ContainerServicesInner object to access its operations.
* @return the ContainerServicesInner object.
*/
public ContainerServicesInner containerServices() {
return this.containerServices;
}

/**
* The ManagedClustersInner object to access its operations.
*/
private ManagedClustersInner managedClusters;

/**
* Gets the ManagedClustersInner object to access its operations.
* @return the ManagedClustersInner object.
*/
public ManagedClustersInner managedClusters() {
return this.managedClusters;
}

/**
* Initializes an instance of ContainerServiceClient client.
*
* @param credentials the management credentials for Azure
*/
public ContainerServiceClientImpl(ServiceClientCredentials credentials) {
this("https://management.azure.com", credentials);
}

/**
* Initializes an instance of ContainerServiceClient client.
*
* @param baseUrl the base URL of the host
* @param credentials the management credentials for Azure
*/
public ContainerServiceClientImpl(String baseUrl, ServiceClientCredentials credentials) {
super(baseUrl, credentials);
initialize();
}

/**
* Initializes an instance of ContainerServiceClient client.
*
* @param restClient the REST client to connect to Azure.
*/
public ContainerServiceClientImpl(RestClient restClient) {
super(restClient);
initialize();
}

protected void initialize() {
this.acceptLanguage = "en-US";
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
this.containerServices = new ContainerServicesInner(restClient().retrofit(), this);
this.managedClusters = new ManagedClustersInner(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)", super.userAgent(), "ContainerServiceClient");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ public class ContainerServicesInner implements InnerSupportsGet<ContainerService
/** The Retrofit service to perform REST calls. */
private ContainerServicesService service;
/** The service client containing this operation class. */
private ContainerServiceManagementClientImpl client;
private ContainerServiceClientImpl client;

/**
* Initializes an instance of ContainerServicesInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public ContainerServicesInner(Retrofit retrofit, ContainerServiceManagementClientImpl client) {
public ContainerServicesInner(Retrofit retrofit, ContainerServiceClientImpl client) {
this.service = retrofit.create(ContainerServicesService.class);
this.client = client;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public class ManagedClusterAccessProfileInner extends Resource {
* Base64-encoded Kubernetes configuration file.
*/
@JsonProperty(value = "properties.kubeConfig")
private String kubeConfig;
private byte[] kubeConfig;

/**
* Get the kubeConfig value.
*
* @return the kubeConfig value
*/
public String kubeConfig() {
public byte[] kubeConfig() {
return this.kubeConfig;
}

Expand All @@ -38,7 +38,7 @@ public String kubeConfig() {
* @param kubeConfig the kubeConfig value to set
* @return the ManagedClusterAccessProfileInner object itself.
*/
public ManagedClusterAccessProfileInner withKubeConfig(String kubeConfig) {
public ManagedClusterAccessProfileInner withKubeConfig(byte[] kubeConfig) {
this.kubeConfig = kubeConfig;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ public class ManagedClustersInner implements InnerSupportsGet<ManagedClusterInne
/** The Retrofit service to perform REST calls. */
private ManagedClustersService service;
/** The service client containing this operation class. */
private ContainerServiceManagementClientImpl client;
private ContainerServiceClientImpl client;

/**
* Initializes an instance of ManagedClustersInner.
*
* @param retrofit the Retrofit instance built from a Retrofit Builder.
* @param client the instance of the service client containing this operation class.
*/
public ManagedClustersInner(Retrofit retrofit, ContainerServiceManagementClientImpl client) {
public ManagedClustersInner(Retrofit retrofit, ContainerServiceClientImpl client) {
this.service = retrofit.create(ManagedClustersService.class);
this.client = client;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
* This package contains the implementation classes for ContainerServiceManagementClient.
* Container Service Client.
* This package contains the implementation classes for ContainerServiceClient.
* The Container Service Client.
*/
package com.microsoft.azure.management.containerservice.implementation;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
* This package contains the classes for ContainerServiceManagementClient.
* Container Service Client.
* This package contains the classes for ContainerServiceClient.
* The Container Service Client.
*/
package com.microsoft.azure.management.containerservice;