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

com.criteo.marketing.api.PortfolioApi 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.PortfolioMessage;

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

public class PortfolioApi {
    private ApiClient localVarApiClient;

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

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

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

    /**
     * Build call for getPortfolio
     * @param authorization JWT Bearer Token (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 Portfolio returned OK. -
401 Authentication failed. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public okhttp3.Call getPortfolioCall(String authorization, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/v1/portfolio"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); if (authorization != null) { localVarHeaderParams.put("Authorization", localVarApiClient.parameterToString(authorization)); } Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json", "text/json", "application/xml", "text/xml", "text/html" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { "Authorization" }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getPortfolioValidateBeforeCall(String authorization, final ApiCallback _callback) throws ApiException { // verify the required parameter 'authorization' is set if (authorization == null) { throw new ApiException("Missing the required parameter 'authorization' when calling getPortfolio(Async)"); } okhttp3.Call localVarCall = getPortfolioCall(authorization, _callback); return localVarCall; } /** * Gets portfolio * * @param authorization JWT Bearer Token (required) * @return List<PortfolioMessage> * @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 Portfolio returned OK. -
401 Authentication failed. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public List getPortfolio(String authorization) throws ApiException { ApiResponse> localVarResp = getPortfolioWithHttpInfo(authorization); return localVarResp.getData(); } /** * Gets portfolio * * @param authorization JWT Bearer Token (required) * @return ApiResponse<List<PortfolioMessage>> * @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 Portfolio returned OK. -
401 Authentication failed. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public ApiResponse> getPortfolioWithHttpInfo(String authorization) throws ApiException { okhttp3.Call localVarCall = getPortfolioValidateBeforeCall(authorization, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Gets portfolio (asynchronously) * * @param authorization JWT Bearer Token (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 Portfolio returned OK. -
401 Authentication failed. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public okhttp3.Call getPortfolioAsync(String authorization, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getPortfolioValidateBeforeCall(authorization, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy