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