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

com.criteo.marketing.api.AdvertisersApi 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.CampaignMessage;
import com.criteo.marketing.model.CategoryMessage;

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

public class AdvertisersApi {
    private ApiClient localVarApiClient;

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

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

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

    /**
     * Build call for getCampaigns
     * @param advertiserId Mandatory. The id of the advertiser to return. (required)
     * @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 Campaigns returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public okhttp3.Call getCampaignsCall(Integer advertiserId, String authorization, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/v1/advertisers/{advertiserId}/campaigns" .replaceAll("\\{" + "advertiserId" + "\\}", localVarApiClient.escapeString(advertiserId.toString())); 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 getCampaignsValidateBeforeCall(Integer advertiserId, String authorization, final ApiCallback _callback) throws ApiException { // verify the required parameter 'advertiserId' is set if (advertiserId == null) { throw new ApiException("Missing the required parameter 'advertiserId' when calling getCampaigns(Async)"); } // verify the required parameter 'authorization' is set if (authorization == null) { throw new ApiException("Missing the required parameter 'authorization' when calling getCampaigns(Async)"); } okhttp3.Call localVarCall = getCampaignsCall(advertiserId, authorization, _callback); return localVarCall; } /** * Gets all advertiser's campaigns * Get the list of all the campaigns linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param authorization JWT Bearer Token (required) * @return List<CampaignMessage> * @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 Campaigns returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public List getCampaigns(Integer advertiserId, String authorization) throws ApiException { ApiResponse> localVarResp = getCampaignsWithHttpInfo(advertiserId, authorization); return localVarResp.getData(); } /** * Gets all advertiser's campaigns * Get the list of all the campaigns linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param authorization JWT Bearer Token (required) * @return ApiResponse<List<CampaignMessage>> * @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 Campaigns returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public ApiResponse> getCampaignsWithHttpInfo(Integer advertiserId, String authorization) throws ApiException { okhttp3.Call localVarCall = getCampaignsValidateBeforeCall(advertiserId, authorization, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Gets all advertiser's campaigns (asynchronously) * Get the list of all the campaigns linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @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 Campaigns returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public okhttp3.Call getCampaignsAsync(Integer advertiserId, String authorization, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getCampaignsValidateBeforeCall(advertiserId, authorization, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getCategories * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param authorization JWT Bearer Token (required) * @param enabledOnly Optional. Returns only categories you can bid on. Defaults to false. (optional) * @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 Categories returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public okhttp3.Call getCategoriesCall(Integer advertiserId, String authorization, Boolean enabledOnly, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/v1/advertisers/{advertiserId}/categories" .replaceAll("\\{" + "advertiserId" + "\\}", localVarApiClient.escapeString(advertiserId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); if (enabledOnly != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("enabledOnly", enabledOnly)); } 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 getCategoriesValidateBeforeCall(Integer advertiserId, String authorization, Boolean enabledOnly, final ApiCallback _callback) throws ApiException { // verify the required parameter 'advertiserId' is set if (advertiserId == null) { throw new ApiException("Missing the required parameter 'advertiserId' when calling getCategories(Async)"); } // verify the required parameter 'authorization' is set if (authorization == null) { throw new ApiException("Missing the required parameter 'authorization' when calling getCategories(Async)"); } okhttp3.Call localVarCall = getCategoriesCall(advertiserId, authorization, enabledOnly, _callback); return localVarCall; } /** * Gets all advertiser's categories * Get the list of all the categories linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param authorization JWT Bearer Token (required) * @param enabledOnly Optional. Returns only categories you can bid on. Defaults to false. (optional) * @return List<CategoryMessage> * @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 Categories returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public List getCategories(Integer advertiserId, String authorization, Boolean enabledOnly) throws ApiException { ApiResponse> localVarResp = getCategoriesWithHttpInfo(advertiserId, authorization, enabledOnly); return localVarResp.getData(); } /** * Gets all advertiser's categories * Get the list of all the categories linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param authorization JWT Bearer Token (required) * @param enabledOnly Optional. Returns only categories you can bid on. Defaults to false. (optional) * @return ApiResponse<List<CategoryMessage>> * @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 Categories returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public ApiResponse> getCategoriesWithHttpInfo(Integer advertiserId, String authorization, Boolean enabledOnly) throws ApiException { okhttp3.Call localVarCall = getCategoriesValidateBeforeCall(advertiserId, authorization, enabledOnly, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Gets all advertiser's categories (asynchronously) * Get the list of all the categories linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param authorization JWT Bearer Token (required) * @param enabledOnly Optional. Returns only categories you can bid on. Defaults to false. (optional) * @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 Categories returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public okhttp3.Call getCategoriesAsync(Integer advertiserId, String authorization, Boolean enabledOnly, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getCategoriesValidateBeforeCall(advertiserId, authorization, enabledOnly, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getCategory * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param categoryHashCode Mandatory. The id of the category to return. (required) * @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 Category returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
404 The requested category was not found for the advertiser. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public okhttp3.Call getCategoryCall(Integer advertiserId, Integer categoryHashCode, String authorization, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/v1/advertisers/{advertiserId}/categories/{categoryHashCode}" .replaceAll("\\{" + "advertiserId" + "\\}", localVarApiClient.escapeString(advertiserId.toString())) .replaceAll("\\{" + "categoryHashCode" + "\\}", localVarApiClient.escapeString(categoryHashCode.toString())); 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 getCategoryValidateBeforeCall(Integer advertiserId, Integer categoryHashCode, String authorization, final ApiCallback _callback) throws ApiException { // verify the required parameter 'advertiserId' is set if (advertiserId == null) { throw new ApiException("Missing the required parameter 'advertiserId' when calling getCategory(Async)"); } // verify the required parameter 'categoryHashCode' is set if (categoryHashCode == null) { throw new ApiException("Missing the required parameter 'categoryHashCode' when calling getCategory(Async)"); } // verify the required parameter 'authorization' is set if (authorization == null) { throw new ApiException("Missing the required parameter 'authorization' when calling getCategory(Async)"); } okhttp3.Call localVarCall = getCategoryCall(advertiserId, categoryHashCode, authorization, _callback); return localVarCall; } /** * Gets a specific advertiser's category * Get a specific category linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param categoryHashCode Mandatory. The id of the category to return. (required) * @param authorization JWT Bearer Token (required) * @return List<CategoryMessage> * @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 Category returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
404 The requested category was not found for the advertiser. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public List getCategory(Integer advertiserId, Integer categoryHashCode, String authorization) throws ApiException { ApiResponse> localVarResp = getCategoryWithHttpInfo(advertiserId, categoryHashCode, authorization); return localVarResp.getData(); } /** * Gets a specific advertiser's category * Get a specific category linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param categoryHashCode Mandatory. The id of the category to return. (required) * @param authorization JWT Bearer Token (required) * @return ApiResponse<List<CategoryMessage>> * @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 Category returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
404 The requested category was not found for the advertiser. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public ApiResponse> getCategoryWithHttpInfo(Integer advertiserId, Integer categoryHashCode, String authorization) throws ApiException { okhttp3.Call localVarCall = getCategoryValidateBeforeCall(advertiserId, categoryHashCode, authorization, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Gets a specific advertiser's category (asynchronously) * Get a specific category linked to the requested advertiser. * @param advertiserId Mandatory. The id of the advertiser to return. (required) * @param categoryHashCode Mandatory. The id of the category to return. (required) * @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 Category returned OK. -
401 Authentication failed. -
403 The requested advertiser is missing from current user’s portfolio. -
404 The requested category was not found for the advertiser. -
429 Throttling failure. Maximum sending rate exceeded. -
500 Unknown error. -
*/ public okhttp3.Call getCategoryAsync(Integer advertiserId, Integer categoryHashCode, String authorization, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getCategoryValidateBeforeCall(advertiserId, categoryHashCode, authorization, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy