queryParams, List queryParams, List
queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException {
- updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
-
- final String url = buildUrl(path, queryParams, collectionQueryParams);
- final Request.Builder reqBuilder = new Request.Builder().url(url);
- processHeaderParams(headerParams, reqBuilder);
- processCookieParams(cookieParams, reqBuilder);
+ public Request buildRequest(String baseUrl, String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String[] authNames, ApiCallback callback) throws ApiException {
+ // aggregate queryParams (non-collection) and collectionQueryParams into allQueryParams
+ List allQueryParams = new ArrayList(queryParams);
+ allQueryParams.addAll(collectionQueryParams);
- String contentType = (String) headerParams.get("Content-Type");
- // ensuring a default content type
- if (contentType == null) {
- contentType = "application/json";
- }
+ final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams);
+ // prepare HTTP request body
RequestBody reqBody;
+ String contentType = headerParams.get("Content-Type");
+
if (!HttpMethod.permitsRequestBody(method)) {
reqBody = null;
} else if ("application/x-www-form-urlencoded".equals(contentType)) {
@@ -1055,12 +1180,19 @@ public Request buildRequest(String path, String method, List queryParams,
reqBody = null;
} else {
// use an empty request body (for POST, PUT and PATCH)
- reqBody = RequestBody.create(MediaType.parse(contentType), "");
+ reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType));
}
} else {
reqBody = serialize(body, contentType);
}
+ // update parameters with authentication settings
+ updateParamsForAuth(authNames, allQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url));
+
+ final Request.Builder reqBuilder = new Request.Builder().url(url);
+ processHeaderParams(headerParams, reqBuilder);
+ processCookieParams(cookieParams, reqBuilder);
+
// Associate callback with request (if not null) so interceptor can
// access it when creating ProgressResponseBody
reqBuilder.tag(callback);
@@ -1080,14 +1212,30 @@ public Request buildRequest(String path, String method, List queryParams,
/**
* Build full URL by concatenating base path, the given sub path and query parameters.
*
+ * @param baseUrl The base URL
* @param path The sub path
* @param queryParams The query parameters
* @param collectionQueryParams The collection query parameters
* @return The full URL
*/
- public String buildUrl(String path, List queryParams, List collectionQueryParams) {
+ public String buildUrl(String baseUrl, String path, List queryParams, List collectionQueryParams) {
final StringBuilder url = new StringBuilder();
- url.append(basePath).append(path);
+ if (baseUrl != null) {
+ url.append(baseUrl).append(path);
+ } else {
+ String baseURL;
+ if (serverIndex != null) {
+ if (serverIndex < 0 || serverIndex >= servers.size()) {
+ throw new ArrayIndexOutOfBoundsException(String.format(
+ "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size()
+ ));
+ }
+ baseURL = servers.get(serverIndex).URL(serverVariables);
+ } else {
+ baseURL = basePath;
+ }
+ url.append(baseURL).append(path);
+ }
if (queryParams != null && !queryParams.isEmpty()) {
// support (constant) query string in `path`, e.g. "/posts?draft=1"
@@ -1167,14 +1315,19 @@ public void processCookieParams(Map cookieParams, Request.Builde
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
* @param cookieParams Map of cookie parameters
+ * @param payload HTTP request body
+ * @param method HTTP method
+ * @param uri URI
+ * @throws io.kubernetes.client.openapi.ApiException If fails to update the parameters
*/
- public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) {
+ public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams,
+ Map cookieParams, String payload, String method, URI uri) throws ApiException {
for (String authName : authNames) {
Authentication auth = authentications.get(authName);
if (auth == null) {
throw new RuntimeException("Authentication undefined: " + authName);
}
- auth.applyToParams(queryParams, headerParams, cookieParams);
+ auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri);
}
}
@@ -1204,12 +1357,18 @@ public RequestBody buildRequestBodyMultipart(Map formParams) {
for (Entry param : formParams.entrySet()) {
if (param.getValue() instanceof File) {
File file = (File) param.getValue();
- Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\"");
- MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file));
- mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file));
+ addPartToMultiPartBuilder(mpBuilder, param.getKey(), file);
+ } else if (param.getValue() instanceof List) {
+ List list = (List) param.getValue();
+ for (Object item: list) {
+ if (item instanceof File) {
+ addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item);
+ } else {
+ addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue());
+ }
+ }
} else {
- Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"");
- mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue())));
+ addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue());
}
}
return mpBuilder.build();
@@ -1230,6 +1389,44 @@ public String guessContentTypeFromFile(File file) {
}
}
+ /**
+ * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder.
+ *
+ * @param mpBuilder MultipartBody.Builder
+ * @param key The key of the Header element
+ * @param file The file to add to the Header
+ */
+ private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) {
+ Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\"");
+ MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file));
+ mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType));
+ }
+
+ /**
+ * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder.
+ *
+ * @param mpBuilder MultipartBody.Builder
+ * @param key The key of the Header element
+ * @param obj The complex object to add to the Header
+ */
+ private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) {
+ RequestBody requestBody;
+ if (obj instanceof String) {
+ requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain"));
+ } else {
+ String content;
+ if (obj != null) {
+ content = JSON.serialize(obj);
+ } else {
+ content = null;
+ }
+ requestBody = RequestBody.create(content, MediaType.parse("application/json"));
+ }
+
+ Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"");
+ mpBuilder.addPart(partHeaders, requestBody);
+ }
+
/**
* Get network interceptor to add it to the httpClient to track download progress for
* async requests.
@@ -1297,7 +1494,7 @@ public boolean verify(String hostname, SSLSession session) {
KeyStore caKeyStore = newEmptyKeyStore(password);
int index = 0;
for (Certificate certificate : certificates) {
- String certificateAlias = "ca" + Integer.toString(index++);
+ String certificateAlias = "ca" + (index++);
caKeyStore.setCertificateEntry(certificateAlias, certificate);
}
trustManagerFactory.init(caKeyStore);
@@ -1326,4 +1523,26 @@ private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityExcepti
throw new AssertionError(e);
}
}
+
+ /**
+ * Convert the HTTP request body to a string.
+ *
+ * @param requestBody The HTTP request object
+ * @return The string representation of the HTTP request body
+ * @throws io.kubernetes.client.openapi.ApiException If fail to serialize the request body object into a string
+ */
+ private String requestBodyToString(RequestBody requestBody) throws ApiException {
+ if (requestBody != null) {
+ try {
+ final Buffer buffer = new Buffer();
+ requestBody.writeTo(buffer);
+ return buffer.readUtf8();
+ } catch (final IOException e) {
+ throw new ApiException(e);
+ }
+ }
+
+ // empty http request body
+ return "";
+ }
}
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiException.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiException.java
index 25846be158..77238c3b0f 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiException.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiException.java
@@ -21,16 +21,38 @@ public class ApiException extends Exception {
private Map> responseHeaders = null;
private String responseBody = null;
+ /**
+ * Constructor for ApiException.
+ */
public ApiException() {}
+ /**
+ * Constructor for ApiException.
+ *
+ * @param throwable a {@link java.lang.Throwable} object
+ */
public ApiException(Throwable throwable) {
super(throwable);
}
+ /**
+ * Constructor for ApiException.
+ *
+ * @param message the error message
+ */
public ApiException(String message) {
super(message);
}
+ /**
+ * Constructor for ApiException.
+ *
+ * @param message the error message
+ * @param throwable a {@link java.lang.Throwable} object
+ * @param code HTTP status code
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) {
super(message, throwable);
this.code = code;
@@ -38,23 +60,60 @@ public ApiException(String message, Throwable throwable, int code, MapConstructor for ApiException.
+ *
+ * @param message the error message
+ * @param code HTTP status code
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
public ApiException(String message, int code, Map> responseHeaders, String responseBody) {
this(message, (Throwable) null, code, responseHeaders, responseBody);
}
+ /**
+ * Constructor for ApiException.
+ *
+ * @param message the error message
+ * @param throwable a {@link java.lang.Throwable} object
+ * @param code HTTP status code
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ */
public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) {
this(message, throwable, code, responseHeaders, null);
}
+ /**
+ * Constructor for ApiException.
+ *
+ * @param code HTTP status code
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
public ApiException(int code, Map> responseHeaders, String responseBody) {
- this((String) null, (Throwable) null, code, responseHeaders, responseBody);
+ this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody);
}
+ /**
+ * Constructor for ApiException.
+ *
+ * @param code HTTP status code
+ * @param message a {@link java.lang.String} object
+ */
public ApiException(int code, String message) {
super(message);
this.code = code;
}
+ /**
+ * Constructor for ApiException.
+ *
+ * @param code HTTP status code
+ * @param message the error message
+ * @param responseHeaders a {@link java.util.Map} of HTTP response headers
+ * @param responseBody the response body
+ */
public ApiException(int code, String message, Map> responseHeaders, String responseBody) {
this(code, message);
this.responseHeaders = responseHeaders;
@@ -87,4 +146,14 @@ public Map> getResponseHeaders() {
public String getResponseBody() {
return responseBody;
}
+
+ /**
+ * Get the exception message including HTTP response data.
+ *
+ * @return The exception message
+ */
+ public String getMessage() {
+ return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s",
+ super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders());
+ }
}
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiResponse.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiResponse.java
index 18ff659d51..c7f62a4484 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiResponse.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/ApiResponse.java
@@ -17,8 +17,6 @@
/**
* API response returned by API call.
- *
- * @param The type of data that is deserialized from response body
*/
public class ApiResponse {
final private int statusCode;
@@ -26,6 +24,8 @@ public class ApiResponse {
final private T data;
/**
+ * Constructor for ApiResponse.
+ *
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
*/
@@ -34,6 +34,8 @@ public ApiResponse(int statusCode, Map> headers) {
}
/**
+ * Constructor for ApiResponse.
+ *
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
@@ -44,14 +46,29 @@ public ApiResponse(int statusCode, Map> headers, T data) {
this.data = data;
}
+ /**
+ * Get the status code
.
+ *
+ * @return the status code
+ */
public int getStatusCode() {
return statusCode;
}
+ /**
+ * Get the headers
.
+ *
+ * @return a {@link java.util.Map} of headers
+ */
public Map> getHeaders() {
return headers;
}
+ /**
+ * Get the data
.
+ *
+ * @return the data
+ */
public T getData() {
return data;
}
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/Configuration.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/Configuration.java
index 77bb757f6e..1118d70765 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/Configuration.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/Configuration.java
@@ -14,6 +14,8 @@
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2023-12-01T19:05:21.333462Z[Etc/UTC]")
public class Configuration {
+ public static final String VERSION = "20.0.0-SNAPSHOT";
+
private static ApiClient defaultApiClient = new ApiClient();
/**
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/JSON.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/JSON.java
index 5a9feaa43e..72abd47d19 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/JSON.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/JSON.java
@@ -1,5 +1,5 @@
/*
-Copyright 2021 The Kubernetes Authors.
+Copyright 2023 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
@@ -14,31 +14,45 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
+import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
+import com.google.gson.JsonElement;
import io.gsonfire.GsonFireBuilder;
-import io.kubernetes.client.gson.V1StatusPreProcessor;
-import io.kubernetes.client.openapi.models.V1Status;
+import io.gsonfire.TypeSelector;
+
+import okio.ByteString;
+
import java.io.IOException;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException;
-import java.time.Instant;
+import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
-import java.time.format.DateTimeFormatterBuilder;
-import java.time.format.DateTimeParseException;
-import java.time.temporal.ChronoField;
import java.util.Date;
+import java.util.Locale;
import java.util.Map;
-import okio.ByteString;
+import java.util.HashMap;
+/*
+ * A JSON utility class
+ *
+ * NOTE: in the future, this class may be converted to static, which may break
+ * backward-compatibility
+ */
public class JSON {
+ private static Gson gson;
+ private static boolean isLenientOnJson = false;
+ private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
+ private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
+ private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
+ private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
+ private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
private Gson gson;
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/Pair.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/Pair.java
index d3367162d6..64da0c5b25 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/Pair.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/Pair.java
@@ -51,10 +51,6 @@ private boolean isValidString(String arg) {
return false;
}
- if (arg.trim().isEmpty()) {
- return false;
- }
-
return true;
}
}
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/ServerConfiguration.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/ServerConfiguration.java
index 7ae6af31e5..ffb42219f0 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/ServerConfiguration.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/ServerConfiguration.java
@@ -24,7 +24,7 @@ public class ServerConfiguration {
/**
* @param URL A URL to the target host.
- * @param description A describtion of the host designated by the URL.
+ * @param description A description of the host designated by the URL.
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
*/
public ServerConfiguration(String URL, String description, Map variables) {
@@ -51,10 +51,10 @@ public String URL(Map variables) {
if (variables != null && variables.containsKey(name)) {
value = variables.get(name);
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
- throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
+ throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
- url = url.replaceAll("\\{" + name + "\\}", value);
+ url = url.replace("{" + name + "}", value);
}
return url;
}
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/StringUtil.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/StringUtil.java
index 8b7039fdb7..56732c80bd 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/StringUtil.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/StringUtil.java
@@ -57,4 +57,23 @@ public static String join(String[] array, String separator) {
}
return out.toString();
}
+
+ /**
+ * Join a list of strings with the given separator.
+ *
+ * @param list The list of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(Collection list, String separator) {
+ Iterator iterator = list.iterator();
+ StringBuilder out = new StringBuilder();
+ if (iterator.hasNext()) {
+ out.append(iterator.next());
+ }
+ while (iterator.hasNext()) {
+ out.append(separator).append(iterator.next());
+ }
+ return out.toString();
+ }
}
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/AdmissionregistrationApi.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/AdmissionregistrationApi.java
index 50190aef3c..1b9e3e0d77 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/AdmissionregistrationApi.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/AdmissionregistrationApi.java
@@ -33,9 +33,12 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import jakarta.ws.rs.core.GenericType;
public class AdmissionregistrationApi {
private ApiClient localVarApiClient;
+ private int localHostIndex;
+ private String localCustomBaseUrl;
public AdmissionregistrationApi() {
this(Configuration.getDefaultApiClient());
@@ -53,6 +56,22 @@ public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
+ public int getHostIndex() {
+ return localHostIndex;
+ }
+
+ public void setHostIndex(int hostIndex) {
+ this.localHostIndex = hostIndex;
+ }
+
+ public String getCustomBaseUrl() {
+ return localCustomBaseUrl;
+ }
+
+ public void setCustomBaseUrl(String customBaseUrl) {
+ this.localCustomBaseUrl = customBaseUrl;
+ }
+
/**
* Build call for getAPIGroup
* @param _callback Callback for upload/download progress
@@ -66,6 +85,19 @@ public void setApiClient(ApiClient apiClient) {
*/
public okhttp3.Call getAPIGroupCall(final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = null;
// create path and map variables
@@ -76,8 +108,11 @@ public okhttp3.Call getAPIGroupCall(final ApiCallback _callback) throws ApiExcep
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
+
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -85,21 +120,19 @@ public okhttp3.Call getAPIGroupCall(final ApiCallback _callback) throws ApiExcep
}
final String[] localVarContentTypes = {
-
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAPIGroupValidateBeforeCall(final ApiCallback _callback) throws ApiException {
-
-
- okhttp3.Call localVarCall = getAPIGroupCall(_callback);
- return localVarCall;
+ return getAPIGroupCall(_callback);
}
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/AdmissionregistrationV1Api.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/AdmissionregistrationV1Api.java
index 84a92a7fcf..e0681aa0e7 100644
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/AdmissionregistrationV1Api.java
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/AdmissionregistrationV1Api.java
@@ -40,9 +40,12 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import jakarta.ws.rs.core.GenericType;
public class AdmissionregistrationV1Api {
private ApiClient localVarApiClient;
+ private int localHostIndex;
+ private String localCustomBaseUrl;
public AdmissionregistrationV1Api() {
this(Configuration.getDefaultApiClient());
@@ -60,6 +63,22 @@ public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
+ public int getHostIndex() {
+ return localHostIndex;
+ }
+
+ public void setHostIndex(int hostIndex) {
+ this.localHostIndex = hostIndex;
+ }
+
+ public String getCustomBaseUrl() {
+ return localCustomBaseUrl;
+ }
+
+ public void setCustomBaseUrl(String customBaseUrl) {
+ this.localCustomBaseUrl = customBaseUrl;
+ }
+
/**
* Build call for createMutatingWebhookConfiguration
* @param body (required)
@@ -80,6 +99,19 @@ public void setApiClient(ApiClient apiClient) {
*/
public okhttp3.Call createMutatingWebhookConfigurationCall(V1MutatingWebhookConfiguration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = body;
// create path and map variables
@@ -87,6 +119,10 @@ public okhttp3.Call createMutatingWebhookConfigurationCall(V1MutatingWebhookConf
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
@@ -103,11 +139,10 @@ public okhttp3.Call createMutatingWebhookConfigurationCall(V1MutatingWebhookConf
localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation));
}
- Map localVarHeaderParams = new HashMap();
- Map localVarCookieParams = new HashMap();
- Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -118,23 +153,22 @@ public okhttp3.Call createMutatingWebhookConfigurationCall(V1MutatingWebhookConf
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createMutatingWebhookConfigurationValidateBeforeCall(V1MutatingWebhookConfiguration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException {
-
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling createMutatingWebhookConfiguration(Async)");
}
-
- okhttp3.Call localVarCall = createMutatingWebhookConfigurationCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback);
- return localVarCall;
+ return createMutatingWebhookConfigurationCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback);
}
@@ -234,6 +268,19 @@ public okhttp3.Call createMutatingWebhookConfigurationAsync(V1MutatingWebhookCon
*/
public okhttp3.Call createValidatingWebhookConfigurationCall(V1ValidatingWebhookConfiguration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = body;
// create path and map variables
@@ -241,6 +288,10 @@ public okhttp3.Call createValidatingWebhookConfigurationCall(V1ValidatingWebhook
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
@@ -257,11 +308,10 @@ public okhttp3.Call createValidatingWebhookConfigurationCall(V1ValidatingWebhook
localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation));
}
- Map localVarHeaderParams = new HashMap();
- Map localVarCookieParams = new HashMap();
- Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -272,23 +322,22 @@ public okhttp3.Call createValidatingWebhookConfigurationCall(V1ValidatingWebhook
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createValidatingWebhookConfigurationValidateBeforeCall(V1ValidatingWebhookConfiguration body, String pretty, String dryRun, String fieldManager, String fieldValidation, final ApiCallback _callback) throws ApiException {
-
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling createValidatingWebhookConfiguration(Async)");
}
-
- okhttp3.Call localVarCall = createValidatingWebhookConfigurationCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback);
- return localVarCall;
+ return createValidatingWebhookConfigurationCall(body, pretty, dryRun, fieldManager, fieldValidation, _callback);
}
@@ -395,6 +444,19 @@ public okhttp3.Call createValidatingWebhookConfigurationAsync(V1ValidatingWebhoo
*/
public okhttp3.Call deleteCollectionMutatingWebhookConfigurationCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = body;
// create path and map variables
@@ -402,6 +464,10 @@ public okhttp3.Call deleteCollectionMutatingWebhookConfigurationCall(String pret
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
@@ -454,11 +520,10 @@ public okhttp3.Call deleteCollectionMutatingWebhookConfigurationCall(String pret
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds));
}
- Map localVarHeaderParams = new HashMap();
- Map localVarCookieParams = new HashMap();
- Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -469,18 +534,17 @@ public okhttp3.Call deleteCollectionMutatingWebhookConfigurationCall(String pret
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteCollectionMutatingWebhookConfigurationValidateBeforeCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {
-
-
- okhttp3.Call localVarCall = deleteCollectionMutatingWebhookConfigurationCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback);
- return localVarCall;
+ return deleteCollectionMutatingWebhookConfigurationCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback);
}
@@ -608,6 +672,19 @@ public okhttp3.Call deleteCollectionMutatingWebhookConfigurationAsync(String pre
*/
public okhttp3.Call deleteCollectionValidatingWebhookConfigurationCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = body;
// create path and map variables
@@ -615,6 +692,10 @@ public okhttp3.Call deleteCollectionValidatingWebhookConfigurationCall(String pr
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
@@ -667,11 +748,10 @@ public okhttp3.Call deleteCollectionValidatingWebhookConfigurationCall(String pr
localVarQueryParams.addAll(localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds));
}
- Map localVarHeaderParams = new HashMap();
- Map localVarCookieParams = new HashMap();
- Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -682,18 +762,17 @@ public okhttp3.Call deleteCollectionValidatingWebhookConfigurationCall(String pr
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteCollectionValidatingWebhookConfigurationValidateBeforeCall(String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {
-
-
- okhttp3.Call localVarCall = deleteCollectionValidatingWebhookConfigurationCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback);
- return localVarCall;
+ return deleteCollectionValidatingWebhookConfigurationCall(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, body, _callback);
}
@@ -815,14 +894,31 @@ public okhttp3.Call deleteCollectionValidatingWebhookConfigurationAsync(String p
*/
public okhttp3.Call deleteMutatingWebhookConfigurationCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"
- .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));
+ .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
@@ -843,11 +939,10 @@ public okhttp3.Call deleteMutatingWebhookConfigurationCall(String name, String p
localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy));
}
- Map localVarHeaderParams = new HashMap();
- Map localVarCookieParams = new HashMap();
- Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -858,23 +953,22 @@ public okhttp3.Call deleteMutatingWebhookConfigurationCall(String name, String p
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteMutatingWebhookConfigurationValidateBeforeCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {
-
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling deleteMutatingWebhookConfiguration(Async)");
}
-
- okhttp3.Call localVarCall = deleteMutatingWebhookConfigurationCall(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, _callback);
- return localVarCall;
+ return deleteMutatingWebhookConfigurationCall(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, _callback);
}
@@ -978,14 +1072,31 @@ public okhttp3.Call deleteMutatingWebhookConfigurationAsync(String name, String
*/
public okhttp3.Call deleteValidatingWebhookConfigurationCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}"
- .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));
+ .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
@@ -1006,11 +1117,10 @@ public okhttp3.Call deleteValidatingWebhookConfigurationCall(String name, String
localVarQueryParams.addAll(localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy));
}
- Map localVarHeaderParams = new HashMap();
- Map localVarCookieParams = new HashMap();
- Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1021,23 +1131,22 @@ public okhttp3.Call deleteValidatingWebhookConfigurationCall(String name, String
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteValidatingWebhookConfigurationValidateBeforeCall(String name, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException {
-
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException("Missing the required parameter 'name' when calling deleteValidatingWebhookConfiguration(Async)");
}
-
- okhttp3.Call localVarCall = deleteValidatingWebhookConfigurationCall(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, _callback);
- return localVarCall;
+ return deleteValidatingWebhookConfigurationCall(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, _callback);
}
@@ -1133,6 +1242,19 @@ public okhttp3.Call deleteValidatingWebhookConfigurationAsync(String name, Strin
*/
public okhttp3.Call getAPIResourcesCall(final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = null;
// create path and map variables
@@ -1143,8 +1265,11 @@ public okhttp3.Call getAPIResourcesCall(final ApiCallback _callback) throws ApiE
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
+
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1152,21 +1277,19 @@ public okhttp3.Call getAPIResourcesCall(final ApiCallback _callback) throws ApiE
}
final String[] localVarContentTypes = {
-
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getAPIResourcesValidateBeforeCall(final ApiCallback _callback) throws ApiException {
-
-
- okhttp3.Call localVarCall = getAPIResourcesCall(_callback);
- return localVarCall;
+ return getAPIResourcesCall(_callback);
}
@@ -1249,6 +1372,19 @@ public okhttp3.Call getAPIResourcesAsync(final ApiCallback _c
*/
public okhttp3.Call listMutatingWebhookConfigurationCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = null;
// create path and map variables
@@ -1256,6 +1392,10 @@ public okhttp3.Call listMutatingWebhookConfigurationCall(String pretty, Boolean
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
@@ -1300,11 +1440,12 @@ public okhttp3.Call listMutatingWebhookConfigurationCall(String pretty, Boolean
localVarQueryParams.addAll(localVarApiClient.parameterToPair("watch", watch));
}
- Map localVarHeaderParams = new HashMap();
- Map localVarCookieParams = new HashMap();
- Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/json;stream=watch", "application/vnd.kubernetes.protobuf;stream=watch"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1312,21 +1453,19 @@ public okhttp3.Call listMutatingWebhookConfigurationCall(String pretty, Boolean
}
final String[] localVarContentTypes = {
-
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listMutatingWebhookConfigurationValidateBeforeCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException {
-
-
- okhttp3.Call localVarCall = listMutatingWebhookConfigurationCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback);
- return localVarCall;
+ return listMutatingWebhookConfigurationCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback);
}
@@ -1442,6 +1581,19 @@ public okhttp3.Call listMutatingWebhookConfigurationAsync(String pretty, Boolean
*/
public okhttp3.Call listValidatingWebhookConfigurationCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = null;
// create path and map variables
@@ -1449,6 +1601,10 @@ public okhttp3.Call listValidatingWebhookConfigurationCall(String pretty, Boolea
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map localVarFormParams = new HashMap();
+
if (pretty != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
}
@@ -1493,11 +1649,12 @@ public okhttp3.Call listValidatingWebhookConfigurationCall(String pretty, Boolea
localVarQueryParams.addAll(localVarApiClient.parameterToPair("watch", watch));
}
- Map localVarHeaderParams = new HashMap();
- Map localVarCookieParams = new HashMap();
- Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
- "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", "application/json;stream=watch", "application/vnd.kubernetes.protobuf;stream=watch"
+ "application/json",
+ "application/yaml",
+ "application/vnd.kubernetes.protobuf",
+ "application/json;stream=watch",
+ "application/vnd.kubernetes.protobuf;stream=watch"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1505,21 +1662,19 @@ public okhttp3.Call listValidatingWebhookConfigurationCall(String pretty, Boolea
}
final String[] localVarContentTypes = {
-
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
- localVarHeaderParams.put("Content-Type", localVarContentType);
+ if (localVarContentType != null) {
+ localVarHeaderParams.put("Content-Type", localVarContentType);
+ }
String[] localVarAuthNames = new String[] { "BearerToken" };
- return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
+ return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listValidatingWebhookConfigurationValidateBeforeCall(String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Boolean sendInitialEvents, Integer timeoutSeconds, Boolean watch, final ApiCallback _callback) throws ApiException {
-
-
- okhttp3.Call localVarCall = listValidatingWebhookConfigurationCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback);
- return localVarCall;
+ return listValidatingWebhookConfigurationCall(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, sendInitialEvents, timeoutSeconds, watch, _callback);
}
@@ -1632,14 +1787,31 @@ public okhttp3.Call listValidatingWebhookConfigurationAsync(String pretty, Boole
*/
public okhttp3.Call patchMutatingWebhookConfigurationCall(String name, V1Patch body, String pretty, String dryRun, String fieldManager, String fieldValidation, Boolean force, final ApiCallback _callback) throws ApiException {
+ String basePath = null;
+ // Operation Servers
+ String[] localBasePaths = new String[] { };
+
+ // Determine Base Path to Use
+ if (localCustomBaseUrl != null){
+ basePath = localCustomBaseUrl;
+ } else if ( localBasePaths.length > 0 ) {
+ basePath = localBasePaths[localHostIndex];
+ } else {
+ basePath = null;
+ }
+
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}"
- .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));
+ .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+ Map localVarCookieParams = new HashMap();
+ Map