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

nl.reinkrul.nuts.crypto.CryptoApi Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
/*
 * Crypto
 * API specification for crypto services available within nuts node
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package nl.reinkrul.nuts.crypto;

import nl.reinkrul.nuts.ApiCallback;
import nl.reinkrul.nuts.ApiClient;
import nl.reinkrul.nuts.ApiException;
import nl.reinkrul.nuts.ApiResponse;
import nl.reinkrul.nuts.Configuration;
import nl.reinkrul.nuts.Pair;
import nl.reinkrul.nuts.ProgressRequestBody;
import nl.reinkrul.nuts.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import nl.reinkrul.nuts.crypto.InlineResponseDefault;
import nl.reinkrul.nuts.crypto.SignJwtRequest;

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

public class CryptoApi {
    private ApiClient localVarApiClient;

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

    public CryptoApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for signJwt
     * @param signJwtRequest  (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     
Status Code Description Response Headers
200 OK response, body holds JWT -
0 Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem. -
*/ public okhttp3.Call signJwtCall(SignJwtRequest signJwtRequest, final ApiCallback _callback) throws ApiException { Object localVarPostBody = signJwtRequest; // create path and map variables String localVarPath = "/internal/crypto/v1/sign_jwt"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "text/plain", "application/problem+json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call signJwtValidateBeforeCall(SignJwtRequest signJwtRequest, final ApiCallback _callback) throws ApiException { // verify the required parameter 'signJwtRequest' is set if (signJwtRequest == null) { throw new ApiException("Missing the required parameter 'signJwtRequest' when calling signJwt(Async)"); } okhttp3.Call localVarCall = signJwtCall(signJwtRequest, _callback); return localVarCall; } /** * sign a JWT payload with the private key of the given kid * Sign a JWT payload with the private key of the given kid error returns: * 400 - incorrect input * @param signJwtRequest (required) * @return Object * @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 response, body holds JWT -
0 Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem. -
*/ public Object signJwt(SignJwtRequest signJwtRequest) throws ApiException { ApiResponse localVarResp = signJwtWithHttpInfo(signJwtRequest); return localVarResp.getData(); } /** * sign a JWT payload with the private key of the given kid * Sign a JWT payload with the private key of the given kid error returns: * 400 - incorrect input * @param signJwtRequest (required) * @return ApiResponse<Object> * @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 response, body holds JWT -
0 Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem. -
*/ public ApiResponse signJwtWithHttpInfo(SignJwtRequest signJwtRequest) throws ApiException { okhttp3.Call localVarCall = signJwtValidateBeforeCall(signJwtRequest, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * sign a JWT payload with the private key of the given kid (asynchronously) * Sign a JWT payload with the private key of the given kid error returns: * 400 - incorrect input * @param signJwtRequest (required) * @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 response, body holds JWT -
0 Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem. -
*/ public okhttp3.Call signJwtAsync(SignJwtRequest signJwtRequest, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = signJwtValidateBeforeCall(signJwtRequest, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }