Tabnine Logo
ApiClient
Code IndexAdd Tabnine to your IDE (free)

How to use
ApiClient
in
io.swagger.client

Best Java code snippets using io.swagger.client.ApiClient (Showing top 20 results out of 315)

origin: de.adorsys.multibanking/onlinebanking-finapi

private ApiClient createApiClient() {
  ApiClient apiClient = new ApiClient();
  apiClient.setBasePath(finapiConnectionUrl);
  apiClient.setAccessToken(clientToken != null ? clientToken.getAccessToken() : null);
  return apiClient;
}
origin: de.adorsys.multibanking/finapi-adapter

/**
 * Set the User-Agent header's value (by adding to the default header map).
 *
 * @param userAgent HTTP request's user agent
 * @return ApiClient
 */
public ApiClient setUserAgent(String userAgent) {
  addDefaultHeader("User-Agent", userAgent);
  return this;
}
origin: MammatusTech/qbit-microservices-examples

queryParams.addAll(apiClient.parameterToPairs("", "id", id));
final String accept = apiClient.selectHeaderAccept(accepts);
final String contentType = apiClient.selectHeaderContentType(contentTypes);
 String response = apiClient.invokeAPI(path, "DELETE", queryParams, postBody, headerParams, formParams, accept, contentType, authNames);
 if(response != null){
  return (String) apiClient.deserialize(response, "", String.class);
origin: de.adorsys.multibanking/onlinebanking-finapi

private ApiClient createUserApiClient() {
  ApiClient apiClient = new ApiClient();
  apiClient.setBasePath(finapiConnectionUrl);
  return apiClient;
}
origin: de.adorsys.multibanking/finapi-adapter

  .replaceAll("\\{" + "userId" + "\\}", apiClient.escapeString(userId.toString()));
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
  apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
    @Override
    public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
origin: de.adorsys.multibanking/finapi-adapter

updateParamsForAuth(authNames, queryParams, headerParams);
final String url = buildUrl(path, queryParams, collectionQueryParams);
final Request.Builder reqBuilder = new Request.Builder().url(url);
processHeaderParams(headerParams, reqBuilder);
  reqBody = null;
} else if ("application/x-www-form-urlencoded".equals(contentType)) {
  reqBody = buildRequestBodyFormEncoding(formParams);
} else if ("multipart/form-data".equals(contentType)) {
  reqBody = buildRequestBodyMultipart(formParams);
} else if (body == null) {
  if ("DELETE".equals(method)) {
  reqBody = serialize(body, contentType);
origin: MammatusTech/qbit-microservices-examples

updateParamsForAuth(authNames, queryParams, headerParams);
Client client = getClient();
 for (Pair queryParam : queryParams){
  if (!queryParam.getName().isEmpty()) {
   b.append(escapeString(queryParam.getName()));
   b.append("=");
   b.append(escapeString(queryParam.getValue()));
   b.append("&");
 if (contentType.startsWith("application/x-www-form-urlencoded")) {
  String encodedFormParams = this
    .getXWWWFormUrlencodedParams(formParams);
  response = builder.type(contentType).post(ClientResponse.class,
    encodedFormParams);
  response = builder.type(contentType).post(ClientResponse.class, serialize(body));
     .getXWWWFormUrlencodedParams(formParams);
   response = builder.type(contentType).put(ClientResponse.class,
     encodedFormParams);
 } else if(body == null) {
  response = builder.put(ClientResponse.class, serialize(body));
 } else {
   response = builder.type(contentType).put(ClientResponse.class, serialize(body));
 if ("application/x-www-form-urlencoded".equals(contentType)) {
  String encodedFormParams = this
origin: de.adorsys.multibanking/finapi-adapter

    params.add(new Pair(name, escapeString(parameterToString(item))));
  delimiter = escapeString(" ");
} else if ("tsv".equals(collectionFormat)) {
  delimiter = escapeString("\t");
} else if ("pipes".equals(collectionFormat)) {
  delimiter = escapeString("|");
for (Object item : value) {
  sb.append(delimiter);
  sb.append(escapeString(parameterToString(item)));
origin: mercadolibre/java-sdk

@Test(expected = ApiException.class)
public void refreshTokenTestFailsIfRefreshTokenIsInvalid() throws ApiException {
  DefaultApi api = new DefaultApi(new ApiClient(), clientId, clientSecret);
  String refreshToken = "1232131";
  api.refreshAccessToken(refreshToken);
}
origin: de.adorsys.multibanking/finapi-adapter

/**
 * Formats the specified query parameter to a list containing a single {@code Pair} object.
 *
 * Note that {@code value} must not be a collection.
 *
 * @param name The name of the parameter.
 * @param value The value of the parameter.
 * @return A list containing a single {@code Pair} object.
 */
public List<Pair> parameterToPair(String name, Object value) {
  List<Pair> params = new ArrayList<Pair>();
  // preconditions
  if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params;
  params.add(new Pair(name, parameterToString(value)));
  return params;
}
origin: de.adorsys.multibanking/finapi-adapter

/**
 * Build a multipart (file uploading) request body with the given form parameters,
 * which could contain text fields and file fields.
 *
 * @param formParams Form parameters in the form of Map
 * @return RequestBody
 */
public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
  MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM);
  for (Entry<String, Object> param : formParams.entrySet()) {
    if (param.getValue() instanceof File) {
      File file = (File) param.getValue();
      Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\"");
      MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file));
      mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file));
    } else {
      Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"");
      mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue())));
    }
  }
  return mpBuilder.build();
}
origin: MammatusTech/qbit-microservices-examples

public ApiClient() {
 // Use ISO 8601 format for date and datetime.
 // See https://en.wikipedia.org/wiki/ISO_8601
 this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
 // Use UTC as the default time zone.
 this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
 // Set default User-Agent.
 setUserAgent("Java-Swagger");
 // Setup authentications (key: authentication name, value: authentication).
 authentications = new HashMap<String, Authentication>();
 // Prevent the authentications from being modified.
 authentications = Collections.unmodifiableMap(authentications);
}
origin: de.adorsys.multibanking/finapi-adapter

return deserialize(response, returnType);
origin: de.adorsys.multibanking/finapi-adapter

  .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
  apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
    @Override
    public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
origin: de.adorsys.multibanking/finapi-adapter

  url.append("&");
String value = parameterToString(param.getValue());
url.append(escapeString(param.getName())).append("=").append(escapeString(value));
  url.append("&");
String value = parameterToString(param.getValue());
url.append(escapeString(param.getName())).append("=").append(value);
origin: mercadolibre/java-sdk

@Test(expected = ApiException.class)
public void authorizeTestFailsIfCodeIsNull() throws ApiException {
  DefaultApi api = new DefaultApi(new ApiClient(), clientId, clientSecret);
  String code = null;
  api.authorize(code, redirectUri);
}
origin: de.adorsys.multibanking/finapi-adapter

/**
 * Set header parameters to the request builder, including default headers.
 *
 * @param headerParams Header parameters in the ofrm of Map
 * @param reqBuilder Reqeust.Builder
 */
public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) {
  for (Entry<String, String> param : headerParams.entrySet()) {
    reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
  }
  for (Entry<String, String> header : defaultHeaderMap.entrySet()) {
    if (!headerParams.containsKey(header.getKey())) {
      reqBuilder.header(header.getKey(), parameterToString(header.getValue()));
    }
  }
}
origin: de.adorsys.multibanking/finapi-adapter

public ApiClient() {
  httpClient = new OkHttpClient();
  verifyingSsl = true;
  json = new JSON();
  // Set default User-Agent.
  setUserAgent("Swagger-Codegen/1.0.0/java");
  // Setup authentications (key: authentication name, value: authentication).
  authentications = new HashMap<String, Authentication>();
  authentications.put("finapi_auth", new OAuth());
  // Prevent the authentications from being modified.
  authentications = Collections.unmodifiableMap(authentications);
}
origin: de.adorsys.multibanking/finapi-adapter

  .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
  apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
    @Override
    public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
origin: MammatusTech/qbit-microservices-examples

 "application/json"
};
final String accept = apiClient.selectHeaderAccept(accepts);
final String contentType = apiClient.selectHeaderContentType(contentTypes);
 String response = apiClient.invokeAPI(path, "GET", queryParams, postBody, headerParams, formParams, accept, contentType, authNames);
 if(response != null){
  return (List<Todo>) apiClient.deserialize(response, "array", Todo.class);
io.swagger.clientApiClient

Most used methods

  • <init>
  • addDefaultHeader
    Add a default header.
  • deserialize
    Deserialize response body to Java object, according to the return type and the Content-Type response
  • escapeString
    Escape the given string to be used as URL query value.
  • parameterToPairs
    Formats the specified collection query parameters to a list of Pair objects. Note that the values of
  • parameterToString
    Format the given parameter object into string.
  • selectHeaderAccept
    Select the Accept header's value from the given accepts array: if JSON exists in the given array, us
  • selectHeaderContentType
    Select the Content-Type header's value from the given array: if JSON exists in the given array, use
  • serialize
    Serialize the given Java object into request body according to the object's class and the request Co
  • setUserAgent
    Set the User-Agent header's value (by adding to the default header map).
  • updateParamsForAuth
    Update query and header parameters based on authentication settings.
  • applySslSettings
    Apply SSL related settings to httpClient according to the current values of verifyingSsl and sslCaCe
  • updateParamsForAuth,
  • applySslSettings,
  • buildCall,
  • buildRequest,
  • buildRequestBodyFormEncoding,
  • buildRequestBodyMultipart,
  • buildUrl,
  • downloadFileFromResponse,
  • execute,
  • executeAsync

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Permission (java.security)
    Legacy security code; do not use.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JOptionPane (javax.swing)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now