Please wait. This can take some minutes ...
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.
com.facebook.ads.sdk.ProductFeed Maven / Gradle / Ivy
/**
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
*
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
* use, copy, modify, and distribute this software in source code or binary
* form for use in connection with the web services and APIs provided by
* Facebook.
*
* As with any software that integrates with the Facebook platform, your use
* of this software is subject to the Facebook Developer Principles and
* Policies [http://developers.facebook.com/policy/]. This copyright notice
* shall be included in all copies or substantial portions of the software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
package com.facebook.ads.sdk;
import java.io.File;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.common.base.Function;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import com.google.gson.JsonObject;
import com.google.gson.JsonArray;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.facebook.ads.sdk.APIException.MalformedResponseException;
/**
* This class is auto-generated.
*
* For any issues or feature requests related to this class, please let us know
* on github and we'll fix in our codegen framework. We'll not be able to accept
* pull request for this class.
*
*/
public class ProductFeed extends APINode {
@SerializedName("country")
private String mCountry = null;
@SerializedName("created_time")
private String mCreatedTime = null;
@SerializedName("default_currency")
private String mDefaultCurrency = null;
@SerializedName("deletion_enabled")
private Boolean mDeletionEnabled = null;
@SerializedName("delimiter")
private EnumDelimiter mDelimiter = null;
@SerializedName("encoding")
private String mEncoding = null;
@SerializedName("file_name")
private String mFileName = null;
@SerializedName("id")
private String mId = null;
@SerializedName("item_sub_type")
private String mItemSubType = null;
@SerializedName("latest_upload")
private ProductFeedUpload mLatestUpload = null;
@SerializedName("migrated_from_feed_id")
private String mMigratedFromFeedId = null;
@SerializedName("name")
private String mName = null;
@SerializedName("override_type")
private String mOverrideType = null;
@SerializedName("product_count")
private Long mProductCount = null;
@SerializedName("quoted_fields_mode")
private EnumQuotedFieldsMode mQuotedFieldsMode = null;
@SerializedName("schedule")
private ProductFeedSchedule mSchedule = null;
@SerializedName("update_schedule")
private ProductFeedSchedule mUpdateSchedule = null;
protected static Gson gson = null;
ProductFeed() {
}
public ProductFeed(Long id, APIContext context) {
this(id.toString(), context);
}
public ProductFeed(String id, APIContext context) {
this.mId = id;
this.context = context;
}
public ProductFeed fetch() throws APIException{
ProductFeed newInstance = fetchById(this.getPrefixedId().toString(), this.context);
this.copyFrom(newInstance);
return this;
}
public static ProductFeed fetchById(Long id, APIContext context) throws APIException {
return fetchById(id.toString(), context);
}
public static ListenableFuture fetchByIdAsync(Long id, APIContext context) throws APIException {
return fetchByIdAsync(id.toString(), context);
}
public static ProductFeed fetchById(String id, APIContext context) throws APIException {
return
new APIRequestGet(id, context)
.requestAllFields()
.execute();
}
public static ListenableFuture fetchByIdAsync(String id, APIContext context) throws APIException {
return
new APIRequestGet(id, context)
.requestAllFields()
.executeAsync();
}
public static APINodeList fetchByIds(List ids, List fields, APIContext context) throws APIException {
return (APINodeList)(
new APIRequest(context, "", "/", "GET", ProductFeed.getParser())
.setParam("ids", APIRequest.joinStringList(ids))
.requestFields(fields)
.execute()
);
}
public static ListenableFuture> fetchByIdsAsync(List ids, List fields, APIContext context) throws APIException {
return
new APIRequest(context, "", "/", "GET", ProductFeed.getParser())
.setParam("ids", APIRequest.joinStringList(ids))
.requestFields(fields)
.executeAsyncBase();
}
private String getPrefixedId() {
return getId();
}
public String getId() {
return getFieldId().toString();
}
public static ProductFeed loadJSON(String json, APIContext context, String header) {
ProductFeed productFeed = getGson().fromJson(json, ProductFeed.class);
if (context.isDebug()) {
JsonParser parser = new JsonParser();
JsonElement o1 = parser.parse(json);
JsonElement o2 = parser.parse(productFeed.toString());
if (o1.getAsJsonObject().get("__fb_trace_id__") != null) {
o2.getAsJsonObject().add("__fb_trace_id__", o1.getAsJsonObject().get("__fb_trace_id__"));
}
if (!o1.equals(o2)) {
context.log("[Warning] When parsing response, object is not consistent with JSON:");
context.log("[JSON]" + o1);
context.log("[Object]" + o2);
}
}
productFeed.context = context;
productFeed.rawValue = json;
productFeed.header = header;
return productFeed;
}
public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException {
APINodeList productFeeds = new APINodeList(request, json, header);
JsonArray arr;
JsonObject obj;
JsonParser parser = new JsonParser();
Exception exception = null;
try{
JsonElement result = parser.parse(json);
if (result.isJsonArray()) {
// First, check if it's a pure JSON Array
arr = result.getAsJsonArray();
for (int i = 0; i < arr.size(); i++) {
productFeeds.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
};
return productFeeds;
} else if (result.isJsonObject()) {
obj = result.getAsJsonObject();
if (obj.has("data")) {
if (obj.has("paging")) {
JsonObject paging = obj.get("paging").getAsJsonObject();
if (paging.has("cursors")) {
JsonObject cursors = paging.get("cursors").getAsJsonObject();
String before = cursors.has("before") ? cursors.get("before").getAsString() : null;
String after = cursors.has("after") ? cursors.get("after").getAsString() : null;
productFeeds.setCursors(before, after);
}
String previous = paging.has("previous") ? paging.get("previous").getAsString() : null;
String next = paging.has("next") ? paging.get("next").getAsString() : null;
productFeeds.setPaging(previous, next);
if (context.hasAppSecret()) {
productFeeds.setAppSecret(context.getAppSecretProof());
}
}
if (obj.get("data").isJsonArray()) {
// Second, check if it's a JSON array with "data"
arr = obj.get("data").getAsJsonArray();
for (int i = 0; i < arr.size(); i++) {
productFeeds.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
};
} else if (obj.get("data").isJsonObject()) {
// Third, check if it's a JSON object with "data"
obj = obj.get("data").getAsJsonObject();
boolean isRedownload = false;
for (String s : new String[]{"campaigns", "adsets", "ads"}) {
if (obj.has(s)) {
isRedownload = true;
obj = obj.getAsJsonObject(s);
for (Map.Entry entry : obj.entrySet()) {
productFeeds.add(loadJSON(entry.getValue().toString(), context, header));
}
break;
}
}
if (!isRedownload) {
productFeeds.add(loadJSON(obj.toString(), context, header));
}
}
return productFeeds;
} else if (obj.has("images")) {
// Fourth, check if it's a map of image objects
obj = obj.get("images").getAsJsonObject();
for (Map.Entry entry : obj.entrySet()) {
productFeeds.add(loadJSON(entry.getValue().toString(), context, header));
}
return productFeeds;
} else {
// Fifth, check if it's an array of objects indexed by id
boolean isIdIndexedArray = true;
for (Map.Entry entry : obj.entrySet()) {
String key = (String) entry.getKey();
if (key.equals("__fb_trace_id__")) {
continue;
}
JsonElement value = (JsonElement) entry.getValue();
if (
value != null &&
value.isJsonObject() &&
value.getAsJsonObject().has("id") &&
value.getAsJsonObject().get("id") != null &&
value.getAsJsonObject().get("id").getAsString().equals(key)
) {
productFeeds.add(loadJSON(value.toString(), context, header));
} else {
isIdIndexedArray = false;
break;
}
}
if (isIdIndexedArray) {
return productFeeds;
}
// Sixth, check if it's pure JsonObject
productFeeds.clear();
productFeeds.add(loadJSON(json, context, header));
return productFeeds;
}
}
} catch (Exception e) {
exception = e;
}
throw new MalformedResponseException(
"Invalid response string: " + json,
exception
);
}
@Override
public APIContext getContext() {
return context;
}
@Override
public void setContext(APIContext context) {
this.context = context;
}
@Override
public String toString() {
return getGson().toJson(this);
}
public APIRequestGetAutoMarkets getAutoMarkets() {
return new APIRequestGetAutoMarkets(this.getPrefixedId().toString(), context);
}
public APIRequestGetAutomotiveModels getAutomotiveModels() {
return new APIRequestGetAutomotiveModels(this.getPrefixedId().toString(), context);
}
public APIRequestGetDestinations getDestinations() {
return new APIRequestGetDestinations(this.getPrefixedId().toString(), context);
}
public APIRequestGetFlights getFlights() {
return new APIRequestGetFlights(this.getPrefixedId().toString(), context);
}
public APIRequestGetHomeListings getHomeListings() {
return new APIRequestGetHomeListings(this.getPrefixedId().toString(), context);
}
public APIRequestGetHotels getHotels() {
return new APIRequestGetHotels(this.getPrefixedId().toString(), context);
}
public APIRequestGetMediaTitles getMediaTitles() {
return new APIRequestGetMediaTitles(this.getPrefixedId().toString(), context);
}
public APIRequestGetProducts getProducts() {
return new APIRequestGetProducts(this.getPrefixedId().toString(), context);
}
public APIRequestGetRules getRules() {
return new APIRequestGetRules(this.getPrefixedId().toString(), context);
}
public APIRequestCreateRule createRule() {
return new APIRequestCreateRule(this.getPrefixedId().toString(), context);
}
public APIRequestGetUploadSchedules getUploadSchedules() {
return new APIRequestGetUploadSchedules(this.getPrefixedId().toString(), context);
}
public APIRequestCreateUploadSchedule createUploadSchedule() {
return new APIRequestCreateUploadSchedule(this.getPrefixedId().toString(), context);
}
public APIRequestGetUploads getUploads() {
return new APIRequestGetUploads(this.getPrefixedId().toString(), context);
}
public APIRequestCreateUpload createUpload() {
return new APIRequestCreateUpload(this.getPrefixedId().toString(), context);
}
public APIRequestGetVehicleOffers getVehicleOffers() {
return new APIRequestGetVehicleOffers(this.getPrefixedId().toString(), context);
}
public APIRequestGetVehicles getVehicles() {
return new APIRequestGetVehicles(this.getPrefixedId().toString(), context);
}
public APIRequestDelete delete() {
return new APIRequestDelete(this.getPrefixedId().toString(), context);
}
public APIRequestGet get() {
return new APIRequestGet(this.getPrefixedId().toString(), context);
}
public APIRequestUpdate update() {
return new APIRequestUpdate(this.getPrefixedId().toString(), context);
}
public String getFieldCountry() {
return mCountry;
}
public String getFieldCreatedTime() {
return mCreatedTime;
}
public String getFieldDefaultCurrency() {
return mDefaultCurrency;
}
public Boolean getFieldDeletionEnabled() {
return mDeletionEnabled;
}
public EnumDelimiter getFieldDelimiter() {
return mDelimiter;
}
public String getFieldEncoding() {
return mEncoding;
}
public String getFieldFileName() {
return mFileName;
}
public String getFieldId() {
return mId;
}
public String getFieldItemSubType() {
return mItemSubType;
}
public ProductFeedUpload getFieldLatestUpload() {
if (mLatestUpload != null) {
mLatestUpload.context = getContext();
}
return mLatestUpload;
}
public String getFieldMigratedFromFeedId() {
return mMigratedFromFeedId;
}
public String getFieldName() {
return mName;
}
public String getFieldOverrideType() {
return mOverrideType;
}
public Long getFieldProductCount() {
return mProductCount;
}
public EnumQuotedFieldsMode getFieldQuotedFieldsMode() {
return mQuotedFieldsMode;
}
public ProductFeedSchedule getFieldSchedule() {
if (mSchedule != null) {
mSchedule.context = getContext();
}
return mSchedule;
}
public ProductFeedSchedule getFieldUpdateSchedule() {
if (mUpdateSchedule != null) {
mUpdateSchedule.context = getContext();
}
return mUpdateSchedule;
}
public static class APIRequestGetAutoMarkets extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return APINode.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetAutoMarkets.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetAutoMarkets(String nodeId, APIContext context) {
super(context, nodeId, "/auto_markets", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAutoMarkets setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAutoMarkets setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAutoMarkets requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAutoMarkets requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAutoMarkets requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAutoMarkets requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAutoMarkets requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAutoMarkets requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAutomotiveModels extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"bulk_pagination",
"filter",
};
public static final String[] FIELDS = {
"applinks",
"automotive_model_id",
"availability",
"body_style",
"category_specific_fields",
"currency",
"custom_label_0",
"description",
"drivetrain",
"exterior_color",
"finance_description",
"finance_type",
"fuel_type",
"generation",
"id",
"image_fetch_status",
"images",
"interior_color",
"interior_upholstery",
"make",
"model",
"price",
"sanitized_images",
"title",
"transmission",
"trim",
"unit_price",
"url",
"year",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return AutomotiveModel.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetAutomotiveModels.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetAutomotiveModels(String nodeId, APIContext context) {
super(context, nodeId, "/automotive_models", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAutomotiveModels setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAutomotiveModels setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAutomotiveModels setBulkPagination (Boolean bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetAutomotiveModels setBulkPagination (String bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetAutomotiveModels setFilter (Object filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetAutomotiveModels setFilter (String filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetAutomotiveModels requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAutomotiveModels requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAutomotiveModels requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAutomotiveModels requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAutomotiveModels requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAutomotiveModels requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAutomotiveModels requestApplinksField () {
return this.requestApplinksField(true);
}
public APIRequestGetAutomotiveModels requestApplinksField (boolean value) {
this.requestField("applinks", value);
return this;
}
public APIRequestGetAutomotiveModels requestAutomotiveModelIdField () {
return this.requestAutomotiveModelIdField(true);
}
public APIRequestGetAutomotiveModels requestAutomotiveModelIdField (boolean value) {
this.requestField("automotive_model_id", value);
return this;
}
public APIRequestGetAutomotiveModels requestAvailabilityField () {
return this.requestAvailabilityField(true);
}
public APIRequestGetAutomotiveModels requestAvailabilityField (boolean value) {
this.requestField("availability", value);
return this;
}
public APIRequestGetAutomotiveModels requestBodyStyleField () {
return this.requestBodyStyleField(true);
}
public APIRequestGetAutomotiveModels requestBodyStyleField (boolean value) {
this.requestField("body_style", value);
return this;
}
public APIRequestGetAutomotiveModels requestCategorySpecificFieldsField () {
return this.requestCategorySpecificFieldsField(true);
}
public APIRequestGetAutomotiveModels requestCategorySpecificFieldsField (boolean value) {
this.requestField("category_specific_fields", value);
return this;
}
public APIRequestGetAutomotiveModels requestCurrencyField () {
return this.requestCurrencyField(true);
}
public APIRequestGetAutomotiveModels requestCurrencyField (boolean value) {
this.requestField("currency", value);
return this;
}
public APIRequestGetAutomotiveModels requestCustomLabel0Field () {
return this.requestCustomLabel0Field(true);
}
public APIRequestGetAutomotiveModels requestCustomLabel0Field (boolean value) {
this.requestField("custom_label_0", value);
return this;
}
public APIRequestGetAutomotiveModels requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetAutomotiveModels requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetAutomotiveModels requestDrivetrainField () {
return this.requestDrivetrainField(true);
}
public APIRequestGetAutomotiveModels requestDrivetrainField (boolean value) {
this.requestField("drivetrain", value);
return this;
}
public APIRequestGetAutomotiveModels requestExteriorColorField () {
return this.requestExteriorColorField(true);
}
public APIRequestGetAutomotiveModels requestExteriorColorField (boolean value) {
this.requestField("exterior_color", value);
return this;
}
public APIRequestGetAutomotiveModels requestFinanceDescriptionField () {
return this.requestFinanceDescriptionField(true);
}
public APIRequestGetAutomotiveModels requestFinanceDescriptionField (boolean value) {
this.requestField("finance_description", value);
return this;
}
public APIRequestGetAutomotiveModels requestFinanceTypeField () {
return this.requestFinanceTypeField(true);
}
public APIRequestGetAutomotiveModels requestFinanceTypeField (boolean value) {
this.requestField("finance_type", value);
return this;
}
public APIRequestGetAutomotiveModels requestFuelTypeField () {
return this.requestFuelTypeField(true);
}
public APIRequestGetAutomotiveModels requestFuelTypeField (boolean value) {
this.requestField("fuel_type", value);
return this;
}
public APIRequestGetAutomotiveModels requestGenerationField () {
return this.requestGenerationField(true);
}
public APIRequestGetAutomotiveModels requestGenerationField (boolean value) {
this.requestField("generation", value);
return this;
}
public APIRequestGetAutomotiveModels requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetAutomotiveModels requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetAutomotiveModels requestImageFetchStatusField () {
return this.requestImageFetchStatusField(true);
}
public APIRequestGetAutomotiveModels requestImageFetchStatusField (boolean value) {
this.requestField("image_fetch_status", value);
return this;
}
public APIRequestGetAutomotiveModels requestImagesField () {
return this.requestImagesField(true);
}
public APIRequestGetAutomotiveModels requestImagesField (boolean value) {
this.requestField("images", value);
return this;
}
public APIRequestGetAutomotiveModels requestInteriorColorField () {
return this.requestInteriorColorField(true);
}
public APIRequestGetAutomotiveModels requestInteriorColorField (boolean value) {
this.requestField("interior_color", value);
return this;
}
public APIRequestGetAutomotiveModels requestInteriorUpholsteryField () {
return this.requestInteriorUpholsteryField(true);
}
public APIRequestGetAutomotiveModels requestInteriorUpholsteryField (boolean value) {
this.requestField("interior_upholstery", value);
return this;
}
public APIRequestGetAutomotiveModels requestMakeField () {
return this.requestMakeField(true);
}
public APIRequestGetAutomotiveModels requestMakeField (boolean value) {
this.requestField("make", value);
return this;
}
public APIRequestGetAutomotiveModels requestModelField () {
return this.requestModelField(true);
}
public APIRequestGetAutomotiveModels requestModelField (boolean value) {
this.requestField("model", value);
return this;
}
public APIRequestGetAutomotiveModels requestPriceField () {
return this.requestPriceField(true);
}
public APIRequestGetAutomotiveModels requestPriceField (boolean value) {
this.requestField("price", value);
return this;
}
public APIRequestGetAutomotiveModels requestSanitizedImagesField () {
return this.requestSanitizedImagesField(true);
}
public APIRequestGetAutomotiveModels requestSanitizedImagesField (boolean value) {
this.requestField("sanitized_images", value);
return this;
}
public APIRequestGetAutomotiveModels requestTitleField () {
return this.requestTitleField(true);
}
public APIRequestGetAutomotiveModels requestTitleField (boolean value) {
this.requestField("title", value);
return this;
}
public APIRequestGetAutomotiveModels requestTransmissionField () {
return this.requestTransmissionField(true);
}
public APIRequestGetAutomotiveModels requestTransmissionField (boolean value) {
this.requestField("transmission", value);
return this;
}
public APIRequestGetAutomotiveModels requestTrimField () {
return this.requestTrimField(true);
}
public APIRequestGetAutomotiveModels requestTrimField (boolean value) {
this.requestField("trim", value);
return this;
}
public APIRequestGetAutomotiveModels requestUnitPriceField () {
return this.requestUnitPriceField(true);
}
public APIRequestGetAutomotiveModels requestUnitPriceField (boolean value) {
this.requestField("unit_price", value);
return this;
}
public APIRequestGetAutomotiveModels requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGetAutomotiveModels requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
public APIRequestGetAutomotiveModels requestYearField () {
return this.requestYearField(true);
}
public APIRequestGetAutomotiveModels requestYearField (boolean value) {
this.requestField("year", value);
return this;
}
}
public static class APIRequestGetDestinations extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"bulk_pagination",
"filter",
};
public static final String[] FIELDS = {
"address",
"applinks",
"category_specific_fields",
"currency",
"description",
"destination_id",
"id",
"image_fetch_status",
"images",
"name",
"price",
"price_change",
"sanitized_images",
"types",
"unit_price",
"url",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return Destination.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetDestinations.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetDestinations(String nodeId, APIContext context) {
super(context, nodeId, "/destinations", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetDestinations setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetDestinations setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetDestinations setBulkPagination (Boolean bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetDestinations setBulkPagination (String bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetDestinations setFilter (Object filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetDestinations setFilter (String filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetDestinations requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetDestinations requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetDestinations requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetDestinations requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetDestinations requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetDestinations requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetDestinations requestAddressField () {
return this.requestAddressField(true);
}
public APIRequestGetDestinations requestAddressField (boolean value) {
this.requestField("address", value);
return this;
}
public APIRequestGetDestinations requestApplinksField () {
return this.requestApplinksField(true);
}
public APIRequestGetDestinations requestApplinksField (boolean value) {
this.requestField("applinks", value);
return this;
}
public APIRequestGetDestinations requestCategorySpecificFieldsField () {
return this.requestCategorySpecificFieldsField(true);
}
public APIRequestGetDestinations requestCategorySpecificFieldsField (boolean value) {
this.requestField("category_specific_fields", value);
return this;
}
public APIRequestGetDestinations requestCurrencyField () {
return this.requestCurrencyField(true);
}
public APIRequestGetDestinations requestCurrencyField (boolean value) {
this.requestField("currency", value);
return this;
}
public APIRequestGetDestinations requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetDestinations requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetDestinations requestDestinationIdField () {
return this.requestDestinationIdField(true);
}
public APIRequestGetDestinations requestDestinationIdField (boolean value) {
this.requestField("destination_id", value);
return this;
}
public APIRequestGetDestinations requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetDestinations requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetDestinations requestImageFetchStatusField () {
return this.requestImageFetchStatusField(true);
}
public APIRequestGetDestinations requestImageFetchStatusField (boolean value) {
this.requestField("image_fetch_status", value);
return this;
}
public APIRequestGetDestinations requestImagesField () {
return this.requestImagesField(true);
}
public APIRequestGetDestinations requestImagesField (boolean value) {
this.requestField("images", value);
return this;
}
public APIRequestGetDestinations requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetDestinations requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetDestinations requestPriceField () {
return this.requestPriceField(true);
}
public APIRequestGetDestinations requestPriceField (boolean value) {
this.requestField("price", value);
return this;
}
public APIRequestGetDestinations requestPriceChangeField () {
return this.requestPriceChangeField(true);
}
public APIRequestGetDestinations requestPriceChangeField (boolean value) {
this.requestField("price_change", value);
return this;
}
public APIRequestGetDestinations requestSanitizedImagesField () {
return this.requestSanitizedImagesField(true);
}
public APIRequestGetDestinations requestSanitizedImagesField (boolean value) {
this.requestField("sanitized_images", value);
return this;
}
public APIRequestGetDestinations requestTypesField () {
return this.requestTypesField(true);
}
public APIRequestGetDestinations requestTypesField (boolean value) {
this.requestField("types", value);
return this;
}
public APIRequestGetDestinations requestUnitPriceField () {
return this.requestUnitPriceField(true);
}
public APIRequestGetDestinations requestUnitPriceField (boolean value) {
this.requestField("unit_price", value);
return this;
}
public APIRequestGetDestinations requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGetDestinations requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
}
public static class APIRequestGetFlights extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"bulk_pagination",
"filter",
};
public static final String[] FIELDS = {
"applinks",
"category_specific_fields",
"currency",
"description",
"destination_airport",
"destination_city",
"flight_id",
"id",
"image_fetch_status",
"images",
"oneway_currency",
"oneway_price",
"origin_airport",
"origin_city",
"price",
"sanitized_images",
"unit_price",
"url",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return Flight.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetFlights.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetFlights(String nodeId, APIContext context) {
super(context, nodeId, "/flights", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetFlights setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetFlights setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetFlights setBulkPagination (Boolean bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetFlights setBulkPagination (String bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetFlights setFilter (Object filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetFlights setFilter (String filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetFlights requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetFlights requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetFlights requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetFlights requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetFlights requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetFlights requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetFlights requestApplinksField () {
return this.requestApplinksField(true);
}
public APIRequestGetFlights requestApplinksField (boolean value) {
this.requestField("applinks", value);
return this;
}
public APIRequestGetFlights requestCategorySpecificFieldsField () {
return this.requestCategorySpecificFieldsField(true);
}
public APIRequestGetFlights requestCategorySpecificFieldsField (boolean value) {
this.requestField("category_specific_fields", value);
return this;
}
public APIRequestGetFlights requestCurrencyField () {
return this.requestCurrencyField(true);
}
public APIRequestGetFlights requestCurrencyField (boolean value) {
this.requestField("currency", value);
return this;
}
public APIRequestGetFlights requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetFlights requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetFlights requestDestinationAirportField () {
return this.requestDestinationAirportField(true);
}
public APIRequestGetFlights requestDestinationAirportField (boolean value) {
this.requestField("destination_airport", value);
return this;
}
public APIRequestGetFlights requestDestinationCityField () {
return this.requestDestinationCityField(true);
}
public APIRequestGetFlights requestDestinationCityField (boolean value) {
this.requestField("destination_city", value);
return this;
}
public APIRequestGetFlights requestFlightIdField () {
return this.requestFlightIdField(true);
}
public APIRequestGetFlights requestFlightIdField (boolean value) {
this.requestField("flight_id", value);
return this;
}
public APIRequestGetFlights requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetFlights requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetFlights requestImageFetchStatusField () {
return this.requestImageFetchStatusField(true);
}
public APIRequestGetFlights requestImageFetchStatusField (boolean value) {
this.requestField("image_fetch_status", value);
return this;
}
public APIRequestGetFlights requestImagesField () {
return this.requestImagesField(true);
}
public APIRequestGetFlights requestImagesField (boolean value) {
this.requestField("images", value);
return this;
}
public APIRequestGetFlights requestOnewayCurrencyField () {
return this.requestOnewayCurrencyField(true);
}
public APIRequestGetFlights requestOnewayCurrencyField (boolean value) {
this.requestField("oneway_currency", value);
return this;
}
public APIRequestGetFlights requestOnewayPriceField () {
return this.requestOnewayPriceField(true);
}
public APIRequestGetFlights requestOnewayPriceField (boolean value) {
this.requestField("oneway_price", value);
return this;
}
public APIRequestGetFlights requestOriginAirportField () {
return this.requestOriginAirportField(true);
}
public APIRequestGetFlights requestOriginAirportField (boolean value) {
this.requestField("origin_airport", value);
return this;
}
public APIRequestGetFlights requestOriginCityField () {
return this.requestOriginCityField(true);
}
public APIRequestGetFlights requestOriginCityField (boolean value) {
this.requestField("origin_city", value);
return this;
}
public APIRequestGetFlights requestPriceField () {
return this.requestPriceField(true);
}
public APIRequestGetFlights requestPriceField (boolean value) {
this.requestField("price", value);
return this;
}
public APIRequestGetFlights requestSanitizedImagesField () {
return this.requestSanitizedImagesField(true);
}
public APIRequestGetFlights requestSanitizedImagesField (boolean value) {
this.requestField("sanitized_images", value);
return this;
}
public APIRequestGetFlights requestUnitPriceField () {
return this.requestUnitPriceField(true);
}
public APIRequestGetFlights requestUnitPriceField (boolean value) {
this.requestField("unit_price", value);
return this;
}
public APIRequestGetFlights requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGetFlights requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
}
public static class APIRequestGetHomeListings extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"bulk_pagination",
"filter",
};
public static final String[] FIELDS = {
"ac_type",
"additional_fees_description",
"address",
"agent_company",
"agent_email",
"agent_fb_page_id",
"agent_name",
"agent_phone",
"applinks",
"area_size",
"area_unit",
"availability",
"category_specific_fields",
"co_2_emission_rating_eu",
"currency",
"days_on_market",
"description",
"energy_rating_eu",
"furnish_type",
"group_id",
"heating_type",
"home_listing_id",
"id",
"image_fetch_status",
"images",
"laundry_type",
"listing_type",
"max_currency",
"max_price",
"min_currency",
"min_price",
"name",
"num_baths",
"num_beds",
"num_rooms",
"num_units",
"parking_type",
"partner_verification",
"pet_policy",
"price",
"property_type",
"sanitized_images",
"unit_price",
"url",
"year_built",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return HomeListing.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetHomeListings.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetHomeListings(String nodeId, APIContext context) {
super(context, nodeId, "/home_listings", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetHomeListings setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetHomeListings setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetHomeListings setBulkPagination (Boolean bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetHomeListings setBulkPagination (String bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetHomeListings setFilter (Object filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetHomeListings setFilter (String filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetHomeListings requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetHomeListings requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetHomeListings requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetHomeListings requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetHomeListings requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetHomeListings requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetHomeListings requestAcTypeField () {
return this.requestAcTypeField(true);
}
public APIRequestGetHomeListings requestAcTypeField (boolean value) {
this.requestField("ac_type", value);
return this;
}
public APIRequestGetHomeListings requestAdditionalFeesDescriptionField () {
return this.requestAdditionalFeesDescriptionField(true);
}
public APIRequestGetHomeListings requestAdditionalFeesDescriptionField (boolean value) {
this.requestField("additional_fees_description", value);
return this;
}
public APIRequestGetHomeListings requestAddressField () {
return this.requestAddressField(true);
}
public APIRequestGetHomeListings requestAddressField (boolean value) {
this.requestField("address", value);
return this;
}
public APIRequestGetHomeListings requestAgentCompanyField () {
return this.requestAgentCompanyField(true);
}
public APIRequestGetHomeListings requestAgentCompanyField (boolean value) {
this.requestField("agent_company", value);
return this;
}
public APIRequestGetHomeListings requestAgentEmailField () {
return this.requestAgentEmailField(true);
}
public APIRequestGetHomeListings requestAgentEmailField (boolean value) {
this.requestField("agent_email", value);
return this;
}
public APIRequestGetHomeListings requestAgentFbPageIdField () {
return this.requestAgentFbPageIdField(true);
}
public APIRequestGetHomeListings requestAgentFbPageIdField (boolean value) {
this.requestField("agent_fb_page_id", value);
return this;
}
public APIRequestGetHomeListings requestAgentNameField () {
return this.requestAgentNameField(true);
}
public APIRequestGetHomeListings requestAgentNameField (boolean value) {
this.requestField("agent_name", value);
return this;
}
public APIRequestGetHomeListings requestAgentPhoneField () {
return this.requestAgentPhoneField(true);
}
public APIRequestGetHomeListings requestAgentPhoneField (boolean value) {
this.requestField("agent_phone", value);
return this;
}
public APIRequestGetHomeListings requestApplinksField () {
return this.requestApplinksField(true);
}
public APIRequestGetHomeListings requestApplinksField (boolean value) {
this.requestField("applinks", value);
return this;
}
public APIRequestGetHomeListings requestAreaSizeField () {
return this.requestAreaSizeField(true);
}
public APIRequestGetHomeListings requestAreaSizeField (boolean value) {
this.requestField("area_size", value);
return this;
}
public APIRequestGetHomeListings requestAreaUnitField () {
return this.requestAreaUnitField(true);
}
public APIRequestGetHomeListings requestAreaUnitField (boolean value) {
this.requestField("area_unit", value);
return this;
}
public APIRequestGetHomeListings requestAvailabilityField () {
return this.requestAvailabilityField(true);
}
public APIRequestGetHomeListings requestAvailabilityField (boolean value) {
this.requestField("availability", value);
return this;
}
public APIRequestGetHomeListings requestCategorySpecificFieldsField () {
return this.requestCategorySpecificFieldsField(true);
}
public APIRequestGetHomeListings requestCategorySpecificFieldsField (boolean value) {
this.requestField("category_specific_fields", value);
return this;
}
public APIRequestGetHomeListings requestCo2EmissionRatingEuField () {
return this.requestCo2EmissionRatingEuField(true);
}
public APIRequestGetHomeListings requestCo2EmissionRatingEuField (boolean value) {
this.requestField("co_2_emission_rating_eu", value);
return this;
}
public APIRequestGetHomeListings requestCurrencyField () {
return this.requestCurrencyField(true);
}
public APIRequestGetHomeListings requestCurrencyField (boolean value) {
this.requestField("currency", value);
return this;
}
public APIRequestGetHomeListings requestDaysOnMarketField () {
return this.requestDaysOnMarketField(true);
}
public APIRequestGetHomeListings requestDaysOnMarketField (boolean value) {
this.requestField("days_on_market", value);
return this;
}
public APIRequestGetHomeListings requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetHomeListings requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetHomeListings requestEnergyRatingEuField () {
return this.requestEnergyRatingEuField(true);
}
public APIRequestGetHomeListings requestEnergyRatingEuField (boolean value) {
this.requestField("energy_rating_eu", value);
return this;
}
public APIRequestGetHomeListings requestFurnishTypeField () {
return this.requestFurnishTypeField(true);
}
public APIRequestGetHomeListings requestFurnishTypeField (boolean value) {
this.requestField("furnish_type", value);
return this;
}
public APIRequestGetHomeListings requestGroupIdField () {
return this.requestGroupIdField(true);
}
public APIRequestGetHomeListings requestGroupIdField (boolean value) {
this.requestField("group_id", value);
return this;
}
public APIRequestGetHomeListings requestHeatingTypeField () {
return this.requestHeatingTypeField(true);
}
public APIRequestGetHomeListings requestHeatingTypeField (boolean value) {
this.requestField("heating_type", value);
return this;
}
public APIRequestGetHomeListings requestHomeListingIdField () {
return this.requestHomeListingIdField(true);
}
public APIRequestGetHomeListings requestHomeListingIdField (boolean value) {
this.requestField("home_listing_id", value);
return this;
}
public APIRequestGetHomeListings requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetHomeListings requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetHomeListings requestImageFetchStatusField () {
return this.requestImageFetchStatusField(true);
}
public APIRequestGetHomeListings requestImageFetchStatusField (boolean value) {
this.requestField("image_fetch_status", value);
return this;
}
public APIRequestGetHomeListings requestImagesField () {
return this.requestImagesField(true);
}
public APIRequestGetHomeListings requestImagesField (boolean value) {
this.requestField("images", value);
return this;
}
public APIRequestGetHomeListings requestLaundryTypeField () {
return this.requestLaundryTypeField(true);
}
public APIRequestGetHomeListings requestLaundryTypeField (boolean value) {
this.requestField("laundry_type", value);
return this;
}
public APIRequestGetHomeListings requestListingTypeField () {
return this.requestListingTypeField(true);
}
public APIRequestGetHomeListings requestListingTypeField (boolean value) {
this.requestField("listing_type", value);
return this;
}
public APIRequestGetHomeListings requestMaxCurrencyField () {
return this.requestMaxCurrencyField(true);
}
public APIRequestGetHomeListings requestMaxCurrencyField (boolean value) {
this.requestField("max_currency", value);
return this;
}
public APIRequestGetHomeListings requestMaxPriceField () {
return this.requestMaxPriceField(true);
}
public APIRequestGetHomeListings requestMaxPriceField (boolean value) {
this.requestField("max_price", value);
return this;
}
public APIRequestGetHomeListings requestMinCurrencyField () {
return this.requestMinCurrencyField(true);
}
public APIRequestGetHomeListings requestMinCurrencyField (boolean value) {
this.requestField("min_currency", value);
return this;
}
public APIRequestGetHomeListings requestMinPriceField () {
return this.requestMinPriceField(true);
}
public APIRequestGetHomeListings requestMinPriceField (boolean value) {
this.requestField("min_price", value);
return this;
}
public APIRequestGetHomeListings requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetHomeListings requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetHomeListings requestNumBathsField () {
return this.requestNumBathsField(true);
}
public APIRequestGetHomeListings requestNumBathsField (boolean value) {
this.requestField("num_baths", value);
return this;
}
public APIRequestGetHomeListings requestNumBedsField () {
return this.requestNumBedsField(true);
}
public APIRequestGetHomeListings requestNumBedsField (boolean value) {
this.requestField("num_beds", value);
return this;
}
public APIRequestGetHomeListings requestNumRoomsField () {
return this.requestNumRoomsField(true);
}
public APIRequestGetHomeListings requestNumRoomsField (boolean value) {
this.requestField("num_rooms", value);
return this;
}
public APIRequestGetHomeListings requestNumUnitsField () {
return this.requestNumUnitsField(true);
}
public APIRequestGetHomeListings requestNumUnitsField (boolean value) {
this.requestField("num_units", value);
return this;
}
public APIRequestGetHomeListings requestParkingTypeField () {
return this.requestParkingTypeField(true);
}
public APIRequestGetHomeListings requestParkingTypeField (boolean value) {
this.requestField("parking_type", value);
return this;
}
public APIRequestGetHomeListings requestPartnerVerificationField () {
return this.requestPartnerVerificationField(true);
}
public APIRequestGetHomeListings requestPartnerVerificationField (boolean value) {
this.requestField("partner_verification", value);
return this;
}
public APIRequestGetHomeListings requestPetPolicyField () {
return this.requestPetPolicyField(true);
}
public APIRequestGetHomeListings requestPetPolicyField (boolean value) {
this.requestField("pet_policy", value);
return this;
}
public APIRequestGetHomeListings requestPriceField () {
return this.requestPriceField(true);
}
public APIRequestGetHomeListings requestPriceField (boolean value) {
this.requestField("price", value);
return this;
}
public APIRequestGetHomeListings requestPropertyTypeField () {
return this.requestPropertyTypeField(true);
}
public APIRequestGetHomeListings requestPropertyTypeField (boolean value) {
this.requestField("property_type", value);
return this;
}
public APIRequestGetHomeListings requestSanitizedImagesField () {
return this.requestSanitizedImagesField(true);
}
public APIRequestGetHomeListings requestSanitizedImagesField (boolean value) {
this.requestField("sanitized_images", value);
return this;
}
public APIRequestGetHomeListings requestUnitPriceField () {
return this.requestUnitPriceField(true);
}
public APIRequestGetHomeListings requestUnitPriceField (boolean value) {
this.requestField("unit_price", value);
return this;
}
public APIRequestGetHomeListings requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGetHomeListings requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
public APIRequestGetHomeListings requestYearBuiltField () {
return this.requestYearBuiltField(true);
}
public APIRequestGetHomeListings requestYearBuiltField (boolean value) {
this.requestField("year_built", value);
return this;
}
}
public static class APIRequestGetHotels extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"bulk_pagination",
"filter",
};
public static final String[] FIELDS = {
"address",
"applinks",
"brand",
"category",
"category_specific_fields",
"currency",
"description",
"guest_ratings",
"hotel_id",
"id",
"image_fetch_status",
"images",
"lowest_base_price",
"loyalty_program",
"margin_level",
"name",
"phone",
"sale_price",
"sanitized_images",
"star_rating",
"unit_price",
"url",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return Hotel.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetHotels.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetHotels(String nodeId, APIContext context) {
super(context, nodeId, "/hotels", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetHotels setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetHotels setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetHotels setBulkPagination (Boolean bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetHotels setBulkPagination (String bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetHotels setFilter (Object filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetHotels setFilter (String filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetHotels requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetHotels requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetHotels requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetHotels requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetHotels requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetHotels requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetHotels requestAddressField () {
return this.requestAddressField(true);
}
public APIRequestGetHotels requestAddressField (boolean value) {
this.requestField("address", value);
return this;
}
public APIRequestGetHotels requestApplinksField () {
return this.requestApplinksField(true);
}
public APIRequestGetHotels requestApplinksField (boolean value) {
this.requestField("applinks", value);
return this;
}
public APIRequestGetHotels requestBrandField () {
return this.requestBrandField(true);
}
public APIRequestGetHotels requestBrandField (boolean value) {
this.requestField("brand", value);
return this;
}
public APIRequestGetHotels requestCategoryField () {
return this.requestCategoryField(true);
}
public APIRequestGetHotels requestCategoryField (boolean value) {
this.requestField("category", value);
return this;
}
public APIRequestGetHotels requestCategorySpecificFieldsField () {
return this.requestCategorySpecificFieldsField(true);
}
public APIRequestGetHotels requestCategorySpecificFieldsField (boolean value) {
this.requestField("category_specific_fields", value);
return this;
}
public APIRequestGetHotels requestCurrencyField () {
return this.requestCurrencyField(true);
}
public APIRequestGetHotels requestCurrencyField (boolean value) {
this.requestField("currency", value);
return this;
}
public APIRequestGetHotels requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetHotels requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetHotels requestGuestRatingsField () {
return this.requestGuestRatingsField(true);
}
public APIRequestGetHotels requestGuestRatingsField (boolean value) {
this.requestField("guest_ratings", value);
return this;
}
public APIRequestGetHotels requestHotelIdField () {
return this.requestHotelIdField(true);
}
public APIRequestGetHotels requestHotelIdField (boolean value) {
this.requestField("hotel_id", value);
return this;
}
public APIRequestGetHotels requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetHotels requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetHotels requestImageFetchStatusField () {
return this.requestImageFetchStatusField(true);
}
public APIRequestGetHotels requestImageFetchStatusField (boolean value) {
this.requestField("image_fetch_status", value);
return this;
}
public APIRequestGetHotels requestImagesField () {
return this.requestImagesField(true);
}
public APIRequestGetHotels requestImagesField (boolean value) {
this.requestField("images", value);
return this;
}
public APIRequestGetHotels requestLowestBasePriceField () {
return this.requestLowestBasePriceField(true);
}
public APIRequestGetHotels requestLowestBasePriceField (boolean value) {
this.requestField("lowest_base_price", value);
return this;
}
public APIRequestGetHotels requestLoyaltyProgramField () {
return this.requestLoyaltyProgramField(true);
}
public APIRequestGetHotels requestLoyaltyProgramField (boolean value) {
this.requestField("loyalty_program", value);
return this;
}
public APIRequestGetHotels requestMarginLevelField () {
return this.requestMarginLevelField(true);
}
public APIRequestGetHotels requestMarginLevelField (boolean value) {
this.requestField("margin_level", value);
return this;
}
public APIRequestGetHotels requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetHotels requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetHotels requestPhoneField () {
return this.requestPhoneField(true);
}
public APIRequestGetHotels requestPhoneField (boolean value) {
this.requestField("phone", value);
return this;
}
public APIRequestGetHotels requestSalePriceField () {
return this.requestSalePriceField(true);
}
public APIRequestGetHotels requestSalePriceField (boolean value) {
this.requestField("sale_price", value);
return this;
}
public APIRequestGetHotels requestSanitizedImagesField () {
return this.requestSanitizedImagesField(true);
}
public APIRequestGetHotels requestSanitizedImagesField (boolean value) {
this.requestField("sanitized_images", value);
return this;
}
public APIRequestGetHotels requestStarRatingField () {
return this.requestStarRatingField(true);
}
public APIRequestGetHotels requestStarRatingField (boolean value) {
this.requestField("star_rating", value);
return this;
}
public APIRequestGetHotels requestUnitPriceField () {
return this.requestUnitPriceField(true);
}
public APIRequestGetHotels requestUnitPriceField (boolean value) {
this.requestField("unit_price", value);
return this;
}
public APIRequestGetHotels requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGetHotels requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
}
public static class APIRequestGetMediaTitles extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"bulk_pagination",
"filter",
};
public static final String[] FIELDS = {
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return APINode.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetMediaTitles.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetMediaTitles(String nodeId, APIContext context) {
super(context, nodeId, "/media_titles", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetMediaTitles setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetMediaTitles setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetMediaTitles setBulkPagination (Boolean bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetMediaTitles setBulkPagination (String bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetMediaTitles setFilter (Object filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetMediaTitles setFilter (String filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetMediaTitles requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetMediaTitles requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetMediaTitles requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetMediaTitles requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetMediaTitles requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetMediaTitles requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetProducts extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"bulk_pagination",
"filter",
};
public static final String[] FIELDS = {
"additional_image_cdn_urls",
"additional_image_urls",
"additional_variant_attributes",
"age_group",
"applinks",
"ar_data",
"availability",
"brand",
"capability_to_review_status",
"category",
"category_specific_fields",
"color",
"commerce_insights",
"condition",
"currency",
"custom_data",
"custom_label_0",
"custom_label_1",
"custom_label_2",
"custom_label_3",
"custom_label_4",
"description",
"expiration_date",
"fb_product_category",
"gender",
"gtin",
"id",
"image_cdn_urls",
"image_fetch_status",
"image_url",
"images",
"invalidation_errors",
"inventory",
"manufacturer_part_number",
"marked_for_product_launch",
"material",
"mobile_link",
"name",
"ordering_index",
"parent_product_id",
"pattern",
"price",
"product_catalog",
"product_feed",
"product_group",
"product_type",
"quantity_to_sell_on_facebook",
"retailer_id",
"retailer_product_group_id",
"review_rejection_reasons",
"review_status",
"sale_price",
"sale_price_end_date",
"sale_price_start_date",
"shipping_weight_unit",
"shipping_weight_value",
"short_description",
"size",
"start_date",
"url",
"visibility",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return ProductItem.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetProducts.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetProducts(String nodeId, APIContext context) {
super(context, nodeId, "/products", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetProducts setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetProducts setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetProducts setBulkPagination (Boolean bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetProducts setBulkPagination (String bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetProducts setFilter (Object filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetProducts setFilter (String filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetProducts requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetProducts requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetProducts requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetProducts requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetProducts requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetProducts requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetProducts requestAdditionalImageCdnUrlsField () {
return this.requestAdditionalImageCdnUrlsField(true);
}
public APIRequestGetProducts requestAdditionalImageCdnUrlsField (boolean value) {
this.requestField("additional_image_cdn_urls", value);
return this;
}
public APIRequestGetProducts requestAdditionalImageUrlsField () {
return this.requestAdditionalImageUrlsField(true);
}
public APIRequestGetProducts requestAdditionalImageUrlsField (boolean value) {
this.requestField("additional_image_urls", value);
return this;
}
public APIRequestGetProducts requestAdditionalVariantAttributesField () {
return this.requestAdditionalVariantAttributesField(true);
}
public APIRequestGetProducts requestAdditionalVariantAttributesField (boolean value) {
this.requestField("additional_variant_attributes", value);
return this;
}
public APIRequestGetProducts requestAgeGroupField () {
return this.requestAgeGroupField(true);
}
public APIRequestGetProducts requestAgeGroupField (boolean value) {
this.requestField("age_group", value);
return this;
}
public APIRequestGetProducts requestApplinksField () {
return this.requestApplinksField(true);
}
public APIRequestGetProducts requestApplinksField (boolean value) {
this.requestField("applinks", value);
return this;
}
public APIRequestGetProducts requestArDataField () {
return this.requestArDataField(true);
}
public APIRequestGetProducts requestArDataField (boolean value) {
this.requestField("ar_data", value);
return this;
}
public APIRequestGetProducts requestAvailabilityField () {
return this.requestAvailabilityField(true);
}
public APIRequestGetProducts requestAvailabilityField (boolean value) {
this.requestField("availability", value);
return this;
}
public APIRequestGetProducts requestBrandField () {
return this.requestBrandField(true);
}
public APIRequestGetProducts requestBrandField (boolean value) {
this.requestField("brand", value);
return this;
}
public APIRequestGetProducts requestCapabilityToReviewStatusField () {
return this.requestCapabilityToReviewStatusField(true);
}
public APIRequestGetProducts requestCapabilityToReviewStatusField (boolean value) {
this.requestField("capability_to_review_status", value);
return this;
}
public APIRequestGetProducts requestCategoryField () {
return this.requestCategoryField(true);
}
public APIRequestGetProducts requestCategoryField (boolean value) {
this.requestField("category", value);
return this;
}
public APIRequestGetProducts requestCategorySpecificFieldsField () {
return this.requestCategorySpecificFieldsField(true);
}
public APIRequestGetProducts requestCategorySpecificFieldsField (boolean value) {
this.requestField("category_specific_fields", value);
return this;
}
public APIRequestGetProducts requestColorField () {
return this.requestColorField(true);
}
public APIRequestGetProducts requestColorField (boolean value) {
this.requestField("color", value);
return this;
}
public APIRequestGetProducts requestCommerceInsightsField () {
return this.requestCommerceInsightsField(true);
}
public APIRequestGetProducts requestCommerceInsightsField (boolean value) {
this.requestField("commerce_insights", value);
return this;
}
public APIRequestGetProducts requestConditionField () {
return this.requestConditionField(true);
}
public APIRequestGetProducts requestConditionField (boolean value) {
this.requestField("condition", value);
return this;
}
public APIRequestGetProducts requestCurrencyField () {
return this.requestCurrencyField(true);
}
public APIRequestGetProducts requestCurrencyField (boolean value) {
this.requestField("currency", value);
return this;
}
public APIRequestGetProducts requestCustomDataField () {
return this.requestCustomDataField(true);
}
public APIRequestGetProducts requestCustomDataField (boolean value) {
this.requestField("custom_data", value);
return this;
}
public APIRequestGetProducts requestCustomLabel0Field () {
return this.requestCustomLabel0Field(true);
}
public APIRequestGetProducts requestCustomLabel0Field (boolean value) {
this.requestField("custom_label_0", value);
return this;
}
public APIRequestGetProducts requestCustomLabel1Field () {
return this.requestCustomLabel1Field(true);
}
public APIRequestGetProducts requestCustomLabel1Field (boolean value) {
this.requestField("custom_label_1", value);
return this;
}
public APIRequestGetProducts requestCustomLabel2Field () {
return this.requestCustomLabel2Field(true);
}
public APIRequestGetProducts requestCustomLabel2Field (boolean value) {
this.requestField("custom_label_2", value);
return this;
}
public APIRequestGetProducts requestCustomLabel3Field () {
return this.requestCustomLabel3Field(true);
}
public APIRequestGetProducts requestCustomLabel3Field (boolean value) {
this.requestField("custom_label_3", value);
return this;
}
public APIRequestGetProducts requestCustomLabel4Field () {
return this.requestCustomLabel4Field(true);
}
public APIRequestGetProducts requestCustomLabel4Field (boolean value) {
this.requestField("custom_label_4", value);
return this;
}
public APIRequestGetProducts requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetProducts requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetProducts requestExpirationDateField () {
return this.requestExpirationDateField(true);
}
public APIRequestGetProducts requestExpirationDateField (boolean value) {
this.requestField("expiration_date", value);
return this;
}
public APIRequestGetProducts requestFbProductCategoryField () {
return this.requestFbProductCategoryField(true);
}
public APIRequestGetProducts requestFbProductCategoryField (boolean value) {
this.requestField("fb_product_category", value);
return this;
}
public APIRequestGetProducts requestGenderField () {
return this.requestGenderField(true);
}
public APIRequestGetProducts requestGenderField (boolean value) {
this.requestField("gender", value);
return this;
}
public APIRequestGetProducts requestGtinField () {
return this.requestGtinField(true);
}
public APIRequestGetProducts requestGtinField (boolean value) {
this.requestField("gtin", value);
return this;
}
public APIRequestGetProducts requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetProducts requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetProducts requestImageCdnUrlsField () {
return this.requestImageCdnUrlsField(true);
}
public APIRequestGetProducts requestImageCdnUrlsField (boolean value) {
this.requestField("image_cdn_urls", value);
return this;
}
public APIRequestGetProducts requestImageFetchStatusField () {
return this.requestImageFetchStatusField(true);
}
public APIRequestGetProducts requestImageFetchStatusField (boolean value) {
this.requestField("image_fetch_status", value);
return this;
}
public APIRequestGetProducts requestImageUrlField () {
return this.requestImageUrlField(true);
}
public APIRequestGetProducts requestImageUrlField (boolean value) {
this.requestField("image_url", value);
return this;
}
public APIRequestGetProducts requestImagesField () {
return this.requestImagesField(true);
}
public APIRequestGetProducts requestImagesField (boolean value) {
this.requestField("images", value);
return this;
}
public APIRequestGetProducts requestInvalidationErrorsField () {
return this.requestInvalidationErrorsField(true);
}
public APIRequestGetProducts requestInvalidationErrorsField (boolean value) {
this.requestField("invalidation_errors", value);
return this;
}
public APIRequestGetProducts requestInventoryField () {
return this.requestInventoryField(true);
}
public APIRequestGetProducts requestInventoryField (boolean value) {
this.requestField("inventory", value);
return this;
}
public APIRequestGetProducts requestManufacturerPartNumberField () {
return this.requestManufacturerPartNumberField(true);
}
public APIRequestGetProducts requestManufacturerPartNumberField (boolean value) {
this.requestField("manufacturer_part_number", value);
return this;
}
public APIRequestGetProducts requestMarkedForProductLaunchField () {
return this.requestMarkedForProductLaunchField(true);
}
public APIRequestGetProducts requestMarkedForProductLaunchField (boolean value) {
this.requestField("marked_for_product_launch", value);
return this;
}
public APIRequestGetProducts requestMaterialField () {
return this.requestMaterialField(true);
}
public APIRequestGetProducts requestMaterialField (boolean value) {
this.requestField("material", value);
return this;
}
public APIRequestGetProducts requestMobileLinkField () {
return this.requestMobileLinkField(true);
}
public APIRequestGetProducts requestMobileLinkField (boolean value) {
this.requestField("mobile_link", value);
return this;
}
public APIRequestGetProducts requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetProducts requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetProducts requestOrderingIndexField () {
return this.requestOrderingIndexField(true);
}
public APIRequestGetProducts requestOrderingIndexField (boolean value) {
this.requestField("ordering_index", value);
return this;
}
public APIRequestGetProducts requestParentProductIdField () {
return this.requestParentProductIdField(true);
}
public APIRequestGetProducts requestParentProductIdField (boolean value) {
this.requestField("parent_product_id", value);
return this;
}
public APIRequestGetProducts requestPatternField () {
return this.requestPatternField(true);
}
public APIRequestGetProducts requestPatternField (boolean value) {
this.requestField("pattern", value);
return this;
}
public APIRequestGetProducts requestPriceField () {
return this.requestPriceField(true);
}
public APIRequestGetProducts requestPriceField (boolean value) {
this.requestField("price", value);
return this;
}
public APIRequestGetProducts requestProductCatalogField () {
return this.requestProductCatalogField(true);
}
public APIRequestGetProducts requestProductCatalogField (boolean value) {
this.requestField("product_catalog", value);
return this;
}
public APIRequestGetProducts requestProductFeedField () {
return this.requestProductFeedField(true);
}
public APIRequestGetProducts requestProductFeedField (boolean value) {
this.requestField("product_feed", value);
return this;
}
public APIRequestGetProducts requestProductGroupField () {
return this.requestProductGroupField(true);
}
public APIRequestGetProducts requestProductGroupField (boolean value) {
this.requestField("product_group", value);
return this;
}
public APIRequestGetProducts requestProductTypeField () {
return this.requestProductTypeField(true);
}
public APIRequestGetProducts requestProductTypeField (boolean value) {
this.requestField("product_type", value);
return this;
}
public APIRequestGetProducts requestQuantityToSellOnFacebookField () {
return this.requestQuantityToSellOnFacebookField(true);
}
public APIRequestGetProducts requestQuantityToSellOnFacebookField (boolean value) {
this.requestField("quantity_to_sell_on_facebook", value);
return this;
}
public APIRequestGetProducts requestRetailerIdField () {
return this.requestRetailerIdField(true);
}
public APIRequestGetProducts requestRetailerIdField (boolean value) {
this.requestField("retailer_id", value);
return this;
}
public APIRequestGetProducts requestRetailerProductGroupIdField () {
return this.requestRetailerProductGroupIdField(true);
}
public APIRequestGetProducts requestRetailerProductGroupIdField (boolean value) {
this.requestField("retailer_product_group_id", value);
return this;
}
public APIRequestGetProducts requestReviewRejectionReasonsField () {
return this.requestReviewRejectionReasonsField(true);
}
public APIRequestGetProducts requestReviewRejectionReasonsField (boolean value) {
this.requestField("review_rejection_reasons", value);
return this;
}
public APIRequestGetProducts requestReviewStatusField () {
return this.requestReviewStatusField(true);
}
public APIRequestGetProducts requestReviewStatusField (boolean value) {
this.requestField("review_status", value);
return this;
}
public APIRequestGetProducts requestSalePriceField () {
return this.requestSalePriceField(true);
}
public APIRequestGetProducts requestSalePriceField (boolean value) {
this.requestField("sale_price", value);
return this;
}
public APIRequestGetProducts requestSalePriceEndDateField () {
return this.requestSalePriceEndDateField(true);
}
public APIRequestGetProducts requestSalePriceEndDateField (boolean value) {
this.requestField("sale_price_end_date", value);
return this;
}
public APIRequestGetProducts requestSalePriceStartDateField () {
return this.requestSalePriceStartDateField(true);
}
public APIRequestGetProducts requestSalePriceStartDateField (boolean value) {
this.requestField("sale_price_start_date", value);
return this;
}
public APIRequestGetProducts requestShippingWeightUnitField () {
return this.requestShippingWeightUnitField(true);
}
public APIRequestGetProducts requestShippingWeightUnitField (boolean value) {
this.requestField("shipping_weight_unit", value);
return this;
}
public APIRequestGetProducts requestShippingWeightValueField () {
return this.requestShippingWeightValueField(true);
}
public APIRequestGetProducts requestShippingWeightValueField (boolean value) {
this.requestField("shipping_weight_value", value);
return this;
}
public APIRequestGetProducts requestShortDescriptionField () {
return this.requestShortDescriptionField(true);
}
public APIRequestGetProducts requestShortDescriptionField (boolean value) {
this.requestField("short_description", value);
return this;
}
public APIRequestGetProducts requestSizeField () {
return this.requestSizeField(true);
}
public APIRequestGetProducts requestSizeField (boolean value) {
this.requestField("size", value);
return this;
}
public APIRequestGetProducts requestStartDateField () {
return this.requestStartDateField(true);
}
public APIRequestGetProducts requestStartDateField (boolean value) {
this.requestField("start_date", value);
return this;
}
public APIRequestGetProducts requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGetProducts requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
public APIRequestGetProducts requestVisibilityField () {
return this.requestVisibilityField(true);
}
public APIRequestGetProducts requestVisibilityField (boolean value) {
this.requestField("visibility", value);
return this;
}
}
public static class APIRequestGetRules extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"attribute",
"id",
"params",
"rule_type",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return ProductFeedRule.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetRules.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetRules(String nodeId, APIContext context) {
super(context, nodeId, "/rules", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetRules setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetRules setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetRules requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetRules requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetRules requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetRules requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetRules requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetRules requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetRules requestAttributeField () {
return this.requestAttributeField(true);
}
public APIRequestGetRules requestAttributeField (boolean value) {
this.requestField("attribute", value);
return this;
}
public APIRequestGetRules requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetRules requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetRules requestParamsField () {
return this.requestParamsField(true);
}
public APIRequestGetRules requestParamsField (boolean value) {
this.requestField("params", value);
return this;
}
public APIRequestGetRules requestRuleTypeField () {
return this.requestRuleTypeField(true);
}
public APIRequestGetRules requestRuleTypeField (boolean value) {
this.requestField("rule_type", value);
return this;
}
}
public static class APIRequestCreateRule extends APIRequest {
ProductFeedRule lastResponse = null;
@Override
public ProductFeedRule getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"attribute",
"params",
"rule_type",
};
public static final String[] FIELDS = {
};
@Override
public ProductFeedRule parseResponse(String response, String header) throws APIException {
return ProductFeedRule.parseResponse(response, getContext(), this, header).head();
}
@Override
public ProductFeedRule execute() throws APIException {
return execute(new HashMap());
}
@Override
public ProductFeedRule execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function() {
public ProductFeedRule apply(ResponseWrapper result) {
try {
return APIRequestCreateRule.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestCreateRule(String nodeId, APIContext context) {
super(context, nodeId, "/rules", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateRule setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateRule setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateRule setAttribute (String attribute) {
this.setParam("attribute", attribute);
return this;
}
public APIRequestCreateRule setparamParams (Map params) {
this.setParam("params", params);
return this;
}
public APIRequestCreateRule setParams (String params) {
this.setParam("params", params);
return this;
}
public APIRequestCreateRule setRuleType (ProductFeedRule.EnumRuleType ruleType) {
this.setParam("rule_type", ruleType);
return this;
}
public APIRequestCreateRule setRuleType (String ruleType) {
this.setParam("rule_type", ruleType);
return this;
}
public APIRequestCreateRule requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateRule requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateRule requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateRule requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateRule requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateRule requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetUploadSchedules extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"day_of_month",
"day_of_week",
"hour",
"id",
"interval",
"interval_count",
"minute",
"timezone",
"url",
"username",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return ProductFeedSchedule.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetUploadSchedules.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetUploadSchedules(String nodeId, APIContext context) {
super(context, nodeId, "/upload_schedules", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetUploadSchedules setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetUploadSchedules setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetUploadSchedules requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetUploadSchedules requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetUploadSchedules requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetUploadSchedules requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetUploadSchedules requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetUploadSchedules requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetUploadSchedules requestDayOfMonthField () {
return this.requestDayOfMonthField(true);
}
public APIRequestGetUploadSchedules requestDayOfMonthField (boolean value) {
this.requestField("day_of_month", value);
return this;
}
public APIRequestGetUploadSchedules requestDayOfWeekField () {
return this.requestDayOfWeekField(true);
}
public APIRequestGetUploadSchedules requestDayOfWeekField (boolean value) {
this.requestField("day_of_week", value);
return this;
}
public APIRequestGetUploadSchedules requestHourField () {
return this.requestHourField(true);
}
public APIRequestGetUploadSchedules requestHourField (boolean value) {
this.requestField("hour", value);
return this;
}
public APIRequestGetUploadSchedules requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetUploadSchedules requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetUploadSchedules requestIntervalField () {
return this.requestIntervalField(true);
}
public APIRequestGetUploadSchedules requestIntervalField (boolean value) {
this.requestField("interval", value);
return this;
}
public APIRequestGetUploadSchedules requestIntervalCountField () {
return this.requestIntervalCountField(true);
}
public APIRequestGetUploadSchedules requestIntervalCountField (boolean value) {
this.requestField("interval_count", value);
return this;
}
public APIRequestGetUploadSchedules requestMinuteField () {
return this.requestMinuteField(true);
}
public APIRequestGetUploadSchedules requestMinuteField (boolean value) {
this.requestField("minute", value);
return this;
}
public APIRequestGetUploadSchedules requestTimezoneField () {
return this.requestTimezoneField(true);
}
public APIRequestGetUploadSchedules requestTimezoneField (boolean value) {
this.requestField("timezone", value);
return this;
}
public APIRequestGetUploadSchedules requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGetUploadSchedules requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
public APIRequestGetUploadSchedules requestUsernameField () {
return this.requestUsernameField(true);
}
public APIRequestGetUploadSchedules requestUsernameField (boolean value) {
this.requestField("username", value);
return this;
}
}
public static class APIRequestCreateUploadSchedule extends APIRequest {
ProductFeed lastResponse = null;
@Override
public ProductFeed getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"upload_schedule",
};
public static final String[] FIELDS = {
};
@Override
public ProductFeed parseResponse(String response, String header) throws APIException {
return ProductFeed.parseResponse(response, getContext(), this, header).head();
}
@Override
public ProductFeed execute() throws APIException {
return execute(new HashMap());
}
@Override
public ProductFeed execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function() {
public ProductFeed apply(ResponseWrapper result) {
try {
return APIRequestCreateUploadSchedule.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestCreateUploadSchedule(String nodeId, APIContext context) {
super(context, nodeId, "/upload_schedules", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateUploadSchedule setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateUploadSchedule setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateUploadSchedule setUploadSchedule (String uploadSchedule) {
this.setParam("upload_schedule", uploadSchedule);
return this;
}
public APIRequestCreateUploadSchedule requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateUploadSchedule requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateUploadSchedule requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateUploadSchedule requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateUploadSchedule requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateUploadSchedule requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetUploads extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"end_time",
"error_count",
"error_report",
"filename",
"id",
"input_method",
"num_deleted_items",
"num_detected_items",
"num_invalid_items",
"num_persisted_items",
"start_time",
"url",
"warning_count",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return ProductFeedUpload.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetUploads.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetUploads(String nodeId, APIContext context) {
super(context, nodeId, "/uploads", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetUploads setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetUploads setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetUploads requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetUploads requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetUploads requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetUploads requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetUploads requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetUploads requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetUploads requestEndTimeField () {
return this.requestEndTimeField(true);
}
public APIRequestGetUploads requestEndTimeField (boolean value) {
this.requestField("end_time", value);
return this;
}
public APIRequestGetUploads requestErrorCountField () {
return this.requestErrorCountField(true);
}
public APIRequestGetUploads requestErrorCountField (boolean value) {
this.requestField("error_count", value);
return this;
}
public APIRequestGetUploads requestErrorReportField () {
return this.requestErrorReportField(true);
}
public APIRequestGetUploads requestErrorReportField (boolean value) {
this.requestField("error_report", value);
return this;
}
public APIRequestGetUploads requestFilenameField () {
return this.requestFilenameField(true);
}
public APIRequestGetUploads requestFilenameField (boolean value) {
this.requestField("filename", value);
return this;
}
public APIRequestGetUploads requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetUploads requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetUploads requestInputMethodField () {
return this.requestInputMethodField(true);
}
public APIRequestGetUploads requestInputMethodField (boolean value) {
this.requestField("input_method", value);
return this;
}
public APIRequestGetUploads requestNumDeletedItemsField () {
return this.requestNumDeletedItemsField(true);
}
public APIRequestGetUploads requestNumDeletedItemsField (boolean value) {
this.requestField("num_deleted_items", value);
return this;
}
public APIRequestGetUploads requestNumDetectedItemsField () {
return this.requestNumDetectedItemsField(true);
}
public APIRequestGetUploads requestNumDetectedItemsField (boolean value) {
this.requestField("num_detected_items", value);
return this;
}
public APIRequestGetUploads requestNumInvalidItemsField () {
return this.requestNumInvalidItemsField(true);
}
public APIRequestGetUploads requestNumInvalidItemsField (boolean value) {
this.requestField("num_invalid_items", value);
return this;
}
public APIRequestGetUploads requestNumPersistedItemsField () {
return this.requestNumPersistedItemsField(true);
}
public APIRequestGetUploads requestNumPersistedItemsField (boolean value) {
this.requestField("num_persisted_items", value);
return this;
}
public APIRequestGetUploads requestStartTimeField () {
return this.requestStartTimeField(true);
}
public APIRequestGetUploads requestStartTimeField (boolean value) {
this.requestField("start_time", value);
return this;
}
public APIRequestGetUploads requestUrlField () {
return this.requestUrlField(true);
}
public APIRequestGetUploads requestUrlField (boolean value) {
this.requestField("url", value);
return this;
}
public APIRequestGetUploads requestWarningCountField () {
return this.requestWarningCountField(true);
}
public APIRequestGetUploads requestWarningCountField (boolean value) {
this.requestField("warning_count", value);
return this;
}
}
public static class APIRequestCreateUpload extends APIRequest {
ProductFeedUpload lastResponse = null;
@Override
public ProductFeedUpload getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"fbe_external_business_id",
"password",
"update_only",
"url",
"username",
"file",
};
public static final String[] FIELDS = {
};
@Override
public ProductFeedUpload parseResponse(String response, String header) throws APIException {
return ProductFeedUpload.parseResponse(response, getContext(), this, header).head();
}
@Override
public ProductFeedUpload execute() throws APIException {
return execute(new HashMap());
}
@Override
public ProductFeedUpload execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}
public ListenableFuture executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function() {
public ProductFeedUpload apply(ResponseWrapper result) {
try {
return APIRequestCreateUpload.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestCreateUpload(String nodeId, APIContext context) {
super(context, nodeId, "/uploads", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateUpload setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateUpload setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateUpload addUploadFile (String uploadName, File file) {
this.setParam(uploadName, file);
return this;
}
public APIRequestCreateUpload setUseVideoEndpoint(boolean useVideoEndpoint) {
this.useVideoEndpoint = useVideoEndpoint;
return this;
}
public APIRequestCreateUpload setFbeExternalBusinessId (String fbeExternalBusinessId) {
this.setParam("fbe_external_business_id", fbeExternalBusinessId);
return this;
}
public APIRequestCreateUpload setPassword (String password) {
this.setParam("password", password);
return this;
}
public APIRequestCreateUpload setUpdateOnly (Boolean updateOnly) {
this.setParam("update_only", updateOnly);
return this;
}
public APIRequestCreateUpload setUpdateOnly (String updateOnly) {
this.setParam("update_only", updateOnly);
return this;
}
public APIRequestCreateUpload setUrl (String url) {
this.setParam("url", url);
return this;
}
public APIRequestCreateUpload setUsername (String username) {
this.setParam("username", username);
return this;
}
public APIRequestCreateUpload requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateUpload requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateUpload requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateUpload requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateUpload requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateUpload requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetVehicleOffers extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"bulk_pagination",
"filter",
};
public static final String[] FIELDS = {
"amount_currency",
"amount_percentage",
"amount_price",
"amount_qualifier",
"applinks",
"body_style",
"cashback_currency",
"cashback_price",
"category_specific_fields",
"currency",
"dma_codes",
"downpayment_currency",
"downpayment_price",
"downpayment_qualifier",
"end_date",
"end_time",
"id",
"image_fetch_status",
"images",
"make",
"model",
"offer_description",
"offer_disclaimer",
"offer_type",
"price",
"sanitized_images",
"start_date",
"start_time",
"term_length",
"term_qualifier",
"title",
"trim",
"unit_price",
"url",
"vehicle_offer_id",
"year",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return VehicleOffer.parseResponse(response, getContext(), this, header);
}
@Override
public APINodeList execute() throws APIException {
return execute(new HashMap());
}
@Override
public APINodeList execute(Map extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
return lastResponse;
}
public ListenableFuture> executeAsync() throws APIException {
return executeAsync(new HashMap());
};
public ListenableFuture> executeAsync(Map extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function>() {
public APINodeList apply(ResponseWrapper result) {
try {
return APIRequestGetVehicleOffers.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};
public APIRequestGetVehicleOffers(String nodeId, APIContext context) {
super(context, nodeId, "/vehicle_offers", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetVehicleOffers setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetVehicleOffers setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetVehicleOffers setBulkPagination (Boolean bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetVehicleOffers setBulkPagination (String bulkPagination) {
this.setParam("bulk_pagination", bulkPagination);
return this;
}
public APIRequestGetVehicleOffers setFilter (Object filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetVehicleOffers setFilter (String filter) {
this.setParam("filter", filter);
return this;
}
public APIRequestGetVehicleOffers requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetVehicleOffers requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetVehicleOffers requestFields (List