io.kubernetes.client.openapi.apis.WellKnownApi Maven / Gradle / Ivy
The newest version!
/*
Copyright 2024 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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package io.kubernetes.client.openapi.apis;
import io.kubernetes.client.openapi.ApiCallback;
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.openapi.ApiException;
import io.kubernetes.client.openapi.ApiResponse;
import io.kubernetes.client.openapi.Configuration;
import io.kubernetes.client.openapi.Pair;
import io.kubernetes.client.openapi.ProgressRequestBody;
import io.kubernetes.client.openapi.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class WellKnownApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public WellKnownApi() {
this(Configuration.getDefaultApiClient());
}
public WellKnownApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
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;
}
private okhttp3.Call getServiceAccountIssuerOpenIDConfigurationCall(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
String localVarPath = "/.well-known/openid-configuration";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "BearerToken" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getServiceAccountIssuerOpenIDConfigurationValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getServiceAccountIssuerOpenIDConfigurationCall(_callback);
}
private ApiResponse getServiceAccountIssuerOpenIDConfigurationWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getServiceAccountIssuerOpenIDConfigurationValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getServiceAccountIssuerOpenIDConfigurationAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getServiceAccountIssuerOpenIDConfigurationValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIgetServiceAccountIssuerOpenIDConfigurationRequest {
private APIgetServiceAccountIssuerOpenIDConfigurationRequest() {
}
/**
* Build call for getServiceAccountIssuerOpenIDConfiguration
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getServiceAccountIssuerOpenIDConfigurationCall(_callback);
}
/**
* Execute getServiceAccountIssuerOpenIDConfiguration request
* @return String
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
*/
public String execute() throws ApiException {
ApiResponse localVarResp = getServiceAccountIssuerOpenIDConfigurationWithHttpInfo();
return localVarResp.getData();
}
/**
* Execute getServiceAccountIssuerOpenIDConfiguration request with HTTP info returned
* @return ApiResponse<String>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return getServiceAccountIssuerOpenIDConfigurationWithHttpInfo();
}
/**
* Execute getServiceAccountIssuerOpenIDConfiguration request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getServiceAccountIssuerOpenIDConfigurationAsync(_callback);
}
}
/**
*
* get service account issuer OpenID configuration, also known as the 'OIDC discovery doc'
* @return APIgetServiceAccountIssuerOpenIDConfigurationRequest
* @http.response.details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
*/
public APIgetServiceAccountIssuerOpenIDConfigurationRequest getServiceAccountIssuerOpenIDConfiguration() {
return new APIgetServiceAccountIssuerOpenIDConfigurationRequest();
}
}