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

com.criteo.marketing.api.AuthenticationApi Maven / Gradle / Ivy

There is a newer version: 1.0.28
Show newest version
/*
 * Marketing API v.1.0
 * IMPORTANT: This swagger links to Criteo production environment. Any test applied here will thus impact real campaigns.
 *
 * The version of the OpenAPI document: v.1.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 com.criteo.marketing.api;

import com.criteo.marketing.ApiCallback;
import com.criteo.marketing.ApiClient;
import com.criteo.marketing.ApiException;
import com.criteo.marketing.ApiResponse;
import com.criteo.marketing.Configuration;
import com.criteo.marketing.Pair;
import com.criteo.marketing.ProgressRequestBody;
import com.criteo.marketing.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.criteo.marketing.model.InlineResponse200;

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

public class AuthenticationApi {
    private ApiClient localVarApiClient;

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

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

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

    /**
     * Build call for oAuth2TokenPost
     * @param clientId API Client-Id or Username (optional)
     * @param clientSecret API Client secret or password (optional)
     * @param grantType Other grant types are not available (optional, default to "client_credentials")
     * @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 Success -
400 Bad request, invalid syntax -
403 Forbidden -
429 Rate limit reached -
500 Unknown Error -
*/ public okhttp3.Call oAuth2TokenPostCall(String clientId, String clientSecret, String grantType, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/oauth2/token"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); if (clientId != null) { localVarFormParams.put("client_id", clientId); } if (clientSecret != null) { localVarFormParams.put("client_secret", clientSecret); } if (grantType != null) { localVarFormParams.put("grant_type", grantType); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/x-www-form-urlencoded" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call oAuth2TokenPostValidateBeforeCall(String clientId, String clientSecret, String grantType, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = oAuth2TokenPostCall(clientId, clientSecret, grantType, _callback); return localVarCall; } /** * Authenticates provided credentials and returns an access token * Get the token necessary to perform any action through our API. You can create your API User in our Criteo platform <a href='https://marketing.criteo.com' target='_blank'>here</a>. If you forgot your credentials (client_id and/or client_secret) you will need to reset them there. * @param clientId API Client-Id or Username (optional) * @param clientSecret API Client secret or password (optional) * @param grantType Other grant types are not available (optional, default to "client_credentials") * @return InlineResponse200 * @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 Success -
400 Bad request, invalid syntax -
403 Forbidden -
429 Rate limit reached -
500 Unknown Error -
*/ public InlineResponse200 oAuth2TokenPost(String clientId, String clientSecret, String grantType) throws ApiException { ApiResponse localVarResp = oAuth2TokenPostWithHttpInfo(clientId, clientSecret, grantType); return localVarResp.getData(); } /** * Authenticates provided credentials and returns an access token * Get the token necessary to perform any action through our API. You can create your API User in our Criteo platform <a href='https://marketing.criteo.com' target='_blank'>here</a>. If you forgot your credentials (client_id and/or client_secret) you will need to reset them there. * @param clientId API Client-Id or Username (optional) * @param clientSecret API Client secret or password (optional) * @param grantType Other grant types are not available (optional, default to "client_credentials") * @return ApiResponse<InlineResponse200> * @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 Success -
400 Bad request, invalid syntax -
403 Forbidden -
429 Rate limit reached -
500 Unknown Error -
*/ public ApiResponse oAuth2TokenPostWithHttpInfo(String clientId, String clientSecret, String grantType) throws ApiException { okhttp3.Call localVarCall = oAuth2TokenPostValidateBeforeCall(clientId, clientSecret, grantType, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Authenticates provided credentials and returns an access token (asynchronously) * Get the token necessary to perform any action through our API. You can create your API User in our Criteo platform <a href='https://marketing.criteo.com' target='_blank'>here</a>. If you forgot your credentials (client_id and/or client_secret) you will need to reset them there. * @param clientId API Client-Id or Username (optional) * @param clientSecret API Client secret or password (optional) * @param grantType Other grant types are not available (optional, default to "client_credentials") * @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 Success -
400 Bad request, invalid syntax -
403 Forbidden -
429 Rate limit reached -
500 Unknown Error -
*/ public okhttp3.Call oAuth2TokenPostAsync(String clientId, String clientSecret, String grantType, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = oAuth2TokenPostValidateBeforeCall(clientId, clientSecret, grantType, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy