11/*
2- Copyright 2025 The Kubernetes Authors.
3- Licensed under the Apache License, Version 2.0 (the "License");
4- you may not use this file except in compliance with the License.
5- You may obtain a copy of the License at
6- http://www.apache.org/licenses/LICENSE-2.0
7- Unless required by applicable law or agreed to in writing, software
8- distributed under the License is distributed on an "AS IS" BASIS,
9- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10- See the License for the specific language governing permissions and
11- limitations under the License.
12- */
2+ * Kubernetes
3+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4+ *
5+ * The version of the OpenAPI document: release-1.34
6+ *
7+ *
8+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+ * https://openapi-generator.tech
10+ * Do not edit the class manually.
11+ */
12+
13+
1314package io .kubernetes .client .openapi ;
1415
1516import okhttp3 .*;
6061 */
6162public class ApiClient {
6263
63- private String basePath = "http://localhost" ;
64+ protected String basePath = "http://localhost" ;
6465 protected List <ServerConfiguration > servers = new ArrayList <ServerConfiguration >(Arrays .asList (
6566 new ServerConfiguration (
6667 "" ,
@@ -70,26 +71,26 @@ public class ApiClient {
7071 ));
7172 protected Integer serverIndex = 0 ;
7273 protected Map <String , String > serverVariables = null ;
73- private boolean debugging = false ;
74- private Map <String , String > defaultHeaderMap = new HashMap <String , String >();
75- private Map <String , String > defaultCookieMap = new HashMap <String , String >();
76- private String tempFolderPath = null ;
74+ protected boolean debugging = false ;
75+ protected Map <String , String > defaultHeaderMap = new HashMap <String , String >();
76+ protected Map <String , String > defaultCookieMap = new HashMap <String , String >();
77+ protected String tempFolderPath = null ;
7778
78- private Map <String , Authentication > authentications ;
79+ protected Map <String , Authentication > authentications ;
7980
80- private DateFormat dateFormat ;
81- private DateFormat datetimeFormat ;
82- private boolean lenientDatetimeFormat ;
83- private int dateLength ;
81+ protected DateFormat dateFormat ;
82+ protected DateFormat datetimeFormat ;
83+ protected boolean lenientDatetimeFormat ;
84+ protected int dateLength ;
8485
85- private InputStream sslCaCert ;
86- private boolean verifyingSsl ;
87- private KeyManager [] keyManagers ;
86+ protected InputStream sslCaCert ;
87+ protected boolean verifyingSsl ;
88+ protected KeyManager [] keyManagers ;
8889
89- private OkHttpClient httpClient ;
90- private JSON json ;
90+ protected OkHttpClient httpClient ;
91+ protected JSON json ;
9192
92- private HttpLoggingInterceptor loggingInterceptor ;
93+ protected HttpLoggingInterceptor loggingInterceptor ;
9394
9495 /**
9596 * Basic constructor for ApiClient
@@ -120,11 +121,11 @@ public ApiClient(OkHttpClient client) {
120121 authentications = Collections .unmodifiableMap (authentications );
121122 }
122123
123- private void initHttpClient () {
124+ protected void initHttpClient () {
124125 initHttpClient (Collections .<Interceptor >emptyList ());
125126 }
126127
127- private void initHttpClient (List <Interceptor > interceptors ) {
128+ protected void initHttpClient (List <Interceptor > interceptors ) {
128129 OkHttpClient .Builder builder = new OkHttpClient .Builder ();
129130 builder .addNetworkInterceptor (getProgressInterceptor ());
130131 for (Interceptor interceptor : interceptors ) {
@@ -134,7 +135,7 @@ private void initHttpClient(List<Interceptor> interceptors) {
134135 httpClient = builder .build ();
135136 }
136137
137- private void init () {
138+ protected void init () {
138139 verifyingSsl = true ;
139140
140141 json = new JSON ();
@@ -157,8 +158,8 @@ public String getBasePath() {
157158 /**
158159 * Set base path
159160 *
160- * @param basePath Base path of the URL (e.g http://localhost
161- * @return An instance of OkHttpClient
161+ * @param basePath Base path of the URL (e.g http://localhost)
162+ * @return An instance of ApiClient
162163 */
163164 public ApiClient setBasePath (String basePath ) {
164165 this .basePath = basePath ;
@@ -206,7 +207,7 @@ public OkHttpClient getHttpClient() {
206207 * Set HTTP client, which must never be null.
207208 *
208209 * @param newHttpClient An instance of OkHttpClient
209- * @return Api Client
210+ * @return ApiClient
210211 * @throws java.lang.NullPointerException when newHttpClient is null
211212 */
212213 public ApiClient setHttpClient (OkHttpClient newHttpClient ) {
@@ -694,7 +695,7 @@ public List<Pair> parameterToPair(String name, Object value) {
694695 * @param value The value of the parameter.
695696 * @return A list of {@code Pair} objects.
696697 */
697- public List <Pair > parameterToPairs (String collectionFormat , String name , Collection value ) {
698+ public List <Pair > parameterToPairs (String collectionFormat , String name , Collection <?> value ) {
698699 List <Pair > params = new ArrayList <Pair >();
699700
700701 // preconditions
@@ -801,7 +802,7 @@ public String collectionPathParameterToString(String collectionFormat, Collectio
801802 * @return The sanitized filename
802803 */
803804 public String sanitizeFilename (String filename ) {
804- return filename .replaceAll ( " .*[/\\ \\ ]" , "" );
805+ return filename .replaceFirst ( "^ .*[/\\ \\ ]" , "" );
805806 }
806807
807808 /**
@@ -1266,7 +1267,8 @@ public String buildUrl(String baseUrl, String path, List<Pair> queryParams, List
12661267 if (serverIndex != null ) {
12671268 if (serverIndex < 0 || serverIndex >= servers .size ()) {
12681269 throw new ArrayIndexOutOfBoundsException (String .format (
1269- "Invalid index %d when selecting the host settings. Must be less than %d" , serverIndex , servers .size ()
1270+ Locale .ROOT ,
1271+ "Invalid index %d when selecting the host settings. Must be less than %d" , serverIndex , servers .size ()
12701272 ));
12711273 }
12721274 baseURL = servers .get (serverIndex ).URL (serverVariables );
@@ -1338,11 +1340,11 @@ public void processHeaderParams(Map<String, String> headerParams, Request.Builde
13381340 */
13391341 public void processCookieParams (Map <String , String > cookieParams , Request .Builder reqBuilder ) {
13401342 for (Entry <String , String > param : cookieParams .entrySet ()) {
1341- reqBuilder .addHeader ("Cookie" , String .format ("%s=%s" , param .getKey (), param .getValue ()));
1343+ reqBuilder .addHeader ("Cookie" , String .format (Locale . ROOT , "%s=%s" , param .getKey (), param .getValue ()));
13421344 }
13431345 for (Entry <String , String > param : defaultCookieMap .entrySet ()) {
13441346 if (!cookieParams .containsKey (param .getKey ())) {
1345- reqBuilder .addHeader ("Cookie" , String .format ("%s=%s" , param .getKey (), param .getValue ()));
1347+ reqBuilder .addHeader ("Cookie" , String .format (Locale . ROOT , "%s=%s" , param .getKey (), param .getValue ()));
13461348 }
13471349 }
13481350 }
@@ -1431,11 +1433,11 @@ public String guessContentTypeFromFile(File file) {
14311433 /**
14321434 * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder.
14331435 *
1434- * @param mpBuilder MultipartBody.Builder
1436+ * @param mpBuilder MultipartBody.Builder
14351437 * @param key The key of the Header element
14361438 * @param file The file to add to the Header
1437- */
1438- private void addPartToMultiPartBuilder (MultipartBody .Builder mpBuilder , String key , File file ) {
1439+ */
1440+ protected void addPartToMultiPartBuilder (MultipartBody .Builder mpBuilder , String key , File file ) {
14391441 Headers partHeaders = Headers .of ("Content-Disposition" , "form-data; name=\" " + key + "\" ; filename=\" " + file .getName () + "\" " );
14401442 MediaType mediaType = MediaType .parse (guessContentTypeFromFile (file ));
14411443 mpBuilder .addPart (partHeaders , RequestBody .create (file , mediaType ));
@@ -1448,7 +1450,7 @@ private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String k
14481450 * @param key The key of the Header element
14491451 * @param obj The complex object to add to the Header
14501452 */
1451- private void addPartToMultiPartBuilder (MultipartBody .Builder mpBuilder , String key , Object obj ) {
1453+ protected void addPartToMultiPartBuilder (MultipartBody .Builder mpBuilder , String key , Object obj ) {
14521454 RequestBody requestBody ;
14531455 if (obj instanceof String ) {
14541456 requestBody = RequestBody .create ((String ) obj , MediaType .parse ("text/plain" ));
@@ -1470,7 +1472,7 @@ private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String k
14701472 * Get network interceptor to add it to the httpClient to track download progress for
14711473 * async requests.
14721474 */
1473- private Interceptor getProgressInterceptor () {
1475+ protected Interceptor getProgressInterceptor () {
14741476 return new Interceptor () {
14751477 @ Override
14761478 public Response intercept (Interceptor .Chain chain ) throws IOException {
@@ -1491,7 +1493,7 @@ public Response intercept(Interceptor.Chain chain) throws IOException {
14911493 * Apply SSL related settings to httpClient according to the current values of
14921494 * verifyingSsl and sslCaCert.
14931495 */
1494- private void applySslSettings () {
1496+ protected void applySslSettings () {
14951497 try {
14961498 TrustManager [] trustManagers ;
14971499 HostnameVerifier hostnameVerifier ;
@@ -1553,7 +1555,7 @@ public boolean verify(String hostname, SSLSession session) {
15531555 }
15541556 }
15551557
1556- private KeyStore newEmptyKeyStore (char [] password ) throws GeneralSecurityException {
1558+ protected KeyStore newEmptyKeyStore (char [] password ) throws GeneralSecurityException {
15571559 try {
15581560 KeyStore keyStore = KeyStore .getInstance (KeyStore .getDefaultType ());
15591561 keyStore .load (null , password );
@@ -1570,7 +1572,7 @@ private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityExcepti
15701572 * @return The string representation of the HTTP request body
15711573 * @throws io.kubernetes.client.openapi.ApiException If fail to serialize the request body object into a string
15721574 */
1573- private String requestBodyToString (RequestBody requestBody ) throws ApiException {
1575+ protected String requestBodyToString (RequestBody requestBody ) throws ApiException {
15741576 if (requestBody != null ) {
15751577 try {
15761578 final Buffer buffer = new Buffer ();
0 commit comments