001/*
002 * VM-Operator
003 * Copyright (C) 2024 Michael N. Lipp
004 * 
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
017 */
018
019package org.jdrupes.vmoperator.common;
020
021import io.kubernetes.client.openapi.ApiCallback;
022import io.kubernetes.client.openapi.ApiClient;
023import io.kubernetes.client.openapi.ApiException;
024import io.kubernetes.client.openapi.ApiResponse;
025import io.kubernetes.client.openapi.JSON;
026import io.kubernetes.client.openapi.Pair;
027import io.kubernetes.client.openapi.auth.Authentication;
028import io.kubernetes.client.util.ClientBuilder;
029import io.kubernetes.client.util.generic.options.PatchOptions;
030import java.io.File;
031import java.io.IOException;
032import java.io.InputStream;
033import java.lang.reflect.Type;
034import java.text.DateFormat;
035import java.time.format.DateTimeFormatter;
036import java.util.Collection;
037import java.util.List;
038import java.util.Map;
039import javax.net.ssl.KeyManager;
040import okhttp3.Call;
041import okhttp3.OkHttpClient;
042import okhttp3.Request;
043import okhttp3.Request.Builder;
044import okhttp3.RequestBody;
045import okhttp3.Response;
046
047/**
048 * A client with some additional properties.
049 */
050@SuppressWarnings({ "PMD.ExcessivePublicCount", "PMD.TooManyMethods",
051    "PMD.LinguisticNaming", "checkstyle:LineLength",
052    "PMD.CouplingBetweenObjects", "PMD.GodClass" })
053public class K8sClient extends ApiClient {
054
055    private ApiClient apiClient;
056    private PatchOptions defaultPatchOptions;
057
058    /**
059     * Instantiates a new client.
060     *
061     * @throws IOException Signals that an I/O exception has occurred.
062     */
063    public K8sClient() throws IOException {
064        defaultPatchOptions = new PatchOptions();
065        defaultPatchOptions.setFieldManager("kubernetes-java-kubectl-apply");
066    }
067
068    private ApiClient apiClient() {
069        if (apiClient == null) {
070            try {
071                apiClient = ClientBuilder.standard().build();
072            } catch (IOException e) {
073                throw new IllegalStateException(e);
074            }
075        }
076        return apiClient;
077    }
078
079    /**
080     * Gets the default patch options.
081     *
082     * @return the defaultPatchOptions
083     */
084    public PatchOptions defaultPatchOptions() {
085        return defaultPatchOptions;
086    }
087
088    /**
089     * Changes the default patch options.
090     *
091     * @param patchOptions the patch options
092     * @return the client
093     */
094    public K8sClient with(PatchOptions patchOptions) {
095        defaultPatchOptions = patchOptions;
096        return this;
097    }
098
099    /**
100     * Gets the base path.
101     *
102     * @return the base path
103     * @see ApiClient#getBasePath()
104     */
105    @Override
106    public String getBasePath() {
107        return apiClient().getBasePath();
108    }
109
110    /**
111     * Sets the base path.
112     *
113     * @param basePath the base path
114     * @return the api client
115     * @see ApiClient#setBasePath(java.lang.String)
116     */
117    @Override
118    public ApiClient setBasePath(String basePath) {
119        return apiClient().setBasePath(basePath);
120    }
121
122    /**
123     * Gets the http client.
124     *
125     * @return the http client
126     * @see ApiClient#getHttpClient()
127     */
128    @Override
129    public OkHttpClient getHttpClient() {
130        return apiClient().getHttpClient();
131    }
132
133    /**
134     * Sets the http client.
135     *
136     * @param newHttpClient the new http client
137     * @return the api client
138     * @see ApiClient#setHttpClient(okhttp3.OkHttpClient)
139     */
140    @Override
141    public ApiClient setHttpClient(OkHttpClient newHttpClient) {
142        return apiClient().setHttpClient(newHttpClient);
143    }
144
145    /**
146     * Gets the json.
147     *
148     * @return the json
149     * @see ApiClient#getJSON()
150     */
151    @SuppressWarnings("abbreviationAsWordInName")
152    @Override
153    public JSON getJSON() {
154        return apiClient().getJSON();
155    }
156
157    /**
158     * Sets the JSON.
159     *
160     * @param json the json
161     * @return the api client
162     * @see ApiClient#setJSON(io.kubernetes.client.openapi.JSON)
163     */
164    @SuppressWarnings("abbreviationAsWordInName")
165    @Override
166    public ApiClient setJSON(JSON json) {
167        return apiClient().setJSON(json);
168    }
169
170    /**
171     * Checks if is verifying ssl.
172     *
173     * @return true, if is verifying ssl
174     * @see ApiClient#isVerifyingSsl()
175     */
176    @Override
177    public boolean isVerifyingSsl() {
178        return apiClient().isVerifyingSsl();
179    }
180
181    /**
182     * Sets the verifying ssl.
183     *
184     * @param verifyingSsl the verifying ssl
185     * @return the api client
186     * @see ApiClient#setVerifyingSsl(boolean)
187     */
188    @Override
189    public ApiClient setVerifyingSsl(boolean verifyingSsl) {
190        return apiClient().setVerifyingSsl(verifyingSsl);
191    }
192
193    /**
194     * Gets the ssl ca cert.
195     *
196     * @return the ssl ca cert
197     * @see ApiClient#getSslCaCert()
198     */
199    @Override
200    public InputStream getSslCaCert() {
201        return apiClient().getSslCaCert();
202    }
203
204    /**
205     * Sets the ssl ca cert.
206     *
207     * @param sslCaCert the ssl ca cert
208     * @return the api client
209     * @see ApiClient#setSslCaCert(java.io.InputStream)
210     */
211    @Override
212    public ApiClient setSslCaCert(InputStream sslCaCert) {
213        return apiClient().setSslCaCert(sslCaCert);
214    }
215
216    /**
217     * Gets the key managers.
218     *
219     * @return the key managers
220     * @see ApiClient#getKeyManagers()
221     */
222    @Override
223    public KeyManager[] getKeyManagers() {
224        return apiClient().getKeyManagers();
225    }
226
227    /**
228     * Sets the key managers.
229     *
230     * @param managers the managers
231     * @return the api client
232     * @see ApiClient#setKeyManagers(javax.net.ssl.KeyManager[])
233     */
234    @SuppressWarnings("PMD.UseVarargs")
235    @Override
236    public ApiClient setKeyManagers(KeyManager[] managers) {
237        return apiClient().setKeyManagers(managers);
238    }
239
240    /**
241     * Gets the date format.
242     *
243     * @return the date format
244     * @see ApiClient#getDateFormat()
245     */
246    @Override
247    public DateFormat getDateFormat() {
248        return apiClient().getDateFormat();
249    }
250
251    /**
252     * Sets the date format.
253     *
254     * @param dateFormat the date format
255     * @return the api client
256     * @see ApiClient#setDateFormat(java.text.DateFormat)
257     */
258    @Override
259    public ApiClient setDateFormat(DateFormat dateFormat) {
260        return apiClient().setDateFormat(dateFormat);
261    }
262
263    /**
264     * Sets the sql date format.
265     *
266     * @param dateFormat the date format
267     * @return the api client
268     * @see ApiClient#setSqlDateFormat(java.text.DateFormat)
269     */
270    @Override
271    public ApiClient setSqlDateFormat(DateFormat dateFormat) {
272        return apiClient().setSqlDateFormat(dateFormat);
273    }
274
275    /**
276     * Sets the offset date time format.
277     *
278     * @param dateFormat the date format
279     * @return the api client
280     * @see ApiClient#setOffsetDateTimeFormat(java.time.format.DateTimeFormatter)
281     */
282    @Override
283    public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
284        return apiClient().setOffsetDateTimeFormat(dateFormat);
285    }
286
287    /**
288     * Sets the local date format.
289     *
290     * @param dateFormat the date format
291     * @return the api client
292     * @see ApiClient#setLocalDateFormat(java.time.format.DateTimeFormatter)
293     */
294    @Override
295    public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
296        return apiClient().setLocalDateFormat(dateFormat);
297    }
298
299    /**
300     * Sets the lenient on json.
301     *
302     * @param lenientOnJson the lenient on json
303     * @return the api client
304     * @see ApiClient#setLenientOnJson(boolean)
305     */
306    @Override
307    public ApiClient setLenientOnJson(boolean lenientOnJson) {
308        return apiClient().setLenientOnJson(lenientOnJson);
309    }
310
311    /**
312     * Gets the authentications.
313     *
314     * @return the authentications
315     * @see ApiClient#getAuthentications()
316     */
317    @Override
318    public Map<String, Authentication> getAuthentications() {
319        return apiClient().getAuthentications();
320    }
321
322    /**
323     * Gets the authentication.
324     *
325     * @param authName the auth name
326     * @return the authentication
327     * @see ApiClient#getAuthentication(java.lang.String)
328     */
329    @Override
330    public Authentication getAuthentication(String authName) {
331        return apiClient().getAuthentication(authName);
332    }
333
334    /**
335     * Sets the username.
336     *
337     * @param username the new username
338     * @see ApiClient#setUsername(java.lang.String)
339     */
340    @Override
341    public void setUsername(String username) {
342        apiClient().setUsername(username);
343    }
344
345    /**
346     * Sets the password.
347     *
348     * @param password the new password
349     * @see ApiClient#setPassword(java.lang.String)
350     */
351    @Override
352    public void setPassword(String password) {
353        apiClient().setPassword(password);
354    }
355
356    /**
357     * Sets the api key.
358     *
359     * @param apiKey the new api key
360     * @see ApiClient#setApiKey(java.lang.String)
361     */
362    @Override
363    public void setApiKey(String apiKey) {
364        apiClient().setApiKey(apiKey);
365    }
366
367    /**
368     * Sets the api key prefix.
369     *
370     * @param apiKeyPrefix the new api key prefix
371     * @see ApiClient#setApiKeyPrefix(java.lang.String)
372     */
373    @Override
374    public void setApiKeyPrefix(String apiKeyPrefix) {
375        apiClient().setApiKeyPrefix(apiKeyPrefix);
376    }
377
378    /**
379     * Sets the access token.
380     *
381     * @param accessToken the new access token
382     * @see ApiClient#setAccessToken(java.lang.String)
383     */
384    @Override
385    public void setAccessToken(String accessToken) {
386        apiClient().setAccessToken(accessToken);
387    }
388
389    /**
390     * Sets the user agent.
391     *
392     * @param userAgent the user agent
393     * @return the api client
394     * @see ApiClient#setUserAgent(java.lang.String)
395     */
396    @Override
397    public ApiClient setUserAgent(String userAgent) {
398        return apiClient().setUserAgent(userAgent);
399    }
400
401    /**
402     * To string.
403     *
404     * @return the string
405     * @see java.lang.Object#toString()
406     */
407    @Override
408    public String toString() {
409        return apiClient().toString();
410    }
411
412    /**
413     * Adds the default header.
414     *
415     * @param key the key
416     * @param value the value
417     * @return the api client
418     * @see ApiClient#addDefaultHeader(java.lang.String, java.lang.String)
419     */
420    @Override
421    public ApiClient addDefaultHeader(String key, String value) {
422        return apiClient().addDefaultHeader(key, value);
423    }
424
425    /**
426     * Adds the default cookie.
427     *
428     * @param key the key
429     * @param value the value
430     * @return the api client
431     * @see ApiClient#addDefaultCookie(java.lang.String, java.lang.String)
432     */
433    @Override
434    public ApiClient addDefaultCookie(String key, String value) {
435        return apiClient().addDefaultCookie(key, value);
436    }
437
438    /**
439     * Checks if is debugging.
440     *
441     * @return true, if is debugging
442     * @see ApiClient#isDebugging()
443     */
444    @Override
445    public boolean isDebugging() {
446        return apiClient().isDebugging();
447    }
448
449    /**
450     * Sets the debugging.
451     *
452     * @param debugging the debugging
453     * @return the api client
454     * @see ApiClient#setDebugging(boolean)
455     */
456    @Override
457    public ApiClient setDebugging(boolean debugging) {
458        return apiClient().setDebugging(debugging);
459    }
460
461    /**
462     * Gets the temp folder path.
463     *
464     * @return the temp folder path
465     * @see ApiClient#getTempFolderPath()
466     */
467    @Override
468    public String getTempFolderPath() {
469        return apiClient().getTempFolderPath();
470    }
471
472    /**
473     * Sets the temp folder path.
474     *
475     * @param tempFolderPath the temp folder path
476     * @return the api client
477     * @see ApiClient#setTempFolderPath(java.lang.String)
478     */
479    @Override
480    public ApiClient setTempFolderPath(String tempFolderPath) {
481        return apiClient().setTempFolderPath(tempFolderPath);
482    }
483
484    /**
485     * Gets the connect timeout.
486     *
487     * @return the connect timeout
488     * @see ApiClient#getConnectTimeout()
489     */
490    @Override
491    public int getConnectTimeout() {
492        return apiClient().getConnectTimeout();
493    }
494
495    /**
496     * Sets the connect timeout.
497     *
498     * @param connectionTimeout the connection timeout
499     * @return the api client
500     * @see ApiClient#setConnectTimeout(int)
501     */
502    @Override
503    public ApiClient setConnectTimeout(int connectionTimeout) {
504        return apiClient().setConnectTimeout(connectionTimeout);
505    }
506
507    /**
508     * Gets the read timeout.
509     *
510     * @return the read timeout
511     * @see ApiClient#getReadTimeout()
512     */
513    @Override
514    public int getReadTimeout() {
515        return apiClient().getReadTimeout();
516    }
517
518    /**
519     * Sets the read timeout.
520     *
521     * @param readTimeout the read timeout
522     * @return the api client
523     * @see ApiClient#setReadTimeout(int)
524     */
525    @Override
526    public ApiClient setReadTimeout(int readTimeout) {
527        return apiClient().setReadTimeout(readTimeout);
528    }
529
530    /**
531     * Gets the write timeout.
532     *
533     * @return the write timeout
534     * @see ApiClient#getWriteTimeout()
535     */
536    @Override
537    public int getWriteTimeout() {
538        return apiClient().getWriteTimeout();
539    }
540
541    /**
542     * Sets the write timeout.
543     *
544     * @param writeTimeout the write timeout
545     * @return the api client
546     * @see ApiClient#setWriteTimeout(int)
547     */
548    @Override
549    public ApiClient setWriteTimeout(int writeTimeout) {
550        return apiClient().setWriteTimeout(writeTimeout);
551    }
552
553    /**
554     * Parameter to string.
555     *
556     * @param param the param
557     * @return the string
558     * @see ApiClient#parameterToString(java.lang.Object)
559     */
560    @Override
561    public String parameterToString(Object param) {
562        return apiClient().parameterToString(param);
563    }
564
565    /**
566     * Parameter to pair.
567     *
568     * @param name the name
569     * @param value the value
570     * @return the list
571     * @see ApiClient#parameterToPair(java.lang.String, java.lang.Object)
572     */
573    @Override
574    public List<Pair> parameterToPair(String name, Object value) {
575        return apiClient().parameterToPair(name, value);
576    }
577
578    /**
579     * Parameter to pairs.
580     *
581     * @param collectionFormat the collection format
582     * @param name the name
583     * @param value the value
584     * @return the list
585     * @see ApiClient#parameterToPairs(java.lang.String, java.lang.String, java.util.Collection)
586     */
587    @SuppressWarnings({ "rawtypes", "PMD.AvoidDuplicateLiterals" })
588    @Override
589    public List<Pair> parameterToPairs(String collectionFormat, String name,
590            Collection value) {
591        return apiClient().parameterToPairs(collectionFormat, name, value);
592    }
593
594    /**
595     * Collection path parameter to string.
596     *
597     * @param collectionFormat the collection format
598     * @param value the value
599     * @return the string
600     * @see ApiClient#collectionPathParameterToString(java.lang.String, java.util.Collection)
601     */
602    @SuppressWarnings("rawtypes")
603    @Override
604    public String collectionPathParameterToString(String collectionFormat,
605            Collection value) {
606        return apiClient().collectionPathParameterToString(collectionFormat,
607            value);
608    }
609
610    /**
611     * Sanitize filename.
612     *
613     * @param filename the filename
614     * @return the string
615     * @see ApiClient#sanitizeFilename(java.lang.String)
616     */
617    @Override
618    public String sanitizeFilename(String filename) {
619        return apiClient().sanitizeFilename(filename);
620    }
621
622    /**
623     * Checks if is json mime.
624     *
625     * @param mime the mime
626     * @return true, if is json mime
627     * @see ApiClient#isJsonMime(java.lang.String)
628     */
629    @Override
630    public boolean isJsonMime(String mime) {
631        return apiClient().isJsonMime(mime);
632    }
633
634    /**
635     * Select header accept.
636     *
637     * @param accepts the accepts
638     * @return the string
639     * @see ApiClient#selectHeaderAccept(java.lang.String[])
640     */
641    @SuppressWarnings("PMD.UseVarargs")
642    @Override
643    public String selectHeaderAccept(String[] accepts) {
644        return apiClient().selectHeaderAccept(accepts);
645    }
646
647    /**
648     * Select header content type.
649     *
650     * @param contentTypes the content types
651     * @return the string
652     * @see ApiClient#selectHeaderContentType(java.lang.String[])
653     */
654    @SuppressWarnings("PMD.UseVarargs")
655    @Override
656    public String selectHeaderContentType(String[] contentTypes) {
657        return apiClient().selectHeaderContentType(contentTypes);
658    }
659
660    /**
661     * Escape string.
662     *
663     * @param str the str
664     * @return the string
665     * @see ApiClient#escapeString(java.lang.String)
666     */
667    @Override
668    public String escapeString(String str) {
669        return apiClient().escapeString(str);
670    }
671
672    /**
673     * Deserialize.
674     *
675     * @param <T> the generic type
676     * @param response the response
677     * @param returnType the return type
678     * @return the t
679     * @throws ApiException the api exception
680     * @see ApiClient#deserialize(okhttp3.Response, java.lang.reflect.Type)
681     */
682    @Override
683    public <T> T deserialize(Response response, Type returnType)
684            throws ApiException {
685        return apiClient().deserialize(response, returnType);
686    }
687
688    /**
689     * Serialize.
690     *
691     * @param obj the obj
692     * @param contentType the content type
693     * @return the request body
694     * @throws ApiException the api exception
695     * @see ApiClient#serialize(java.lang.Object, java.lang.String)
696     */
697    @Override
698    public RequestBody serialize(Object obj, String contentType)
699            throws ApiException {
700        return apiClient().serialize(obj, contentType);
701    }
702
703    /**
704     * Download file from response.
705     *
706     * @param response the response
707     * @return the file
708     * @throws ApiException the api exception
709     * @see ApiClient#downloadFileFromResponse(okhttp3.Response)
710     */
711    @Override
712    public File downloadFileFromResponse(Response response)
713            throws ApiException {
714        return apiClient().downloadFileFromResponse(response);
715    }
716
717    /**
718     * Prepare download file.
719     *
720     * @param response the response
721     * @return the file
722     * @throws IOException Signals that an I/O exception has occurred.
723     * @see ApiClient#prepareDownloadFile(okhttp3.Response)
724     */
725    @Override
726    public File prepareDownloadFile(Response response) throws IOException {
727        return apiClient().prepareDownloadFile(response);
728    }
729
730    /**
731     * Execute.
732     *
733     * @param <T> the generic type
734     * @param call the call
735     * @return the api response
736     * @throws ApiException the api exception
737     * @see ApiClient#execute(okhttp3.Call)
738     */
739    @Override
740    public <T> ApiResponse<T> execute(Call call) throws ApiException {
741        return apiClient().execute(call);
742    }
743
744    /**
745     * Execute.
746     *
747     * @param <T> the generic type
748     * @param call the call
749     * @param returnType the return type
750     * @return the api response
751     * @throws ApiException the api exception
752     * @see ApiClient#execute(okhttp3.Call, java.lang.reflect.Type)
753     */
754    @Override
755    public <T> ApiResponse<T> execute(Call call, Type returnType)
756            throws ApiException {
757        return apiClient().execute(call, returnType);
758    }
759
760    /**
761     * Execute async.
762     *
763     * @param <T> the generic type
764     * @param call the call
765     * @param callback the callback
766     * @see ApiClient#executeAsync(okhttp3.Call, io.kubernetes.client.openapi.ApiCallback)
767     */
768    @Override
769    public <T> void executeAsync(Call call, ApiCallback<T> callback) {
770        apiClient().executeAsync(call, callback);
771    }
772
773    /**
774     * Execute async.
775     *
776     * @param <T> the generic type
777     * @param call the call
778     * @param returnType the return type
779     * @param callback the callback
780     * @see ApiClient#executeAsync(okhttp3.Call, java.lang.reflect.Type, io.kubernetes.client.openapi.ApiCallback)
781     */
782    @Override
783    public <T> void executeAsync(Call call, Type returnType,
784            ApiCallback<T> callback) {
785        apiClient().executeAsync(call, returnType, callback);
786    }
787
788    /**
789     * Handle response.
790     *
791     * @param <T> the generic type
792     * @param response the response
793     * @param returnType the return type
794     * @return the t
795     * @throws ApiException the api exception
796     * @see ApiClient#handleResponse(okhttp3.Response, java.lang.reflect.Type)
797     */
798    @Override
799    public <T> T handleResponse(Response response, Type returnType)
800            throws ApiException {
801        return apiClient().handleResponse(response, returnType);
802    }
803
804    /**
805     * Builds the call.
806     *
807     * @param path the path
808     * @param method the method
809     * @param queryParams the query params
810     * @param collectionQueryParams the collection query params
811     * @param body the body
812     * @param headerParams the header params
813     * @param cookieParams the cookie params
814     * @param formParams the form params
815     * @param authNames the auth names
816     * @param callback the callback
817     * @return the call
818     * @throws ApiException the api exception
819     * @see ApiClient#buildCall(java.lang.String, java.lang.String, java.util.List, java.util.List, java.lang.Object, java.util.Map, java.util.Map, java.util.Map, java.lang.String[], io.kubernetes.client.openapi.ApiCallback)
820     */
821    @SuppressWarnings({ "rawtypes", "PMD.ExcessiveParameterList" })
822    @Override
823    public Call buildCall(String path, String method, List<Pair> queryParams,
824            List<Pair> collectionQueryParams, Object body,
825            Map<String, String> headerParams, Map<String, String> cookieParams,
826            Map<String, Object> formParams, String[] authNames,
827            ApiCallback callback) throws ApiException {
828        return apiClient().buildCall(path, method, queryParams,
829            collectionQueryParams, body, headerParams, cookieParams, formParams,
830            authNames, callback);
831    }
832
833    /**
834     * Builds the request.
835     *
836     * @param path the path
837     * @param method the method
838     * @param queryParams the query params
839     * @param collectionQueryParams the collection query params
840     * @param body the body
841     * @param headerParams the header params
842     * @param cookieParams the cookie params
843     * @param formParams the form params
844     * @param authNames the auth names
845     * @param callback the callback
846     * @return the request
847     * @throws ApiException the api exception
848     * @see ApiClient#buildRequest(java.lang.String, java.lang.String, java.util.List, java.util.List, java.lang.Object, java.util.Map, java.util.Map, java.util.Map, java.lang.String[], io.kubernetes.client.openapi.ApiCallback)
849     */
850    @SuppressWarnings({ "rawtypes", "PMD.ExcessiveParameterList" })
851    @Override
852    public Request buildRequest(String path, String method,
853            List<Pair> queryParams, List<Pair> collectionQueryParams,
854            Object body, Map<String, String> headerParams,
855            Map<String, String> cookieParams, Map<String, Object> formParams,
856            String[] authNames, ApiCallback callback) throws ApiException {
857        return apiClient().buildRequest(path, method, queryParams,
858            collectionQueryParams, body, headerParams, cookieParams, formParams,
859            authNames, callback);
860    }
861
862    /**
863     * Builds the url.
864     *
865     * @param path the path
866     * @param queryParams the query params
867     * @param collectionQueryParams the collection query params
868     * @return the string
869     * @see ApiClient#buildUrl(java.lang.String, java.util.List, java.util.List)
870     */
871    @Override
872    public String buildUrl(String path, List<Pair> queryParams,
873            List<Pair> collectionQueryParams) {
874        return apiClient().buildUrl(path, queryParams, collectionQueryParams);
875    }
876
877    /**
878     * Process header params.
879     *
880     * @param headerParams the header params
881     * @param reqBuilder the req builder
882     * @see ApiClient#processHeaderParams(java.util.Map, okhttp3.Request.Builder)
883     */
884    @Override
885    public void processHeaderParams(Map<String, String> headerParams,
886            Builder reqBuilder) {
887        apiClient().processHeaderParams(headerParams, reqBuilder);
888    }
889
890    /**
891     * Process cookie params.
892     *
893     * @param cookieParams the cookie params
894     * @param reqBuilder the req builder
895     * @see ApiClient#processCookieParams(java.util.Map, okhttp3.Request.Builder)
896     */
897    @Override
898    public void processCookieParams(Map<String, String> cookieParams,
899            Builder reqBuilder) {
900        apiClient().processCookieParams(cookieParams, reqBuilder);
901    }
902
903    /**
904     * Update params for auth.
905     *
906     * @param authNames the auth names
907     * @param queryParams the query params
908     * @param headerParams the header params
909     * @param cookieParams the cookie params
910     * @see ApiClient#updateParamsForAuth(java.lang.String[], java.util.List, java.util.Map, java.util.Map)
911     */
912    @Override
913    public void updateParamsForAuth(String[] authNames, List<Pair> queryParams,
914            Map<String, String> headerParams,
915            Map<String, String> cookieParams) {
916        apiClient().updateParamsForAuth(authNames, queryParams, headerParams,
917            cookieParams);
918    }
919
920    /**
921     * Builds the request body form encoding.
922     *
923     * @param formParams the form params
924     * @return the request body
925     * @see ApiClient#buildRequestBodyFormEncoding(java.util.Map)
926     */
927    @Override
928    public RequestBody
929            buildRequestBodyFormEncoding(Map<String, Object> formParams) {
930        return apiClient().buildRequestBodyFormEncoding(formParams);
931    }
932
933    /**
934     * Builds the request body multipart.
935     *
936     * @param formParams the form params
937     * @return the request body
938     * @see ApiClient#buildRequestBodyMultipart(java.util.Map)
939     */
940    @Override
941    public RequestBody
942            buildRequestBodyMultipart(Map<String, Object> formParams) {
943        return apiClient().buildRequestBodyMultipart(formParams);
944    }
945
946    /**
947     * Guess content type from file.
948     *
949     * @param file the file
950     * @return the string
951     * @see ApiClient#guessContentTypeFromFile(java.io.File)
952     */
953    @Override
954    public String guessContentTypeFromFile(File file) {
955        return apiClient().guessContentTypeFromFile(file);
956    }
957
958}