Search in sources :

Example 26 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class AuthorizationV1Api method createNamespacedLocalSubjectAccessReviewCall.

/**
 * Build call for createNamespacedLocalSubjectAccessReview
 * @param namespace object name and auth scope, such as for teams and projects (required)
 * @param body  (required)
 * @param pretty If 'true', then the output is pretty printed. (optional)
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call createNamespacedLocalSubjectAccessReviewCall(String namespace, V1LocalSubjectAccessReview body, String pretty, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = body;
    // create path and map variables
    String localVarPath = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews".replaceAll("\\{" + "namespace" + "\\}", apiClient.escapeString(namespace.toString()));
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("pretty", pretty));
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "*/*" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Example 27 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class AuthorizationV1Api method createSelfSubjectAccessReviewCall.

/**
 * Build call for createSelfSubjectAccessReview
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call createSelfSubjectAccessReviewCall(V1SelfSubjectAccessReview body, String pretty, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = body;
    // create path and map variables
    String localVarPath = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews";
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("pretty", pretty));
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "*/*" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Example 28 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class AuthenticationV1Api method createTokenReviewCall.

/**
 * Build call for createTokenReview
 * @param body  (required)
 * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional)
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call createTokenReviewCall(V1TokenReview body, String pretty, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = body;
    // create path and map variables
    String localVarPath = "/apis/authentication.k8s.io/v1/tokenreviews";
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    if (pretty != null)
        localVarQueryParams.addAll(apiClient.parameterToPair("pretty", pretty));
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "*/*" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Example 29 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class AuthenticationV1Api method getAPIResourcesCall.

/**
 * Build call for getAPIResources
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call getAPIResourcesCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/apis/authentication.k8s.io/v1/";
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Example 30 with ProgressResponseBody

use of io.kubernetes.client.ProgressResponseBody in project java by kubernetes-client.

the class AuthenticationV1beta1Api method getAPIResourcesCall.

/**
 * Build call for getAPIResources
 * @param progressListener Progress listener
 * @param progressRequestListener Progress request listener
 * @return Call to execute
 * @throws ApiException If fail to serialize the request body object
 */
public com.squareup.okhttp.Call getAPIResourcesCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
    Object localVarPostBody = null;
    // create path and map variables
    String localVarPath = "/apis/authentication.k8s.io/v1beta1/";
    List<Pair> localVarQueryParams = new ArrayList<Pair>();
    List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
    Map<String, String> localVarHeaderParams = new HashMap<String, String>();
    Map<String, Object> localVarFormParams = new HashMap<String, Object>();
    final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
    if (localVarAccept != null)
        localVarHeaderParams.put("Accept", localVarAccept);
    final String[] localVarContentTypes = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
    localVarHeaderParams.put("Content-Type", localVarContentType);
    if (progressListener != null) {
        apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {

            @Override
            public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
                com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
                return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();
            }
        });
    }
    String[] localVarAuthNames = new String[] { "BearerToken" };
    return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IOException(java.io.IOException) ProgressResponseBody(io.kubernetes.client.ProgressResponseBody) ApiResponse(io.kubernetes.client.ApiResponse) Pair(io.kubernetes.client.Pair)

Aggregations

ApiResponse (io.kubernetes.client.ApiResponse)707 Pair (io.kubernetes.client.Pair)707 ProgressResponseBody (io.kubernetes.client.ProgressResponseBody)707 IOException (java.io.IOException)707 ArrayList (java.util.ArrayList)707 HashMap (java.util.HashMap)707