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

nl.vpro.nep.sam.api.AuthenticationApi Maven / Gradle / Ivy

There is a newer version: 8.3.1
Show newest version
package nl.vpro.nep.sam.api;

import nl.vpro.nep.sam.invoker.ApiException;
import nl.vpro.nep.sam.invoker.ApiClient;
import nl.vpro.nep.sam.invoker.Configuration;
import nl.vpro.nep.sam.invoker.Pair;

import jakarta.ws.rs.core.GenericType;

import nl.vpro.nep.sam.model.TokenRequest;
import nl.vpro.nep.sam.model.TokenResponse;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-18T10:26:20.602909888Z[Etc/UTC]", comments = "Generator version: 7.6.0")
public class AuthenticationApi {
  private ApiClient apiClient;

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

  public AuthenticationApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  public ApiClient getApiClient() {
    return apiClient;
  }

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

  /**
   * Get an authentication token
   * Get an authentication token with username/password to be used for access to secured endpoints.
   * @param tokenRequest Username and password (required)
   * @return a {@code TokenResponse}
   * @throws ApiException if fails to make API call
   */
  public TokenResponse v2TokenPost(TokenRequest tokenRequest) throws ApiException {
    Object localVarPostBody = tokenRequest;
    
    // verify the required parameter 'tokenRequest' is set
    if (tokenRequest == null) {
      throw new ApiException(400, "Missing the required parameter 'tokenRequest' when calling v2TokenPost");
    }
    
    // create path and map variables
    String localVarPath = "/v2/token".replaceAll("\\{format\\}","json");

    // query params
    List localVarQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();


    
    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] {  };

    GenericType localVarReturnType = new GenericType() {};
    return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
      }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy