Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.CampaignBidChangeRequest;
import com.criteo.marketing.model.CampaignBidMessage;
import com.criteo.marketing.model.CampaignMessage;
import com.criteo.marketing.model.CategoryMessage;
import com.criteo.marketing.model.MessageWithDetailsCampaignBidChangeResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CampaignsApi {
private ApiClient localVarApiClient;
public CampaignsApi() {
this(Configuration.getDefaultApiClient());
}
public CampaignsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for getBids
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. The ids of the campaigns we want to get the bids on. If not specified, advertiserIds will be used. (optional)
* @param advertiserIds Optional. The ids of the advertisers' campaigns we want to get the bids on. If campaignIds not specified, and neither is advertiserIds, all the advertisers in the user's portfolio are used. (optional)
* @param categoryHashCodes Optional. Filters only specified categories. By default no filtering is applied. (optional)
* @param bidType Optional. Filters by bid type. By default no filtering is applied. (optional)
* @param campaignStatus Optional. Filters by campaign status. By default no filtering is applied. (optional)
* @param pendingChanges Optional. Filters only pending changes or settled ones. By default no filtering is applied. (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
Bids returned OK.
-
401
Authentication failed.
-
403
There is not even one valid advertiserId or campaignId requested.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getBidsCall(String authorization, String campaignIds, String advertiserIds, String categoryHashCodes, String bidType, String campaignStatus, Boolean pendingChanges, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/campaigns/bids";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (campaignIds != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignIds", campaignIds));
}
if (advertiserIds != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("advertiserIds", advertiserIds));
}
if (categoryHashCodes != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("categoryHashCodes", categoryHashCodes));
}
if (bidType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("bidType", bidType));
}
if (campaignStatus != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignStatus", campaignStatus));
}
if (pendingChanges != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("pendingChanges", pendingChanges));
}
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 getBidsValidateBeforeCall(String authorization, String campaignIds, String advertiserIds, String categoryHashCodes, String bidType, String campaignStatus, Boolean pendingChanges, 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 getBids(Async)");
}
okhttp3.Call localVarCall = getBidsCall(authorization, campaignIds, advertiserIds, categoryHashCodes, bidType, campaignStatus, pendingChanges, _callback);
return localVarCall;
}
/**
* Gets a the bids for campaigns and their categories
* Get the campaigns' bids, as well as the bids of their categories
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. The ids of the campaigns we want to get the bids on. If not specified, advertiserIds will be used. (optional)
* @param advertiserIds Optional. The ids of the advertisers' campaigns we want to get the bids on. If campaignIds not specified, and neither is advertiserIds, all the advertisers in the user's portfolio are used. (optional)
* @param categoryHashCodes Optional. Filters only specified categories. By default no filtering is applied. (optional)
* @param bidType Optional. Filters by bid type. By default no filtering is applied. (optional)
* @param campaignStatus Optional. Filters by campaign status. By default no filtering is applied. (optional)
* @param pendingChanges Optional. Filters only pending changes or settled ones. By default no filtering is applied. (optional)
* @return List<CampaignBidMessage>
* @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
Bids returned OK.
-
401
Authentication failed.
-
403
There is not even one valid advertiserId or campaignId requested.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public List getBids(String authorization, String campaignIds, String advertiserIds, String categoryHashCodes, String bidType, String campaignStatus, Boolean pendingChanges) throws ApiException {
ApiResponse> localVarResp = getBidsWithHttpInfo(authorization, campaignIds, advertiserIds, categoryHashCodes, bidType, campaignStatus, pendingChanges);
return localVarResp.getData();
}
/**
* Gets a the bids for campaigns and their categories
* Get the campaigns' bids, as well as the bids of their categories
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. The ids of the campaigns we want to get the bids on. If not specified, advertiserIds will be used. (optional)
* @param advertiserIds Optional. The ids of the advertisers' campaigns we want to get the bids on. If campaignIds not specified, and neither is advertiserIds, all the advertisers in the user's portfolio are used. (optional)
* @param categoryHashCodes Optional. Filters only specified categories. By default no filtering is applied. (optional)
* @param bidType Optional. Filters by bid type. By default no filtering is applied. (optional)
* @param campaignStatus Optional. Filters by campaign status. By default no filtering is applied. (optional)
* @param pendingChanges Optional. Filters only pending changes or settled ones. By default no filtering is applied. (optional)
* @return ApiResponse<List<CampaignBidMessage>>
* @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
Bids returned OK.
-
401
Authentication failed.
-
403
There is not even one valid advertiserId or campaignId requested.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse> getBidsWithHttpInfo(String authorization, String campaignIds, String advertiserIds, String categoryHashCodes, String bidType, String campaignStatus, Boolean pendingChanges) throws ApiException {
okhttp3.Call localVarCall = getBidsValidateBeforeCall(authorization, campaignIds, advertiserIds, categoryHashCodes, bidType, campaignStatus, pendingChanges, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Gets a the bids for campaigns and their categories (asynchronously)
* Get the campaigns' bids, as well as the bids of their categories
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. The ids of the campaigns we want to get the bids on. If not specified, advertiserIds will be used. (optional)
* @param advertiserIds Optional. The ids of the advertisers' campaigns we want to get the bids on. If campaignIds not specified, and neither is advertiserIds, all the advertisers in the user's portfolio are used. (optional)
* @param categoryHashCodes Optional. Filters only specified categories. By default no filtering is applied. (optional)
* @param bidType Optional. Filters by bid type. By default no filtering is applied. (optional)
* @param campaignStatus Optional. Filters by campaign status. By default no filtering is applied. (optional)
* @param pendingChanges Optional. Filters only pending changes or settled ones. By default no filtering is applied. (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
Bids returned OK.
-
401
Authentication failed.
-
403
There is not even one valid advertiserId or campaignId requested.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getBidsAsync(String authorization, String campaignIds, String advertiserIds, String categoryHashCodes, String bidType, String campaignStatus, Boolean pendingChanges, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getBidsValidateBeforeCall(authorization, campaignIds, advertiserIds, categoryHashCodes, bidType, campaignStatus, pendingChanges, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getCampaign
* @param campaignId Mandatory. The id of the campaign 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
Campaign returned OK.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested campaign was not found.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCampaignCall(Integer campaignId, String authorization, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/campaigns/{campaignId}"
.replaceAll("\\{" + "campaignId" + "\\}", localVarApiClient.escapeString(campaignId.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 getCampaignValidateBeforeCall(Integer campaignId, String authorization, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'campaignId' is set
if (campaignId == null) {
throw new ApiException("Missing the required parameter 'campaignId' when calling getCampaign(Async)");
}
// verify the required parameter 'authorization' is set
if (authorization == null) {
throw new ApiException("Missing the required parameter 'authorization' when calling getCampaign(Async)");
}
okhttp3.Call localVarCall = getCampaignCall(campaignId, authorization, _callback);
return localVarCall;
}
/**
* Gets a specific campaign
* Get a specific campaign
* @param campaignId Mandatory. The id of the campaign to return. (required)
* @param authorization JWT Bearer Token (required)
* @return 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
Campaign returned OK.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested campaign was not found.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public CampaignMessage getCampaign(Integer campaignId, String authorization) throws ApiException {
ApiResponse localVarResp = getCampaignWithHttpInfo(campaignId, authorization);
return localVarResp.getData();
}
/**
* Gets a specific campaign
* Get a specific campaign
* @param campaignId Mandatory. The id of the campaign to return. (required)
* @param authorization JWT Bearer Token (required)
* @return ApiResponse<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
Campaign returned OK.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested campaign was not found.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse getCampaignWithHttpInfo(Integer campaignId, String authorization) throws ApiException {
okhttp3.Call localVarCall = getCampaignValidateBeforeCall(campaignId, authorization, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Gets a specific campaign (asynchronously)
* Get a specific campaign
* @param campaignId Mandatory. The id of the campaign 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
Campaign returned OK.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested campaign was not found.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCampaignAsync(Integer campaignId, String authorization, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getCampaignValidateBeforeCall(campaignId, authorization, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getCampaigns
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. One or more campaign ids, E.g., 78, 12932, 45236. If the campaign ids requested are not linked to advertisers in the user's portfolio, they will be skipped. (optional)
* @param advertiserIds Optional. One or more advertiser ids, E.g., 78, 12932, 45236. If the advertiser ids requested are not part of the user's portfolio, they will be skipped. (optional)
* @param campaignStatus Optional. Filters by campaign status. By default no filtering is applied. (optional)
* @param bidType Optional. Filters by campaign bid type. By default, no filtering is applied. (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
Campaigns returned OK.
-
400
There is not even one valid advertiserId or campaignId requested.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCampaignsCall(String authorization, String campaignIds, String advertiserIds, String campaignStatus, String bidType, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/campaigns";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (campaignIds != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignIds", campaignIds));
}
if (advertiserIds != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("advertiserIds", advertiserIds));
}
if (campaignStatus != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignStatus", campaignStatus));
}
if (bidType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("bidType", bidType));
}
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(String authorization, String campaignIds, String advertiserIds, String campaignStatus, String bidType, 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 getCampaigns(Async)");
}
okhttp3.Call localVarCall = getCampaignsCall(authorization, campaignIds, advertiserIds, campaignStatus, bidType, _callback);
return localVarCall;
}
/**
* Gets campaigns
* Get the list of campaigns with the specified filters. If a campaign is requested but is missing from current user's portfolio, it will not be included in the list. If neither campaign ids nor advertisers ids are provided, then the user's portfolio will be used.
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. One or more campaign ids, E.g., 78, 12932, 45236. If the campaign ids requested are not linked to advertisers in the user's portfolio, they will be skipped. (optional)
* @param advertiserIds Optional. One or more advertiser ids, E.g., 78, 12932, 45236. If the advertiser ids requested are not part of the user's portfolio, they will be skipped. (optional)
* @param campaignStatus Optional. Filters by campaign status. By default no filtering is applied. (optional)
* @param bidType Optional. Filters by campaign bid type. By default, no filtering is applied. (optional)
* @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.
-
400
There is not even one valid advertiserId or campaignId requested.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public List getCampaigns(String authorization, String campaignIds, String advertiserIds, String campaignStatus, String bidType) throws ApiException {
ApiResponse> localVarResp = getCampaignsWithHttpInfo(authorization, campaignIds, advertiserIds, campaignStatus, bidType);
return localVarResp.getData();
}
/**
* Gets campaigns
* Get the list of campaigns with the specified filters. If a campaign is requested but is missing from current user's portfolio, it will not be included in the list. If neither campaign ids nor advertisers ids are provided, then the user's portfolio will be used.
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. One or more campaign ids, E.g., 78, 12932, 45236. If the campaign ids requested are not linked to advertisers in the user's portfolio, they will be skipped. (optional)
* @param advertiserIds Optional. One or more advertiser ids, E.g., 78, 12932, 45236. If the advertiser ids requested are not part of the user's portfolio, they will be skipped. (optional)
* @param campaignStatus Optional. Filters by campaign status. By default no filtering is applied. (optional)
* @param bidType Optional. Filters by campaign bid type. By default, no filtering is applied. (optional)
* @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.
-
400
There is not even one valid advertiserId or campaignId requested.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse> getCampaignsWithHttpInfo(String authorization, String campaignIds, String advertiserIds, String campaignStatus, String bidType) throws ApiException {
okhttp3.Call localVarCall = getCampaignsValidateBeforeCall(authorization, campaignIds, advertiserIds, campaignStatus, bidType, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Gets campaigns (asynchronously)
* Get the list of campaigns with the specified filters. If a campaign is requested but is missing from current user's portfolio, it will not be included in the list. If neither campaign ids nor advertisers ids are provided, then the user's portfolio will be used.
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. One or more campaign ids, E.g., 78, 12932, 45236. If the campaign ids requested are not linked to advertisers in the user's portfolio, they will be skipped. (optional)
* @param advertiserIds Optional. One or more advertiser ids, E.g., 78, 12932, 45236. If the advertiser ids requested are not part of the user's portfolio, they will be skipped. (optional)
* @param campaignStatus Optional. Filters by campaign status. By default no filtering is applied. (optional)
* @param bidType Optional. Filters by campaign bid type. By default, no filtering is applied. (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
Campaigns returned OK.
-
400
There is not even one valid advertiserId or campaignId requested.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCampaignsAsync(String authorization, String campaignIds, String advertiserIds, String campaignStatus, String bidType, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getCampaignsValidateBeforeCall(authorization, campaignIds, advertiserIds, campaignStatus, bidType, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getCategories
* @param campaignId Mandatory. The id of the campaign the categories are linked to. (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
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested campaign was not found.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCategoriesCall(Integer campaignId, String authorization, Boolean enabledOnly, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/campaigns/{campaignId}/categories"
.replaceAll("\\{" + "campaignId" + "\\}", localVarApiClient.escapeString(campaignId.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 campaignId, String authorization, Boolean enabledOnly, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'campaignId' is set
if (campaignId == null) {
throw new ApiException("Missing the required parameter 'campaignId' 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(campaignId, authorization, enabledOnly, _callback);
return localVarCall;
}
/**
* Gets categories
* Get the list of categories linked to the requested campaign.
* @param campaignId Mandatory. The id of the campaign the categories are linked to. (required)
* @param authorization JWT Bearer Token (required)
* @param enabledOnly Optional. Returns only categories you can bid on. Defaults to false. (optional)
* @return 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
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested campaign was not found.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public CategoryMessage getCategories(Integer campaignId, String authorization, Boolean enabledOnly) throws ApiException {
ApiResponse localVarResp = getCategoriesWithHttpInfo(campaignId, authorization, enabledOnly);
return localVarResp.getData();
}
/**
* Gets categories
* Get the list of categories linked to the requested campaign.
* @param campaignId Mandatory. The id of the campaign the categories are linked to. (required)
* @param authorization JWT Bearer Token (required)
* @param enabledOnly Optional. Returns only categories you can bid on. Defaults to false. (optional)
* @return ApiResponse<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
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested campaign was not found.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse getCategoriesWithHttpInfo(Integer campaignId, String authorization, Boolean enabledOnly) throws ApiException {
okhttp3.Call localVarCall = getCategoriesValidateBeforeCall(campaignId, authorization, enabledOnly, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Gets categories (asynchronously)
* Get the list of categories linked to the requested campaign.
* @param campaignId Mandatory. The id of the campaign the categories are linked to. (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
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested campaign was not found.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCategoriesAsync(Integer campaignId, String authorization, Boolean enabledOnly, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getCategoriesValidateBeforeCall(campaignId, authorization, enabledOnly, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getCategory
* @param campaignId Mandatory. The id of the campaign the categories are linked to. (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
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested category was not found for the campaign.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCategoryCall(Integer campaignId, Integer categoryHashCode, String authorization, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/campaigns/{campaignId}/categories/{categoryHashCode}"
.replaceAll("\\{" + "campaignId" + "\\}", localVarApiClient.escapeString(campaignId.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 campaignId, Integer categoryHashCode, String authorization, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'campaignId' is set
if (campaignId == null) {
throw new ApiException("Missing the required parameter 'campaignId' 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(campaignId, categoryHashCode, authorization, _callback);
return localVarCall;
}
/**
* Gets a specific category
* Get a specific category linked to the requested campaign.
* @param campaignId Mandatory. The id of the campaign the categories are linked to. (required)
* @param categoryHashCode Mandatory. The id of the category to return. (required)
* @param authorization JWT Bearer Token (required)
* @return 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
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested category was not found for the campaign.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public CategoryMessage getCategory(Integer campaignId, Integer categoryHashCode, String authorization) throws ApiException {
ApiResponse localVarResp = getCategoryWithHttpInfo(campaignId, categoryHashCode, authorization);
return localVarResp.getData();
}
/**
* Gets a specific category
* Get a specific category linked to the requested campaign.
* @param campaignId Mandatory. The id of the campaign the categories are linked to. (required)
* @param categoryHashCode Mandatory. The id of the category to return. (required)
* @param authorization JWT Bearer Token (required)
* @return ApiResponse<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
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested category was not found for the campaign.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse getCategoryWithHttpInfo(Integer campaignId, Integer categoryHashCode, String authorization) throws ApiException {
okhttp3.Call localVarCall = getCategoryValidateBeforeCall(campaignId, categoryHashCode, authorization, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Gets a specific category (asynchronously)
* Get a specific category linked to the requested campaign.
* @param campaignId Mandatory. The id of the campaign the categories are linked to. (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
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
The requested category was not found for the campaign.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCategoryAsync(Integer campaignId, Integer categoryHashCode, String authorization, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getCategoryValidateBeforeCall(campaignId, categoryHashCode, authorization, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateBids
* @param authorization JWT Bearer Token (required)
* @param bidChanges Specifies the list of bid changes to be applied. (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
Campaign bids updated OK.
-
400
Invalid input. Please check returned message for details.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call updateBidsCall(String authorization, List bidChanges, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = bidChanges;
// create path and map variables
String localVarPath = "/v1/campaigns/bids";
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 = {
"application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded", "text/html"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "Authorization" };
return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateBidsValidateBeforeCall(String authorization, List bidChanges, 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 updateBids(Async)");
}
// verify the required parameter 'bidChanges' is set
if (bidChanges == null) {
throw new ApiException("Missing the required parameter 'bidChanges' when calling updateBids(Async)");
}
okhttp3.Call localVarCall = updateBidsCall(authorization, bidChanges, _callback);
return localVarCall;
}
/**
* Update bids for campaigns and their categories
* If a campaign bid is updated, all (if any) category bids for this campaign will be updated with the new value if they are initially equal to the campaign bid. If the category bid is not wanted to be cascaded to the categories with the same bid value, new change bids must be added in the request for the categories where the value should be kept (with the initial value).
* @param authorization JWT Bearer Token (required)
* @param bidChanges Specifies the list of bid changes to be applied. (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
Campaign bids updated OK.
-
400
Invalid input. Please check returned message for details.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public List updateBids(String authorization, List bidChanges) throws ApiException {
ApiResponse> localVarResp = updateBidsWithHttpInfo(authorization, bidChanges);
return localVarResp.getData();
}
/**
* Update bids for campaigns and their categories
* If a campaign bid is updated, all (if any) category bids for this campaign will be updated with the new value if they are initially equal to the campaign bid. If the category bid is not wanted to be cascaded to the categories with the same bid value, new change bids must be added in the request for the categories where the value should be kept (with the initial value).
* @param authorization JWT Bearer Token (required)
* @param bidChanges Specifies the list of bid changes to be applied. (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
Campaign bids updated OK.
-
400
Invalid input. Please check returned message for details.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse> updateBidsWithHttpInfo(String authorization, List bidChanges) throws ApiException {
okhttp3.Call localVarCall = updateBidsValidateBeforeCall(authorization, bidChanges, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Update bids for campaigns and their categories (asynchronously)
* If a campaign bid is updated, all (if any) category bids for this campaign will be updated with the new value if they are initially equal to the campaign bid. If the category bid is not wanted to be cascaded to the categories with the same bid value, new change bids must be added in the request for the categories where the value should be kept (with the initial value).
* @param authorization JWT Bearer Token (required)
* @param bidChanges Specifies the list of bid changes to be applied. (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
Campaign bids updated OK.
-
400
Invalid input. Please check returned message for details.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call updateBidsAsync(String authorization, List bidChanges, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = updateBidsValidateBeforeCall(authorization, bidChanges, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}