All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kubernetes.client.openapi.apis.AuthorizationV1Api 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 io.kubernetes.client.openapi.models.V1APIResourceList;
import io.kubernetes.client.openapi.models.V1LocalSubjectAccessReview;
import io.kubernetes.client.openapi.models.V1SelfSubjectAccessReview;
import io.kubernetes.client.openapi.models.V1SelfSubjectRulesReview;
import io.kubernetes.client.openapi.models.V1SubjectAccessReview;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class AuthorizationV1Api {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

    public AuthorizationV1Api() {
        this(Configuration.getDefaultApiClient());
    }

    public AuthorizationV1Api(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 createNamespacedLocalSubjectAccessReviewCall(String namespace, V1LocalSubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, 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 = body;

        // create path and map variables
        String localVarPath = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews"
            .replace("{" + "namespace" + "}", localVarApiClient.escapeString(namespace.toString()));

        List localVarQueryParams = new ArrayList();
        List localVarCollectionQueryParams = new ArrayList();
        Map localVarHeaderParams = new HashMap();
        Map localVarCookieParams = new HashMap();
        Map localVarFormParams = new HashMap();

        if (dryRun != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun));
        }

        if (fieldManager != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager));
        }

        if (fieldValidation != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation));
        }

        if (pretty != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));
        }

        final String[] localVarAccepts = {
            "application/json",
            "application/yaml",
            "application/vnd.kubernetes.protobuf"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] { "BearerToken" };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call createNamespacedLocalSubjectAccessReviewValidateBeforeCall(String namespace, V1LocalSubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'namespace' is set
        if (namespace == null) {
            throw new ApiException("Missing the required parameter 'namespace' when calling createNamespacedLocalSubjectAccessReview(Async)");
        }

        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling createNamespacedLocalSubjectAccessReview(Async)");
        }

        return createNamespacedLocalSubjectAccessReviewCall(namespace, body, dryRun, fieldManager, fieldValidation, pretty, _callback);

    }


    private ApiResponse createNamespacedLocalSubjectAccessReviewWithHttpInfo(String namespace, V1LocalSubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty) throws ApiException {
        okhttp3.Call localVarCall = createNamespacedLocalSubjectAccessReviewValidateBeforeCall(namespace, body, dryRun, fieldManager, fieldValidation, pretty, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call createNamespacedLocalSubjectAccessReviewAsync(String namespace, V1LocalSubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, final ApiCallback _callback) throws ApiException {

        okhttp3.Call localVarCall = createNamespacedLocalSubjectAccessReviewValidateBeforeCall(namespace, body, dryRun, fieldManager, fieldValidation, pretty, _callback);
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class APIcreateNamespacedLocalSubjectAccessReviewRequest {
        private final String namespace;
        private final V1LocalSubjectAccessReview body;
        private String dryRun;
        private String fieldManager;
        private String fieldValidation;
        private String pretty;

        private APIcreateNamespacedLocalSubjectAccessReviewRequest(String namespace, V1LocalSubjectAccessReview body) {
            this.namespace = namespace;
            this.body = body;
        }

        /**
         * Set dryRun
         * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional)
         * @return APIcreateNamespacedLocalSubjectAccessReviewRequest
         */
        public APIcreateNamespacedLocalSubjectAccessReviewRequest dryRun(String dryRun) {
            this.dryRun = dryRun;
            return this;
        }

        /**
         * Set fieldManager
         * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional)
         * @return APIcreateNamespacedLocalSubjectAccessReviewRequest
         */
        public APIcreateNamespacedLocalSubjectAccessReviewRequest fieldManager(String fieldManager) {
            this.fieldManager = fieldManager;
            return this;
        }

        /**
         * Set fieldValidation
         * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional)
         * @return APIcreateNamespacedLocalSubjectAccessReviewRequest
         */
        public APIcreateNamespacedLocalSubjectAccessReviewRequest fieldValidation(String fieldValidation) {
            this.fieldValidation = fieldValidation;
            return this;
        }

        /**
         * Set pretty
         * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional)
         * @return APIcreateNamespacedLocalSubjectAccessReviewRequest
         */
        public APIcreateNamespacedLocalSubjectAccessReviewRequest pretty(String pretty) {
            this.pretty = pretty;
            return this;
        }

        /**
         * Build call for createNamespacedLocalSubjectAccessReview
         * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return createNamespacedLocalSubjectAccessReviewCall(namespace, body, dryRun, fieldManager, fieldValidation, pretty, _callback); } /** * Execute createNamespacedLocalSubjectAccessReview request * @return V1LocalSubjectAccessReview * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public V1LocalSubjectAccessReview execute() throws ApiException { ApiResponse localVarResp = createNamespacedLocalSubjectAccessReviewWithHttpInfo(namespace, body, dryRun, fieldManager, fieldValidation, pretty); return localVarResp.getData(); } /** * Execute createNamespacedLocalSubjectAccessReview request with HTTP info returned * @return ApiResponse<V1LocalSubjectAccessReview> * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return createNamespacedLocalSubjectAccessReviewWithHttpInfo(namespace, body, dryRun, fieldManager, fieldValidation, pretty); } /** * Execute createNamespacedLocalSubjectAccessReview 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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return createNamespacedLocalSubjectAccessReviewAsync(namespace, body, dryRun, fieldManager, fieldValidation, pretty, _callback); } } /** * * create a LocalSubjectAccessReview * @param namespace object name and auth scope, such as for teams and projects (required) * @param body (required) * @return APIcreateNamespacedLocalSubjectAccessReviewRequest * @http.response.details
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public APIcreateNamespacedLocalSubjectAccessReviewRequest createNamespacedLocalSubjectAccessReview(String namespace, V1LocalSubjectAccessReview body) { return new APIcreateNamespacedLocalSubjectAccessReviewRequest(namespace, body); } private okhttp3.Call createSelfSubjectAccessReviewCall(V1SelfSubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, 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 = body; // create path and map variables String localVarPath = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (dryRun != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); } if (fieldManager != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); } if (fieldValidation != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); } if (pretty != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); } final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "BearerToken" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createSelfSubjectAccessReviewValidateBeforeCall(V1SelfSubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, final ApiCallback _callback) throws ApiException { // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createSelfSubjectAccessReview(Async)"); } return createSelfSubjectAccessReviewCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } private ApiResponse createSelfSubjectAccessReviewWithHttpInfo(V1SelfSubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty) throws ApiException { okhttp3.Call localVarCall = createSelfSubjectAccessReviewValidateBeforeCall(body, dryRun, fieldManager, fieldValidation, pretty, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call createSelfSubjectAccessReviewAsync(V1SelfSubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createSelfSubjectAccessReviewValidateBeforeCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIcreateSelfSubjectAccessReviewRequest { private final V1SelfSubjectAccessReview body; private String dryRun; private String fieldManager; private String fieldValidation; private String pretty; private APIcreateSelfSubjectAccessReviewRequest(V1SelfSubjectAccessReview body) { this.body = body; } /** * Set dryRun * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) * @return APIcreateSelfSubjectAccessReviewRequest */ public APIcreateSelfSubjectAccessReviewRequest dryRun(String dryRun) { this.dryRun = dryRun; return this; } /** * Set fieldManager * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) * @return APIcreateSelfSubjectAccessReviewRequest */ public APIcreateSelfSubjectAccessReviewRequest fieldManager(String fieldManager) { this.fieldManager = fieldManager; return this; } /** * Set fieldValidation * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) * @return APIcreateSelfSubjectAccessReviewRequest */ public APIcreateSelfSubjectAccessReviewRequest fieldValidation(String fieldValidation) { this.fieldValidation = fieldValidation; return this; } /** * Set pretty * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) * @return APIcreateSelfSubjectAccessReviewRequest */ public APIcreateSelfSubjectAccessReviewRequest pretty(String pretty) { this.pretty = pretty; return this; } /** * Build call for createSelfSubjectAccessReview * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return createSelfSubjectAccessReviewCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } /** * Execute createSelfSubjectAccessReview request * @return V1SelfSubjectAccessReview * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public V1SelfSubjectAccessReview execute() throws ApiException { ApiResponse localVarResp = createSelfSubjectAccessReviewWithHttpInfo(body, dryRun, fieldManager, fieldValidation, pretty); return localVarResp.getData(); } /** * Execute createSelfSubjectAccessReview request with HTTP info returned * @return ApiResponse<V1SelfSubjectAccessReview> * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return createSelfSubjectAccessReviewWithHttpInfo(body, dryRun, fieldManager, fieldValidation, pretty); } /** * Execute createSelfSubjectAccessReview 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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return createSelfSubjectAccessReviewAsync(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } } /** * * create a SelfSubjectAccessReview * @param body (required) * @return APIcreateSelfSubjectAccessReviewRequest * @http.response.details
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public APIcreateSelfSubjectAccessReviewRequest createSelfSubjectAccessReview(V1SelfSubjectAccessReview body) { return new APIcreateSelfSubjectAccessReviewRequest(body); } private okhttp3.Call createSelfSubjectRulesReviewCall(V1SelfSubjectRulesReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, 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 = body; // create path and map variables String localVarPath = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (dryRun != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); } if (fieldManager != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); } if (fieldValidation != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); } if (pretty != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); } final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "BearerToken" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createSelfSubjectRulesReviewValidateBeforeCall(V1SelfSubjectRulesReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, final ApiCallback _callback) throws ApiException { // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createSelfSubjectRulesReview(Async)"); } return createSelfSubjectRulesReviewCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } private ApiResponse createSelfSubjectRulesReviewWithHttpInfo(V1SelfSubjectRulesReview body, String dryRun, String fieldManager, String fieldValidation, String pretty) throws ApiException { okhttp3.Call localVarCall = createSelfSubjectRulesReviewValidateBeforeCall(body, dryRun, fieldManager, fieldValidation, pretty, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call createSelfSubjectRulesReviewAsync(V1SelfSubjectRulesReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createSelfSubjectRulesReviewValidateBeforeCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIcreateSelfSubjectRulesReviewRequest { private final V1SelfSubjectRulesReview body; private String dryRun; private String fieldManager; private String fieldValidation; private String pretty; private APIcreateSelfSubjectRulesReviewRequest(V1SelfSubjectRulesReview body) { this.body = body; } /** * Set dryRun * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) * @return APIcreateSelfSubjectRulesReviewRequest */ public APIcreateSelfSubjectRulesReviewRequest dryRun(String dryRun) { this.dryRun = dryRun; return this; } /** * Set fieldManager * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) * @return APIcreateSelfSubjectRulesReviewRequest */ public APIcreateSelfSubjectRulesReviewRequest fieldManager(String fieldManager) { this.fieldManager = fieldManager; return this; } /** * Set fieldValidation * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) * @return APIcreateSelfSubjectRulesReviewRequest */ public APIcreateSelfSubjectRulesReviewRequest fieldValidation(String fieldValidation) { this.fieldValidation = fieldValidation; return this; } /** * Set pretty * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) * @return APIcreateSelfSubjectRulesReviewRequest */ public APIcreateSelfSubjectRulesReviewRequest pretty(String pretty) { this.pretty = pretty; return this; } /** * Build call for createSelfSubjectRulesReview * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return createSelfSubjectRulesReviewCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } /** * Execute createSelfSubjectRulesReview request * @return V1SelfSubjectRulesReview * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public V1SelfSubjectRulesReview execute() throws ApiException { ApiResponse localVarResp = createSelfSubjectRulesReviewWithHttpInfo(body, dryRun, fieldManager, fieldValidation, pretty); return localVarResp.getData(); } /** * Execute createSelfSubjectRulesReview request with HTTP info returned * @return ApiResponse<V1SelfSubjectRulesReview> * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return createSelfSubjectRulesReviewWithHttpInfo(body, dryRun, fieldManager, fieldValidation, pretty); } /** * Execute createSelfSubjectRulesReview 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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return createSelfSubjectRulesReviewAsync(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } } /** * * create a SelfSubjectRulesReview * @param body (required) * @return APIcreateSelfSubjectRulesReviewRequest * @http.response.details
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public APIcreateSelfSubjectRulesReviewRequest createSelfSubjectRulesReview(V1SelfSubjectRulesReview body) { return new APIcreateSelfSubjectRulesReviewRequest(body); } private okhttp3.Call createSubjectAccessReviewCall(V1SubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, 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 = body; // create path and map variables String localVarPath = "/apis/authorization.k8s.io/v1/subjectaccessreviews"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (dryRun != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); } if (fieldManager != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldManager", fieldManager)); } if (fieldValidation != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldValidation", fieldValidation)); } if (pretty != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); } final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "BearerToken" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createSubjectAccessReviewValidateBeforeCall(V1SubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, final ApiCallback _callback) throws ApiException { // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createSubjectAccessReview(Async)"); } return createSubjectAccessReviewCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } private ApiResponse createSubjectAccessReviewWithHttpInfo(V1SubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty) throws ApiException { okhttp3.Call localVarCall = createSubjectAccessReviewValidateBeforeCall(body, dryRun, fieldManager, fieldValidation, pretty, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call createSubjectAccessReviewAsync(V1SubjectAccessReview body, String dryRun, String fieldManager, String fieldValidation, String pretty, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createSubjectAccessReviewValidateBeforeCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIcreateSubjectAccessReviewRequest { private final V1SubjectAccessReview body; private String dryRun; private String fieldManager; private String fieldValidation; private String pretty; private APIcreateSubjectAccessReviewRequest(V1SubjectAccessReview body) { this.body = body; } /** * Set dryRun * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed (optional) * @return APIcreateSubjectAccessReviewRequest */ public APIcreateSubjectAccessReviewRequest dryRun(String dryRun) { this.dryRun = dryRun; return this; } /** * Set fieldManager * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. (optional) * @return APIcreateSubjectAccessReviewRequest */ public APIcreateSubjectAccessReviewRequest fieldManager(String fieldManager) { this.fieldManager = fieldManager; return this; } /** * Set fieldValidation * @param fieldValidation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) * @return APIcreateSubjectAccessReviewRequest */ public APIcreateSubjectAccessReviewRequest fieldValidation(String fieldValidation) { this.fieldValidation = fieldValidation; return this; } /** * Set pretty * @param pretty If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). (optional) * @return APIcreateSubjectAccessReviewRequest */ public APIcreateSubjectAccessReviewRequest pretty(String pretty) { this.pretty = pretty; return this; } /** * Build call for createSubjectAccessReview * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException { return createSubjectAccessReviewCall(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } /** * Execute createSubjectAccessReview request * @return V1SubjectAccessReview * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public V1SubjectAccessReview execute() throws ApiException { ApiResponse localVarResp = createSubjectAccessReviewWithHttpInfo(body, dryRun, fieldManager, fieldValidation, pretty); return localVarResp.getData(); } /** * Execute createSubjectAccessReview request with HTTP info returned * @return ApiResponse<V1SubjectAccessReview> * @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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public ApiResponse executeWithHttpInfo() throws ApiException { return createSubjectAccessReviewWithHttpInfo(body, dryRun, fieldManager, fieldValidation, pretty); } /** * Execute createSubjectAccessReview 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 -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return createSubjectAccessReviewAsync(body, dryRun, fieldManager, fieldValidation, pretty, _callback); } } /** * * create a SubjectAccessReview * @param body (required) * @return APIcreateSubjectAccessReviewRequest * @http.response.details
Status Code Description Response Headers
200 OK -
201 Created -
202 Accepted -
401 Unauthorized -
*/ public APIcreateSubjectAccessReviewRequest createSubjectAccessReview(V1SubjectAccessReview body) { return new APIcreateSubjectAccessReviewRequest(body); } private okhttp3.Call getAPIResourcesCall(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 = "/apis/authorization.k8s.io/v1/"; 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", "application/yaml", "application/vnd.kubernetes.protobuf" }; 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 getAPIResourcesValidateBeforeCall(final ApiCallback _callback) throws ApiException { return getAPIResourcesCall(_callback); } private ApiResponse getAPIResourcesWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call getAPIResourcesAsync(final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAPIResourcesValidateBeforeCall(_callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public class APIgetAPIResourcesRequest { private APIgetAPIResourcesRequest() { } /** * Build call for getAPIResources * @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 getAPIResourcesCall(_callback); } /** * Execute getAPIResources request * @return V1APIResourceList * @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 V1APIResourceList execute() throws ApiException { ApiResponse localVarResp = getAPIResourcesWithHttpInfo(); return localVarResp.getData(); } /** * Execute getAPIResources request with HTTP info returned * @return ApiResponse<V1APIResourceList> * @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 getAPIResourcesWithHttpInfo(); } /** * Execute getAPIResources 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 getAPIResourcesAsync(_callback); } } /** * * get available resources * @return APIgetAPIResourcesRequest * @http.response.details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
*/ public APIgetAPIResourcesRequest getAPIResources() { return new APIgetAPIResourcesRequest(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy