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.MarketplaceCampaignMessage;
import com.criteo.marketing.model.SellerBidsMessage;
import com.criteo.marketing.model.SellerBudgetsCreateMessage;
import com.criteo.marketing.model.SellerBudgetsMessage;
import com.criteo.marketing.model.SellerBudgetsUpdateMessage;
import com.criteo.marketing.model.SellerMessage;
import com.criteo.marketing.model.StatsQueryMessage;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SellersApi {
private ApiClient localVarApiClient;
public SellersApi() {
this(Configuration.getDefaultApiClient());
}
public SellersApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for createBudgets
* @param authorization JWT Bearer Token (required)
* @param sellerBudgets (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
Seller budgets created successfully.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be created). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
One of the requested sellers is unknown. The whole batch will be dropped, no budget will be created.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call createBudgetsCall(String authorization, SellerBudgetsCreateMessage sellerBudgets, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = sellerBudgets;
// create path and map variables
String localVarPath = "/v1/sellers/budgets";
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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createBudgetsValidateBeforeCall(String authorization, SellerBudgetsCreateMessage sellerBudgets, 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 createBudgets(Async)");
}
// verify the required parameter 'sellerBudgets' is set
if (sellerBudgets == null) {
throw new ApiException("Missing the required parameter 'sellerBudgets' when calling createBudgets(Async)");
}
okhttp3.Call localVarCall = createBudgetsCall(authorization, sellerBudgets, _callback);
return localVarCall;
}
/**
* Creates a budget for a seller/list of sellers.
* <b>Seller name</b>: can be retrieved from the /sellers/ endpoint. This value is case insensitive.<br /><b>Amount</b>: in your currency. Set it to \"null\" or leave empty to create an uncapped budget (with no limit).<br /><h4>Response</h4><p> The budget's start date will be set to:<br /> • today: in case no budget is currently set for this seller<br /> • tomorrow: in case your seller already has a budget running, ending at midnight. Note that start dates are UTC+00:00 based.<br /> The budget will remain active until being completely consumed or stopped.<br /></p><h4>Validation rules</h4><p> Budgets cannot <b>overlap</b> with each other for a specific seller.<br /></p><h4>Functional cases</h4><p> When a seller's budget is totally consumed, display delivery will automatically stop for this specific seller.<br /> If budget needs to be updated, by: adding fund, reducing a budget amount or stopping it, refer to the “update budget” endpoint.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBudgets (required)
* @return SellerBudgetsMessage
* @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
Seller budgets created successfully.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be created). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
One of the requested sellers is unknown. The whole batch will be dropped, no budget will be created.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public SellerBudgetsMessage createBudgets(String authorization, SellerBudgetsCreateMessage sellerBudgets) throws ApiException {
ApiResponse localVarResp = createBudgetsWithHttpInfo(authorization, sellerBudgets);
return localVarResp.getData();
}
/**
* Creates a budget for a seller/list of sellers.
* <b>Seller name</b>: can be retrieved from the /sellers/ endpoint. This value is case insensitive.<br /><b>Amount</b>: in your currency. Set it to \"null\" or leave empty to create an uncapped budget (with no limit).<br /><h4>Response</h4><p> The budget's start date will be set to:<br /> • today: in case no budget is currently set for this seller<br /> • tomorrow: in case your seller already has a budget running, ending at midnight. Note that start dates are UTC+00:00 based.<br /> The budget will remain active until being completely consumed or stopped.<br /></p><h4>Validation rules</h4><p> Budgets cannot <b>overlap</b> with each other for a specific seller.<br /></p><h4>Functional cases</h4><p> When a seller's budget is totally consumed, display delivery will automatically stop for this specific seller.<br /> If budget needs to be updated, by: adding fund, reducing a budget amount or stopping it, refer to the “update budget” endpoint.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBudgets (required)
* @return ApiResponse<SellerBudgetsMessage>
* @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
Seller budgets created successfully.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be created). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
One of the requested sellers is unknown. The whole batch will be dropped, no budget will be created.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse createBudgetsWithHttpInfo(String authorization, SellerBudgetsCreateMessage sellerBudgets) throws ApiException {
okhttp3.Call localVarCall = createBudgetsValidateBeforeCall(authorization, sellerBudgets, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Creates a budget for a seller/list of sellers. (asynchronously)
* <b>Seller name</b>: can be retrieved from the /sellers/ endpoint. This value is case insensitive.<br /><b>Amount</b>: in your currency. Set it to \"null\" or leave empty to create an uncapped budget (with no limit).<br /><h4>Response</h4><p> The budget's start date will be set to:<br /> • today: in case no budget is currently set for this seller<br /> • tomorrow: in case your seller already has a budget running, ending at midnight. Note that start dates are UTC+00:00 based.<br /> The budget will remain active until being completely consumed or stopped.<br /></p><h4>Validation rules</h4><p> Budgets cannot <b>overlap</b> with each other for a specific seller.<br /></p><h4>Functional cases</h4><p> When a seller's budget is totally consumed, display delivery will automatically stop for this specific seller.<br /> If budget needs to be updated, by: adding fund, reducing a budget amount or stopping it, refer to the “update budget” endpoint.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBudgets (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
Seller budgets created successfully.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be created). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
One of the requested sellers is unknown. The whole batch will be dropped, no budget will be created.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call createBudgetsAsync(String authorization, SellerBudgetsCreateMessage sellerBudgets, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createBudgetsValidateBeforeCall(authorization, sellerBudgets, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for get
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. One or more campaign ids, E.g., 78, 12932, 45236. If any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. (optional)
* @param onlyActiveSellers Optional. Filters by seller status, allowing to only display active sellers or not. Default value is false. (optional)
* @param onlySellersWithProductsInCatalog Optional. Only return sellers that have currently products in the catalog. Default value is false. (optional)
* @param onlyActiveBudgets Optional. Will return only active budget for each seller. Default value is 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
List of sellers successfully fetched.
-
400
Bad request, invalid syntax.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
405
One of the requested campaigns isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCall(String authorization, String campaignIds, Boolean onlyActiveSellers, Boolean onlySellersWithProductsInCatalog, Boolean onlyActiveBudgets, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/sellers";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
if (campaignIds != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("campaignIds", campaignIds));
}
if (onlyActiveSellers != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("onlyActiveSellers", onlyActiveSellers));
}
if (onlySellersWithProductsInCatalog != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("onlySellersWithProductsInCatalog", onlySellersWithProductsInCatalog));
}
if (onlyActiveBudgets != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("onlyActiveBudgets", onlyActiveBudgets));
}
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 getValidateBeforeCall(String authorization, String campaignIds, Boolean onlyActiveSellers, Boolean onlySellersWithProductsInCatalog, Boolean onlyActiveBudgets, 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 get(Async)");
}
okhttp3.Call localVarCall = getCall(authorization, campaignIds, onlyActiveSellers, onlySellersWithProductsInCatalog, onlyActiveBudgets, _callback);
return localVarCall;
}
/**
* Gets sellers details.
* Returns a list of sellers with all their details.<br /> By default, this list will contain all active sellers that have been on-boarded onto the Criteo Reseller Program.<br /> Note that (in the situation where you would have multiple Criteo Reseller Program campaigns running at the same time) campaign filter can be applied to restrict the response to one or multiple campaign ids.<br /><h4>Functional cases</h4><p> Only currently running and future seller budgets will be retrieved. Past sellers' budgets can be retrieved from the statistics endpoint.<br /> Seller's status has 2 possible values - Active or Inactive - which corresponds to:<br /> • <b>Active</b>: Seller in a running campaign, with a bid (CPC) and a budget > 0<br /> • <b>Inactive</b>: Seller with a budget consumed or that you explicitly stopped.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. One or more campaign ids, E.g., 78, 12932, 45236. If any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. (optional)
* @param onlyActiveSellers Optional. Filters by seller status, allowing to only display active sellers or not. Default value is false. (optional)
* @param onlySellersWithProductsInCatalog Optional. Only return sellers that have currently products in the catalog. Default value is false. (optional)
* @param onlyActiveBudgets Optional. Will return only active budget for each seller. Default value is false (optional)
* @return List<SellerMessage>
* @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
List of sellers successfully fetched.
-
400
Bad request, invalid syntax.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
405
One of the requested campaigns isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public List get(String authorization, String campaignIds, Boolean onlyActiveSellers, Boolean onlySellersWithProductsInCatalog, Boolean onlyActiveBudgets) throws ApiException {
ApiResponse> localVarResp = getWithHttpInfo(authorization, campaignIds, onlyActiveSellers, onlySellersWithProductsInCatalog, onlyActiveBudgets);
return localVarResp.getData();
}
/**
* Gets sellers details.
* Returns a list of sellers with all their details.<br /> By default, this list will contain all active sellers that have been on-boarded onto the Criteo Reseller Program.<br /> Note that (in the situation where you would have multiple Criteo Reseller Program campaigns running at the same time) campaign filter can be applied to restrict the response to one or multiple campaign ids.<br /><h4>Functional cases</h4><p> Only currently running and future seller budgets will be retrieved. Past sellers' budgets can be retrieved from the statistics endpoint.<br /> Seller's status has 2 possible values - Active or Inactive - which corresponds to:<br /> • <b>Active</b>: Seller in a running campaign, with a bid (CPC) and a budget > 0<br /> • <b>Inactive</b>: Seller with a budget consumed or that you explicitly stopped.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. One or more campaign ids, E.g., 78, 12932, 45236. If any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. (optional)
* @param onlyActiveSellers Optional. Filters by seller status, allowing to only display active sellers or not. Default value is false. (optional)
* @param onlySellersWithProductsInCatalog Optional. Only return sellers that have currently products in the catalog. Default value is false. (optional)
* @param onlyActiveBudgets Optional. Will return only active budget for each seller. Default value is false (optional)
* @return ApiResponse<List<SellerMessage>>
* @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
List of sellers successfully fetched.
-
400
Bad request, invalid syntax.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
405
One of the requested campaigns isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse> getWithHttpInfo(String authorization, String campaignIds, Boolean onlyActiveSellers, Boolean onlySellersWithProductsInCatalog, Boolean onlyActiveBudgets) throws ApiException {
okhttp3.Call localVarCall = getValidateBeforeCall(authorization, campaignIds, onlyActiveSellers, onlySellersWithProductsInCatalog, onlyActiveBudgets, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Gets sellers details. (asynchronously)
* Returns a list of sellers with all their details.<br /> By default, this list will contain all active sellers that have been on-boarded onto the Criteo Reseller Program.<br /> Note that (in the situation where you would have multiple Criteo Reseller Program campaigns running at the same time) campaign filter can be applied to restrict the response to one or multiple campaign ids.<br /><h4>Functional cases</h4><p> Only currently running and future seller budgets will be retrieved. Past sellers' budgets can be retrieved from the statistics endpoint.<br /> Seller's status has 2 possible values - Active or Inactive - which corresponds to:<br /> • <b>Active</b>: Seller in a running campaign, with a bid (CPC) and a budget > 0<br /> • <b>Inactive</b>: Seller with a budget consumed or that you explicitly stopped.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param campaignIds Optional. One or more campaign ids, E.g., 78, 12932, 45236. If any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. (optional)
* @param onlyActiveSellers Optional. Filters by seller status, allowing to only display active sellers or not. Default value is false. (optional)
* @param onlySellersWithProductsInCatalog Optional. Only return sellers that have currently products in the catalog. Default value is false. (optional)
* @param onlyActiveBudgets Optional. Will return only active budget for each seller. Default value is 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
List of sellers successfully fetched.
-
400
Bad request, invalid syntax.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
405
One of the requested campaigns isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getAsync(String authorization, String campaignIds, Boolean onlyActiveSellers, Boolean onlySellersWithProductsInCatalog, Boolean onlyActiveBudgets, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getValidateBeforeCall(authorization, campaignIds, onlyActiveSellers, onlySellersWithProductsInCatalog, onlyActiveBudgets, _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 any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. (optional)
* @param advertiserIds Optional. One or more advertiser ids, E.g. 78, 12932, 45236. If the requested advertiser ids are not part of the user's portfolio, the call will fail. (optional)
* @param status Optional. Status of the campaign. By default, all campaigns are returned, regardless of their status. (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
Sellers campaigns returned OK.
-
400
API user's portfolio is empty and no campaignId/advertiserId is provided.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
405
One of the requested campaigns isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCampaignsCall(String authorization, String campaignIds, String advertiserIds, String status, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/sellers/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 (status != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("status", status));
}
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 status, 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, status, _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 any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. (optional)
* @param advertiserIds Optional. One or more advertiser ids, E.g. 78, 12932, 45236. If the requested advertiser ids are not part of the user's portfolio, the call will fail. (optional)
* @param status Optional. Status of the campaign. By default, all campaigns are returned, regardless of their status. (optional)
* @return List<MarketplaceCampaignMessage>
* @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
Sellers campaigns returned OK.
-
400
API user's portfolio is empty and no campaignId/advertiserId is provided.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
405
One of the requested campaigns isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public List getCampaigns(String authorization, String campaignIds, String advertiserIds, String status) throws ApiException {
ApiResponse> localVarResp = getCampaignsWithHttpInfo(authorization, campaignIds, advertiserIds, status);
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 any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. (optional)
* @param advertiserIds Optional. One or more advertiser ids, E.g. 78, 12932, 45236. If the requested advertiser ids are not part of the user's portfolio, the call will fail. (optional)
* @param status Optional. Status of the campaign. By default, all campaigns are returned, regardless of their status. (optional)
* @return ApiResponse<List<MarketplaceCampaignMessage>>
* @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
Sellers campaigns returned OK.
-
400
API user's portfolio is empty and no campaignId/advertiserId is provided.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
405
One of the requested campaigns isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse> getCampaignsWithHttpInfo(String authorization, String campaignIds, String advertiserIds, String status) throws ApiException {
okhttp3.Call localVarCall = getCampaignsValidateBeforeCall(authorization, campaignIds, advertiserIds, status, 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 any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. (optional)
* @param advertiserIds Optional. One or more advertiser ids, E.g. 78, 12932, 45236. If the requested advertiser ids are not part of the user's portfolio, the call will fail. (optional)
* @param status Optional. Status of the campaign. By default, all campaigns are returned, regardless of their status. (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
Sellers campaigns returned OK.
-
400
API user's portfolio is empty and no campaignId/advertiserId is provided.
-
401
Authentication failed.
-
403
One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data.
-
405
One of the requested campaigns isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getCampaignsAsync(String authorization, String campaignIds, String advertiserIds, String status, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getCampaignsValidateBeforeCall(authorization, campaignIds, advertiserIds, status, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getStats
* @param authorization JWT Bearer Token (required)
* @param statsQuery The report query details (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
Statistics report generated OK.
-
400
Bad request, invalid syntax or validation error.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getStatsCall(String authorization, StatsQueryMessage statsQuery, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = statsQuery;
// create path and map variables
String localVarPath = "/v1/sellers/stats";
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 = {
};
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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getStatsValidateBeforeCall(String authorization, StatsQueryMessage statsQuery, 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 getStats(Async)");
}
// verify the required parameter 'statsQuery' is set
if (statsQuery == null) {
throw new ApiException("Missing the required parameter 'statsQuery' when calling getStats(Async)");
}
okhttp3.Call localVarCall = getStatsCall(authorization, statsQuery, _callback);
return localVarCall;
}
/**
* Generates a statistics report
* <b>AdvertiserIds</b>: Optional. The list of advertiser ids, comma-separated. Advertisers not in your portfolio will be skipped. If not present, all the advertisers in the portfolio will be used.<br /><b>StartDate, EndDate</b>: Start date (beginning of day) and end date (end of day) to be used for the report generation. Format to use: yyyy-MM-dd (e.g. 2017-10-30).<br /><b>Dimensions</b>: The dimensions to be used in the report. Between one and three. Possible values: CampaignId, AdvertiserId, Seller, Day, Week, Month, Year.<br /><b>Metrics</b>: The metrics to be used in the report. Possible values: Clicks, AdvertiserCost, Displays.<br /><b>Format</b>: The file format of the generated report. Possible values: Csv, Excel, Xml, Json.<br /><b>Currency</b>: Optional. The currency to be used in the report. Three-letter capitals. For a list of possible values, please see the full documentation. If not set, the user's preference setting will be used.<br /><b>Timezone</b>: Optional. Timezone to be used in the report. Possible values: GMT, PST, JST. If not set, the user's preference setting will be used.<br /><h4>Validation rules</h4> StartDate and EndDate are mandatory.<br /> StartDate should come before, or be equal to EndDate.<br /> The requested dimensions must be in a supported combination.<br /> At least one metric must be provided.<br /> All metrics must be supported.<br /> The selected advertisers must have at least one campaign.<br /> Seller dimension is mandatory.<br />
* @param authorization JWT Bearer Token (required)
* @param statsQuery The report query details (required)
* @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
Statistics report generated OK.
-
400
Bad request, invalid syntax or validation error.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public void getStats(String authorization, StatsQueryMessage statsQuery) throws ApiException {
getStatsWithHttpInfo(authorization, statsQuery);
}
/**
* Generates a statistics report
* <b>AdvertiserIds</b>: Optional. The list of advertiser ids, comma-separated. Advertisers not in your portfolio will be skipped. If not present, all the advertisers in the portfolio will be used.<br /><b>StartDate, EndDate</b>: Start date (beginning of day) and end date (end of day) to be used for the report generation. Format to use: yyyy-MM-dd (e.g. 2017-10-30).<br /><b>Dimensions</b>: The dimensions to be used in the report. Between one and three. Possible values: CampaignId, AdvertiserId, Seller, Day, Week, Month, Year.<br /><b>Metrics</b>: The metrics to be used in the report. Possible values: Clicks, AdvertiserCost, Displays.<br /><b>Format</b>: The file format of the generated report. Possible values: Csv, Excel, Xml, Json.<br /><b>Currency</b>: Optional. The currency to be used in the report. Three-letter capitals. For a list of possible values, please see the full documentation. If not set, the user's preference setting will be used.<br /><b>Timezone</b>: Optional. Timezone to be used in the report. Possible values: GMT, PST, JST. If not set, the user's preference setting will be used.<br /><h4>Validation rules</h4> StartDate and EndDate are mandatory.<br /> StartDate should come before, or be equal to EndDate.<br /> The requested dimensions must be in a supported combination.<br /> At least one metric must be provided.<br /> All metrics must be supported.<br /> The selected advertisers must have at least one campaign.<br /> Seller dimension is mandatory.<br />
* @param authorization JWT Bearer Token (required)
* @param statsQuery The report query details (required)
* @return ApiResponse<Void>
* @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
Statistics report generated OK.
-
400
Bad request, invalid syntax or validation error.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse getStatsWithHttpInfo(String authorization, StatsQueryMessage statsQuery) throws ApiException {
okhttp3.Call localVarCall = getStatsValidateBeforeCall(authorization, statsQuery, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Generates a statistics report (asynchronously)
* <b>AdvertiserIds</b>: Optional. The list of advertiser ids, comma-separated. Advertisers not in your portfolio will be skipped. If not present, all the advertisers in the portfolio will be used.<br /><b>StartDate, EndDate</b>: Start date (beginning of day) and end date (end of day) to be used for the report generation. Format to use: yyyy-MM-dd (e.g. 2017-10-30).<br /><b>Dimensions</b>: The dimensions to be used in the report. Between one and three. Possible values: CampaignId, AdvertiserId, Seller, Day, Week, Month, Year.<br /><b>Metrics</b>: The metrics to be used in the report. Possible values: Clicks, AdvertiserCost, Displays.<br /><b>Format</b>: The file format of the generated report. Possible values: Csv, Excel, Xml, Json.<br /><b>Currency</b>: Optional. The currency to be used in the report. Three-letter capitals. For a list of possible values, please see the full documentation. If not set, the user's preference setting will be used.<br /><b>Timezone</b>: Optional. Timezone to be used in the report. Possible values: GMT, PST, JST. If not set, the user's preference setting will be used.<br /><h4>Validation rules</h4> StartDate and EndDate are mandatory.<br /> StartDate should come before, or be equal to EndDate.<br /> The requested dimensions must be in a supported combination.<br /> At least one metric must be provided.<br /> All metrics must be supported.<br /> The selected advertisers must have at least one campaign.<br /> Seller dimension is mandatory.<br />
* @param authorization JWT Bearer Token (required)
* @param statsQuery The report query details (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
Statistics report generated OK.
-
400
Bad request, invalid syntax or validation error.
-
401
Authentication failed.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call getStatsAsync(String authorization, StatsQueryMessage statsQuery, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getStatsValidateBeforeCall(authorization, statsQuery, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for updateBids
* @param authorization JWT Bearer Token (required)
* @param sellerBids (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
Sellers bids successfully updated.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no bid will be updated). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaign doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
One of the requested sellers is unknown which prevents from updating bids. To get the list of sellers and their IDs you can use the /sellers endpoint.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call updateBidsCall(String authorization, SellerBidsMessage sellerBids, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = sellerBids;
// create path and map variables
String localVarPath = "/v1/sellers/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, SellerBidsMessage sellerBids, 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 'sellerBids' is set
if (sellerBids == null) {
throw new ApiException("Missing the required parameter 'sellerBids' when calling updateBids(Async)");
}
okhttp3.Call localVarCall = updateBidsCall(authorization, sellerBids, _callback);
return localVarCall;
}
/**
* Set or update a bid for a seller/list of sellers.
* <b>Seller name</b>: can be retrieved from the /sellers/ endpoint. This value is case insensitive. <h4>Functional cases</h4><p> In case one of the bid values cannot be updated, the whole batch will be dropped.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBids (required)
* @return SellerBidsMessage
* @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
Sellers bids successfully updated.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no bid will be updated). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaign doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
One of the requested sellers is unknown which prevents from updating bids. To get the list of sellers and their IDs you can use the /sellers endpoint.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public SellerBidsMessage updateBids(String authorization, SellerBidsMessage sellerBids) throws ApiException {
ApiResponse localVarResp = updateBidsWithHttpInfo(authorization, sellerBids);
return localVarResp.getData();
}
/**
* Set or update a bid for a seller/list of sellers.
* <b>Seller name</b>: can be retrieved from the /sellers/ endpoint. This value is case insensitive. <h4>Functional cases</h4><p> In case one of the bid values cannot be updated, the whole batch will be dropped.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBids (required)
* @return ApiResponse<SellerBidsMessage>
* @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
Sellers bids successfully updated.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no bid will be updated). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaign doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
One of the requested sellers is unknown which prevents from updating bids. To get the list of sellers and their IDs you can use the /sellers endpoint.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse updateBidsWithHttpInfo(String authorization, SellerBidsMessage sellerBids) throws ApiException {
okhttp3.Call localVarCall = updateBidsValidateBeforeCall(authorization, sellerBids, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Set or update a bid for a seller/list of sellers. (asynchronously)
* <b>Seller name</b>: can be retrieved from the /sellers/ endpoint. This value is case insensitive. <h4>Functional cases</h4><p> In case one of the bid values cannot be updated, the whole batch will be dropped.<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBids (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
Sellers bids successfully updated.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no bid will be updated). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaign doesn't belong to the API user's portfolio which prevents from accessing its data.
-
404
One of the requested sellers is unknown which prevents from updating bids. To get the list of sellers and their IDs you can use the /sellers endpoint.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call updateBidsAsync(String authorization, SellerBidsMessage sellerBids, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateBidsValidateBeforeCall(authorization, sellerBids, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for updateBudgets
* @param authorization JWT Bearer Token (required)
* @param sellerBudgets (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
Sellers budgets successfully updated.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be updated). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaign doesn't belong to the API user's portfolio which prevents from updating budgets.
-
404
One of the requested budgets is unknown. The whole batch will be dropped, no budget will be updated.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call updateBudgetsCall(String authorization, SellerBudgetsUpdateMessage sellerBudgets, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = sellerBudgets;
// create path and map variables
String localVarPath = "/v1/sellers/budgets";
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 updateBudgetsValidateBeforeCall(String authorization, SellerBudgetsUpdateMessage sellerBudgets, 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 updateBudgets(Async)");
}
// verify the required parameter 'sellerBudgets' is set
if (sellerBudgets == null) {
throw new ApiException("Missing the required parameter 'sellerBudgets' when calling updateBudgets(Async)");
}
okhttp3.Call localVarCall = updateBudgetsCall(authorization, sellerBudgets, _callback);
return localVarCall;
}
/**
* Updates a budget for a seller/list of sellers.
* <b>Amount</b>: Optional. Uses the advertiser's currency. Set it to \"null\" or leave empty to create an uncapped budget (with no limit).<br /><b>Status</b>: Optional. Budget's status, possible values are: [\"Inactive\",\"Active\"]. If set to null or undefined, status does not change. <h4>Validation rules</h4><p> Budgets cannot <b>overlap</b> with each other for a specific seller.<br /> Budget's <b>amount</b> can be decreased if it did not start yet.<br /> Budget's <b>status</b> can only be changed from \"Active\" to \"Inactive\", if budget already started.<br /><b>Inactive</b> budgets cannot be updated. </p><h4>Functional cases</h4><h5>Increase budget amount</h5><p> Budget can only be increased if its end date is not reached.<br /> Amount value must include the amount that has been already spent.<br /> Example: if you want to add 50€ to a 100€ budget, you should update the amount to 150€, regardless of the amount already spent.<br /> Or, alternatively, you can set it to \"null\" or leave empty to change the budget to uncapped.<br /></p><h5>Stop budget consumption</h5><p> Setting a currently running budget’s status to Inactive, result in:<br /> • Setting its end date to today (at 23:59:59, according to UTC+00:00)<br /> • Stopping its consumption instantly<br /></p><h5>Decrease budget amount</h5><p> In order to decrease the amount of a currently running budget, you have to:<br /> • Stop budget consumption (making the currently running budget to end at 23:59:59, according to UTC+00:00)<br /> • Create a new budget with a dedicated amount. (that will start the following day, according to UTC+00:00)<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBudgets (required)
* @return SellerBudgetsMessage
* @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
Sellers budgets successfully updated.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be updated). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaign doesn't belong to the API user's portfolio which prevents from updating budgets.
-
404
One of the requested budgets is unknown. The whole batch will be dropped, no budget will be updated.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public SellerBudgetsMessage updateBudgets(String authorization, SellerBudgetsUpdateMessage sellerBudgets) throws ApiException {
ApiResponse localVarResp = updateBudgetsWithHttpInfo(authorization, sellerBudgets);
return localVarResp.getData();
}
/**
* Updates a budget for a seller/list of sellers.
* <b>Amount</b>: Optional. Uses the advertiser's currency. Set it to \"null\" or leave empty to create an uncapped budget (with no limit).<br /><b>Status</b>: Optional. Budget's status, possible values are: [\"Inactive\",\"Active\"]. If set to null or undefined, status does not change. <h4>Validation rules</h4><p> Budgets cannot <b>overlap</b> with each other for a specific seller.<br /> Budget's <b>amount</b> can be decreased if it did not start yet.<br /> Budget's <b>status</b> can only be changed from \"Active\" to \"Inactive\", if budget already started.<br /><b>Inactive</b> budgets cannot be updated. </p><h4>Functional cases</h4><h5>Increase budget amount</h5><p> Budget can only be increased if its end date is not reached.<br /> Amount value must include the amount that has been already spent.<br /> Example: if you want to add 50€ to a 100€ budget, you should update the amount to 150€, regardless of the amount already spent.<br /> Or, alternatively, you can set it to \"null\" or leave empty to change the budget to uncapped.<br /></p><h5>Stop budget consumption</h5><p> Setting a currently running budget’s status to Inactive, result in:<br /> • Setting its end date to today (at 23:59:59, according to UTC+00:00)<br /> • Stopping its consumption instantly<br /></p><h5>Decrease budget amount</h5><p> In order to decrease the amount of a currently running budget, you have to:<br /> • Stop budget consumption (making the currently running budget to end at 23:59:59, according to UTC+00:00)<br /> • Create a new budget with a dedicated amount. (that will start the following day, according to UTC+00:00)<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBudgets (required)
* @return ApiResponse<SellerBudgetsMessage>
* @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
Sellers budgets successfully updated.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be updated). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaign doesn't belong to the API user's portfolio which prevents from updating budgets.
-
404
One of the requested budgets is unknown. The whole batch will be dropped, no budget will be updated.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public ApiResponse updateBudgetsWithHttpInfo(String authorization, SellerBudgetsUpdateMessage sellerBudgets) throws ApiException {
okhttp3.Call localVarCall = updateBudgetsValidateBeforeCall(authorization, sellerBudgets, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Updates a budget for a seller/list of sellers. (asynchronously)
* <b>Amount</b>: Optional. Uses the advertiser's currency. Set it to \"null\" or leave empty to create an uncapped budget (with no limit).<br /><b>Status</b>: Optional. Budget's status, possible values are: [\"Inactive\",\"Active\"]. If set to null or undefined, status does not change. <h4>Validation rules</h4><p> Budgets cannot <b>overlap</b> with each other for a specific seller.<br /> Budget's <b>amount</b> can be decreased if it did not start yet.<br /> Budget's <b>status</b> can only be changed from \"Active\" to \"Inactive\", if budget already started.<br /><b>Inactive</b> budgets cannot be updated. </p><h4>Functional cases</h4><h5>Increase budget amount</h5><p> Budget can only be increased if its end date is not reached.<br /> Amount value must include the amount that has been already spent.<br /> Example: if you want to add 50€ to a 100€ budget, you should update the amount to 150€, regardless of the amount already spent.<br /> Or, alternatively, you can set it to \"null\" or leave empty to change the budget to uncapped.<br /></p><h5>Stop budget consumption</h5><p> Setting a currently running budget’s status to Inactive, result in:<br /> • Setting its end date to today (at 23:59:59, according to UTC+00:00)<br /> • Stopping its consumption instantly<br /></p><h5>Decrease budget amount</h5><p> In order to decrease the amount of a currently running budget, you have to:<br /> • Stop budget consumption (making the currently running budget to end at 23:59:59, according to UTC+00:00)<br /> • Create a new budget with a dedicated amount. (that will start the following day, according to UTC+00:00)<br /></p>
* @param authorization JWT Bearer Token (required)
* @param sellerBudgets (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
Sellers budgets successfully updated.
-
400
Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be updated). Response message will be different based on error.
-
401
Authentication failed.
-
403
The requested campaign doesn't belong to the API user's portfolio which prevents from updating budgets.
-
404
One of the requested budgets is unknown. The whole batch will be dropped, no budget will be updated.
-
405
Requested campaign isn't a Criteo Reseller Program one.
-
429
Throttling failure. Maximum sending rate exceeded.
-
500
Unknown error.
-
*/
public okhttp3.Call updateBudgetsAsync(String authorization, SellerBudgetsUpdateMessage sellerBudgets, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateBudgetsValidateBeforeCall(authorization, sellerBudgets, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}