com.facebook.ads.sdk.Group Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of facebook-java-business-sdk Show documentation
Show all versions of facebook-java-business-sdk Show documentation
Facebook Business Solutions SDK for Java
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
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.MoreExecutors;
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 Group extends APINode {
@SerializedName("archived")
private Boolean mArchived = null;
@SerializedName("cover")
private CoverPhoto mCover = null;
@SerializedName("created_time")
private String mCreatedTime = null;
@SerializedName("description")
private String mDescription = null;
@SerializedName("email")
private String mEmail = null;
@SerializedName("icon")
private String mIcon = null;
@SerializedName("id")
private String mId = null;
@SerializedName("install")
private Object mInstall = null;
@SerializedName("link")
private String mLink = null;
@SerializedName("member_count")
private Long mMemberCount = null;
@SerializedName("member_request_count")
private Long mMemberRequestCount = null;
@SerializedName("name")
private String mName = null;
@SerializedName("parent")
private Object mParent = null;
@SerializedName("permissions")
private List mPermissions = null;
@SerializedName("privacy")
private String mPrivacy = null;
@SerializedName("purpose")
private String mPurpose = null;
@SerializedName("subdomain")
private String mSubdomain = null;
@SerializedName("updated_time")
private String mUpdatedTime = null;
@SerializedName("venue")
private Location mVenue = null;
protected static Gson gson = null;
Group() {
}
public Group(Long id, APIContext context) {
this(id.toString(), context);
}
public Group(String id, APIContext context) {
this.mId = id;
this.context = context;
}
public Group fetch() throws APIException{
Group newInstance = fetchById(this.getPrefixedId().toString(), this.context);
this.copyFrom(newInstance);
return this;
}
public static Group 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 Group 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", Group.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", Group.getParser())
.setParam("ids", APIRequest.joinStringList(ids))
.requestFields(fields)
.executeAsyncBase();
}
private String getPrefixedId() {
return getId();
}
public String getId() {
return getFieldId().toString();
}
public static Group loadJSON(String json, APIContext context, String header) {
Group group = getGson().fromJson(json, Group.class);
if (context.isDebug()) {
JsonParser parser = new JsonParser();
JsonElement o1 = parser.parse(json);
JsonElement o2 = parser.parse(group.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);
}
}
group.context = context;
group.rawValue = json;
group.header = header;
return group;
}
public static APINodeList parseResponse(String json, APIContext context, APIRequest request, String header) throws MalformedResponseException {
APINodeList groups = 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++) {
groups.add(loadJSON(arr.get(i).getAsJsonObject().toString(), context, header));
};
return groups;
} 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;
groups.setCursors(before, after);
}
String previous = paging.has("previous") ? paging.get("previous").getAsString() : null;
String next = paging.has("next") ? paging.get("next").getAsString() : null;
groups.setPaging(previous, next);
if (context.hasAppSecret()) {
groups.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++) {
groups.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()) {
groups.add(loadJSON(entry.getValue().toString(), context, header));
}
break;
}
}
if (!isRedownload) {
groups.add(loadJSON(obj.toString(), context, header));
}
}
return groups;
} 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()) {
groups.add(loadJSON(entry.getValue().toString(), context, header));
}
return groups;
} 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)
) {
groups.add(loadJSON(value.toString(), context, header));
} else {
isIdIndexedArray = false;
break;
}
}
if (isIdIndexedArray) {
return groups;
}
// Sixth, check if it's pure JsonObject
groups.clear();
groups.add(loadJSON(json, context, header));
return groups;
}
}
} 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 APIRequestDeleteAdmins deleteAdmins() {
return new APIRequestDeleteAdmins(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAdmin createAdmin() {
return new APIRequestCreateAdmin(this.getPrefixedId().toString(), context);
}
public APIRequestGetAlbums getAlbums() {
return new APIRequestGetAlbums(this.getPrefixedId().toString(), context);
}
public APIRequestCreateAlbum createAlbum() {
return new APIRequestCreateAlbum(this.getPrefixedId().toString(), context);
}
public APIRequestGetDocs getDocs() {
return new APIRequestGetDocs(this.getPrefixedId().toString(), context);
}
public APIRequestGetEvents getEvents() {
return new APIRequestGetEvents(this.getPrefixedId().toString(), context);
}
public APIRequestGetFeed getFeed() {
return new APIRequestGetFeed(this.getPrefixedId().toString(), context);
}
public APIRequestCreateFeed createFeed() {
return new APIRequestCreateFeed(this.getPrefixedId().toString(), context);
}
public APIRequestGetFiles getFiles() {
return new APIRequestGetFiles(this.getPrefixedId().toString(), context);
}
public APIRequestGetGroups getGroups() {
return new APIRequestGetGroups(this.getPrefixedId().toString(), context);
}
public APIRequestCreateGroup createGroup() {
return new APIRequestCreateGroup(this.getPrefixedId().toString(), context);
}
public APIRequestGetLiveVideos getLiveVideos() {
return new APIRequestGetLiveVideos(this.getPrefixedId().toString(), context);
}
public APIRequestCreateLiveVideo createLiveVideo() {
return new APIRequestCreateLiveVideo(this.getPrefixedId().toString(), context);
}
public APIRequestDeleteMembers deleteMembers() {
return new APIRequestDeleteMembers(this.getPrefixedId().toString(), context);
}
public APIRequestCreateMember createMember() {
return new APIRequestCreateMember(this.getPrefixedId().toString(), context);
}
public APIRequestGetOptedInMembers getOptedInMembers() {
return new APIRequestGetOptedInMembers(this.getPrefixedId().toString(), context);
}
public APIRequestCreatePhoto createPhoto() {
return new APIRequestCreatePhoto(this.getPrefixedId().toString(), context);
}
public APIRequestGetPicture getPicture() {
return new APIRequestGetPicture(this.getPrefixedId().toString(), context);
}
public APIRequestGetVideos getVideos() {
return new APIRequestGetVideos(this.getPrefixedId().toString(), context);
}
public APIRequestCreateVideo createVideo() {
return new APIRequestCreateVideo(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 Boolean getFieldArchived() {
return mArchived;
}
public CoverPhoto getFieldCover() {
return mCover;
}
public String getFieldCreatedTime() {
return mCreatedTime;
}
public String getFieldDescription() {
return mDescription;
}
public String getFieldEmail() {
return mEmail;
}
public String getFieldIcon() {
return mIcon;
}
public String getFieldId() {
return mId;
}
public Object getFieldInstall() {
return mInstall;
}
public String getFieldLink() {
return mLink;
}
public Long getFieldMemberCount() {
return mMemberCount;
}
public Long getFieldMemberRequestCount() {
return mMemberRequestCount;
}
public String getFieldName() {
return mName;
}
public Object getFieldParent() {
return mParent;
}
public List getFieldPermissions() {
return mPermissions;
}
public String getFieldPrivacy() {
return mPrivacy;
}
public String getFieldPurpose() {
return mPurpose;
}
public String getFieldSubdomain() {
return mSubdomain;
}
public String getFieldUpdatedTime() {
return mUpdatedTime;
}
public Location getFieldVenue() {
return mVenue;
}
public static class APIRequestDeleteAdmins extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"uid",
};
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 APIRequestDeleteAdmins.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestDeleteAdmins(String nodeId, APIContext context) {
super(context, nodeId, "/admins", "DELETE", Arrays.asList(PARAMS));
}
@Override
public APIRequestDeleteAdmins setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestDeleteAdmins setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestDeleteAdmins setUid (Long uid) {
this.setParam("uid", uid);
return this;
}
public APIRequestDeleteAdmins setUid (String uid) {
this.setParam("uid", uid);
return this;
}
public APIRequestDeleteAdmins requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestDeleteAdmins requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestDeleteAdmins requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestDeleteAdmins requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestDeleteAdmins requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestDeleteAdmins requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestCreateAdmin extends APIRequest {
Group lastResponse = null;
@Override
public Group getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"uid",
};
public static final String[] FIELDS = {
};
@Override
public Group parseResponse(String response, String header) throws APIException {
return Group.parseResponse(response, getContext(), this, header).head();
}
@Override
public Group execute() throws APIException {
return execute(new HashMap());
}
@Override
public Group 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 Group apply(ResponseWrapper result) {
try {
return APIRequestCreateAdmin.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAdmin(String nodeId, APIContext context) {
super(context, nodeId, "/admins", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAdmin setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAdmin setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAdmin setUid (Long uid) {
this.setParam("uid", uid);
return this;
}
public APIRequestCreateAdmin setUid (String uid) {
this.setParam("uid", uid);
return this;
}
public APIRequestCreateAdmin requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAdmin requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdmin requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAdmin requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAdmin requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAdmin requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetAlbums extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"backdated_time",
"backdated_time_granularity",
"can_backdate",
"can_upload",
"count",
"cover_photo",
"created_time",
"description",
"edit_link",
"event",
"from",
"id",
"is_user_facing",
"link",
"location",
"modified_major",
"name",
"photo_count",
"place",
"privacy",
"type",
"updated_time",
"video_count",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return Album.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 APIRequestGetAlbums.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetAlbums(String nodeId, APIContext context) {
super(context, nodeId, "/albums", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetAlbums setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetAlbums setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetAlbums requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetAlbums requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAlbums requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetAlbums requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetAlbums requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetAlbums requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetAlbums requestBackdatedTimeField () {
return this.requestBackdatedTimeField(true);
}
public APIRequestGetAlbums requestBackdatedTimeField (boolean value) {
this.requestField("backdated_time", value);
return this;
}
public APIRequestGetAlbums requestBackdatedTimeGranularityField () {
return this.requestBackdatedTimeGranularityField(true);
}
public APIRequestGetAlbums requestBackdatedTimeGranularityField (boolean value) {
this.requestField("backdated_time_granularity", value);
return this;
}
public APIRequestGetAlbums requestCanBackdateField () {
return this.requestCanBackdateField(true);
}
public APIRequestGetAlbums requestCanBackdateField (boolean value) {
this.requestField("can_backdate", value);
return this;
}
public APIRequestGetAlbums requestCanUploadField () {
return this.requestCanUploadField(true);
}
public APIRequestGetAlbums requestCanUploadField (boolean value) {
this.requestField("can_upload", value);
return this;
}
public APIRequestGetAlbums requestCountField () {
return this.requestCountField(true);
}
public APIRequestGetAlbums requestCountField (boolean value) {
this.requestField("count", value);
return this;
}
public APIRequestGetAlbums requestCoverPhotoField () {
return this.requestCoverPhotoField(true);
}
public APIRequestGetAlbums requestCoverPhotoField (boolean value) {
this.requestField("cover_photo", value);
return this;
}
public APIRequestGetAlbums requestCreatedTimeField () {
return this.requestCreatedTimeField(true);
}
public APIRequestGetAlbums requestCreatedTimeField (boolean value) {
this.requestField("created_time", value);
return this;
}
public APIRequestGetAlbums requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetAlbums requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetAlbums requestEditLinkField () {
return this.requestEditLinkField(true);
}
public APIRequestGetAlbums requestEditLinkField (boolean value) {
this.requestField("edit_link", value);
return this;
}
public APIRequestGetAlbums requestEventField () {
return this.requestEventField(true);
}
public APIRequestGetAlbums requestEventField (boolean value) {
this.requestField("event", value);
return this;
}
public APIRequestGetAlbums requestFromField () {
return this.requestFromField(true);
}
public APIRequestGetAlbums requestFromField (boolean value) {
this.requestField("from", value);
return this;
}
public APIRequestGetAlbums requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetAlbums requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetAlbums requestIsUserFacingField () {
return this.requestIsUserFacingField(true);
}
public APIRequestGetAlbums requestIsUserFacingField (boolean value) {
this.requestField("is_user_facing", value);
return this;
}
public APIRequestGetAlbums requestLinkField () {
return this.requestLinkField(true);
}
public APIRequestGetAlbums requestLinkField (boolean value) {
this.requestField("link", value);
return this;
}
public APIRequestGetAlbums requestLocationField () {
return this.requestLocationField(true);
}
public APIRequestGetAlbums requestLocationField (boolean value) {
this.requestField("location", value);
return this;
}
public APIRequestGetAlbums requestModifiedMajorField () {
return this.requestModifiedMajorField(true);
}
public APIRequestGetAlbums requestModifiedMajorField (boolean value) {
this.requestField("modified_major", value);
return this;
}
public APIRequestGetAlbums requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetAlbums requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetAlbums requestPhotoCountField () {
return this.requestPhotoCountField(true);
}
public APIRequestGetAlbums requestPhotoCountField (boolean value) {
this.requestField("photo_count", value);
return this;
}
public APIRequestGetAlbums requestPlaceField () {
return this.requestPlaceField(true);
}
public APIRequestGetAlbums requestPlaceField (boolean value) {
this.requestField("place", value);
return this;
}
public APIRequestGetAlbums requestPrivacyField () {
return this.requestPrivacyField(true);
}
public APIRequestGetAlbums requestPrivacyField (boolean value) {
this.requestField("privacy", value);
return this;
}
public APIRequestGetAlbums requestTypeField () {
return this.requestTypeField(true);
}
public APIRequestGetAlbums requestTypeField (boolean value) {
this.requestField("type", value);
return this;
}
public APIRequestGetAlbums requestUpdatedTimeField () {
return this.requestUpdatedTimeField(true);
}
public APIRequestGetAlbums requestUpdatedTimeField (boolean value) {
this.requestField("updated_time", value);
return this;
}
public APIRequestGetAlbums requestVideoCountField () {
return this.requestVideoCountField(true);
}
public APIRequestGetAlbums requestVideoCountField (boolean value) {
this.requestField("video_count", value);
return this;
}
}
public static class APIRequestCreateAlbum extends APIRequest {
Album lastResponse = null;
@Override
public Album getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"contributors",
"description",
"is_default",
"location",
"make_shared_album",
"message",
"name",
"place",
"privacy",
"session_id",
"tags",
"visible",
};
public static final String[] FIELDS = {
};
@Override
public Album parseResponse(String response, String header) throws APIException {
return Album.parseResponse(response, getContext(), this, header).head();
}
@Override
public Album execute() throws APIException {
return execute(new HashMap());
}
@Override
public Album 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 Album apply(ResponseWrapper result) {
try {
return APIRequestCreateAlbum.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateAlbum(String nodeId, APIContext context) {
super(context, nodeId, "/albums", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateAlbum setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateAlbum setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateAlbum setContributors (List contributors) {
this.setParam("contributors", contributors);
return this;
}
public APIRequestCreateAlbum setContributors (String contributors) {
this.setParam("contributors", contributors);
return this;
}
public APIRequestCreateAlbum setDescription (String description) {
this.setParam("description", description);
return this;
}
public APIRequestCreateAlbum setIsDefault (Boolean isDefault) {
this.setParam("is_default", isDefault);
return this;
}
public APIRequestCreateAlbum setIsDefault (String isDefault) {
this.setParam("is_default", isDefault);
return this;
}
public APIRequestCreateAlbum setLocation (String location) {
this.setParam("location", location);
return this;
}
public APIRequestCreateAlbum setMakeSharedAlbum (Boolean makeSharedAlbum) {
this.setParam("make_shared_album", makeSharedAlbum);
return this;
}
public APIRequestCreateAlbum setMakeSharedAlbum (String makeSharedAlbum) {
this.setParam("make_shared_album", makeSharedAlbum);
return this;
}
public APIRequestCreateAlbum setMessage (String message) {
this.setParam("message", message);
return this;
}
public APIRequestCreateAlbum setName (String name) {
this.setParam("name", name);
return this;
}
public APIRequestCreateAlbum setPlace (Object place) {
this.setParam("place", place);
return this;
}
public APIRequestCreateAlbum setPlace (String place) {
this.setParam("place", place);
return this;
}
public APIRequestCreateAlbum setPrivacy (String privacy) {
this.setParam("privacy", privacy);
return this;
}
public APIRequestCreateAlbum setSessionId (String sessionId) {
this.setParam("session_id", sessionId);
return this;
}
public APIRequestCreateAlbum setTags (List tags) {
this.setParam("tags", tags);
return this;
}
public APIRequestCreateAlbum setTags (String tags) {
this.setParam("tags", tags);
return this;
}
public APIRequestCreateAlbum setVisible (String visible) {
this.setParam("visible", visible);
return this;
}
public APIRequestCreateAlbum requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestCreateAlbum requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAlbum requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestCreateAlbum requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestCreateAlbum requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestCreateAlbum requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetDocs 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 APIRequestGetDocs.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetDocs(String nodeId, APIContext context) {
super(context, nodeId, "/docs", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetDocs setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetDocs setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetDocs requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetDocs requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetDocs requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetDocs requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetDocs requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetDocs requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
}
public static class APIRequestGetEvents extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
};
public static final String[] FIELDS = {
"attending_count",
"can_guests_invite",
"category",
"cover",
"created_time",
"declined_count",
"description",
"discount_code_enabled",
"end_time",
"event_times",
"guest_list_enabled",
"id",
"interested_count",
"is_canceled",
"is_draft",
"is_online",
"is_page_owned",
"maybe_count",
"name",
"noreply_count",
"online_event_format",
"online_event_third_party_url",
"owner",
"parent_group",
"place",
"registration_setting",
"scheduled_publish_time",
"start_time",
"ticket_setting",
"ticket_uri",
"ticket_uri_start_sales_time",
"ticketing_privacy_uri",
"ticketing_terms_uri",
"timezone",
"type",
"updated_time",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return Event.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 APIRequestGetEvents.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetEvents(String nodeId, APIContext context) {
super(context, nodeId, "/events", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetEvents setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetEvents setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetEvents requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetEvents requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetEvents requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetEvents requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetEvents requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetEvents requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetEvents requestAttendingCountField () {
return this.requestAttendingCountField(true);
}
public APIRequestGetEvents requestAttendingCountField (boolean value) {
this.requestField("attending_count", value);
return this;
}
public APIRequestGetEvents requestCanGuestsInviteField () {
return this.requestCanGuestsInviteField(true);
}
public APIRequestGetEvents requestCanGuestsInviteField (boolean value) {
this.requestField("can_guests_invite", value);
return this;
}
public APIRequestGetEvents requestCategoryField () {
return this.requestCategoryField(true);
}
public APIRequestGetEvents requestCategoryField (boolean value) {
this.requestField("category", value);
return this;
}
public APIRequestGetEvents requestCoverField () {
return this.requestCoverField(true);
}
public APIRequestGetEvents requestCoverField (boolean value) {
this.requestField("cover", value);
return this;
}
public APIRequestGetEvents requestCreatedTimeField () {
return this.requestCreatedTimeField(true);
}
public APIRequestGetEvents requestCreatedTimeField (boolean value) {
this.requestField("created_time", value);
return this;
}
public APIRequestGetEvents requestDeclinedCountField () {
return this.requestDeclinedCountField(true);
}
public APIRequestGetEvents requestDeclinedCountField (boolean value) {
this.requestField("declined_count", value);
return this;
}
public APIRequestGetEvents requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetEvents requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetEvents requestDiscountCodeEnabledField () {
return this.requestDiscountCodeEnabledField(true);
}
public APIRequestGetEvents requestDiscountCodeEnabledField (boolean value) {
this.requestField("discount_code_enabled", value);
return this;
}
public APIRequestGetEvents requestEndTimeField () {
return this.requestEndTimeField(true);
}
public APIRequestGetEvents requestEndTimeField (boolean value) {
this.requestField("end_time", value);
return this;
}
public APIRequestGetEvents requestEventTimesField () {
return this.requestEventTimesField(true);
}
public APIRequestGetEvents requestEventTimesField (boolean value) {
this.requestField("event_times", value);
return this;
}
public APIRequestGetEvents requestGuestListEnabledField () {
return this.requestGuestListEnabledField(true);
}
public APIRequestGetEvents requestGuestListEnabledField (boolean value) {
this.requestField("guest_list_enabled", value);
return this;
}
public APIRequestGetEvents requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetEvents requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetEvents requestInterestedCountField () {
return this.requestInterestedCountField(true);
}
public APIRequestGetEvents requestInterestedCountField (boolean value) {
this.requestField("interested_count", value);
return this;
}
public APIRequestGetEvents requestIsCanceledField () {
return this.requestIsCanceledField(true);
}
public APIRequestGetEvents requestIsCanceledField (boolean value) {
this.requestField("is_canceled", value);
return this;
}
public APIRequestGetEvents requestIsDraftField () {
return this.requestIsDraftField(true);
}
public APIRequestGetEvents requestIsDraftField (boolean value) {
this.requestField("is_draft", value);
return this;
}
public APIRequestGetEvents requestIsOnlineField () {
return this.requestIsOnlineField(true);
}
public APIRequestGetEvents requestIsOnlineField (boolean value) {
this.requestField("is_online", value);
return this;
}
public APIRequestGetEvents requestIsPageOwnedField () {
return this.requestIsPageOwnedField(true);
}
public APIRequestGetEvents requestIsPageOwnedField (boolean value) {
this.requestField("is_page_owned", value);
return this;
}
public APIRequestGetEvents requestMaybeCountField () {
return this.requestMaybeCountField(true);
}
public APIRequestGetEvents requestMaybeCountField (boolean value) {
this.requestField("maybe_count", value);
return this;
}
public APIRequestGetEvents requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetEvents requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetEvents requestNoreplyCountField () {
return this.requestNoreplyCountField(true);
}
public APIRequestGetEvents requestNoreplyCountField (boolean value) {
this.requestField("noreply_count", value);
return this;
}
public APIRequestGetEvents requestOnlineEventFormatField () {
return this.requestOnlineEventFormatField(true);
}
public APIRequestGetEvents requestOnlineEventFormatField (boolean value) {
this.requestField("online_event_format", value);
return this;
}
public APIRequestGetEvents requestOnlineEventThirdPartyUrlField () {
return this.requestOnlineEventThirdPartyUrlField(true);
}
public APIRequestGetEvents requestOnlineEventThirdPartyUrlField (boolean value) {
this.requestField("online_event_third_party_url", value);
return this;
}
public APIRequestGetEvents requestOwnerField () {
return this.requestOwnerField(true);
}
public APIRequestGetEvents requestOwnerField (boolean value) {
this.requestField("owner", value);
return this;
}
public APIRequestGetEvents requestParentGroupField () {
return this.requestParentGroupField(true);
}
public APIRequestGetEvents requestParentGroupField (boolean value) {
this.requestField("parent_group", value);
return this;
}
public APIRequestGetEvents requestPlaceField () {
return this.requestPlaceField(true);
}
public APIRequestGetEvents requestPlaceField (boolean value) {
this.requestField("place", value);
return this;
}
public APIRequestGetEvents requestRegistrationSettingField () {
return this.requestRegistrationSettingField(true);
}
public APIRequestGetEvents requestRegistrationSettingField (boolean value) {
this.requestField("registration_setting", value);
return this;
}
public APIRequestGetEvents requestScheduledPublishTimeField () {
return this.requestScheduledPublishTimeField(true);
}
public APIRequestGetEvents requestScheduledPublishTimeField (boolean value) {
this.requestField("scheduled_publish_time", value);
return this;
}
public APIRequestGetEvents requestStartTimeField () {
return this.requestStartTimeField(true);
}
public APIRequestGetEvents requestStartTimeField (boolean value) {
this.requestField("start_time", value);
return this;
}
public APIRequestGetEvents requestTicketSettingField () {
return this.requestTicketSettingField(true);
}
public APIRequestGetEvents requestTicketSettingField (boolean value) {
this.requestField("ticket_setting", value);
return this;
}
public APIRequestGetEvents requestTicketUriField () {
return this.requestTicketUriField(true);
}
public APIRequestGetEvents requestTicketUriField (boolean value) {
this.requestField("ticket_uri", value);
return this;
}
public APIRequestGetEvents requestTicketUriStartSalesTimeField () {
return this.requestTicketUriStartSalesTimeField(true);
}
public APIRequestGetEvents requestTicketUriStartSalesTimeField (boolean value) {
this.requestField("ticket_uri_start_sales_time", value);
return this;
}
public APIRequestGetEvents requestTicketingPrivacyUriField () {
return this.requestTicketingPrivacyUriField(true);
}
public APIRequestGetEvents requestTicketingPrivacyUriField (boolean value) {
this.requestField("ticketing_privacy_uri", value);
return this;
}
public APIRequestGetEvents requestTicketingTermsUriField () {
return this.requestTicketingTermsUriField(true);
}
public APIRequestGetEvents requestTicketingTermsUriField (boolean value) {
this.requestField("ticketing_terms_uri", value);
return this;
}
public APIRequestGetEvents requestTimezoneField () {
return this.requestTimezoneField(true);
}
public APIRequestGetEvents requestTimezoneField (boolean value) {
this.requestField("timezone", value);
return this;
}
public APIRequestGetEvents requestTypeField () {
return this.requestTypeField(true);
}
public APIRequestGetEvents requestTypeField (boolean value) {
this.requestField("type", value);
return this;
}
public APIRequestGetEvents requestUpdatedTimeField () {
return this.requestUpdatedTimeField(true);
}
public APIRequestGetEvents requestUpdatedTimeField (boolean value) {
this.requestField("updated_time", value);
return this;
}
}
public static class APIRequestGetFeed extends APIRequest {
APINodeList lastResponse = null;
@Override
public APINodeList getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"include_hidden",
"q",
"show_expired",
"since",
"until",
"with",
};
public static final String[] FIELDS = {
"actions",
"admin_creator",
"allowed_advertising_objectives",
"application",
"backdated_time",
"call_to_action",
"can_reply_privately",
"caption",
"child_attachments",
"comments_mirroring_domain",
"coordinates",
"created_time",
"description",
"event",
"expanded_height",
"expanded_width",
"feed_targeting",
"from",
"full_picture",
"height",
"icon",
"id",
"instagram_eligibility",
"is_app_share",
"is_eligible_for_promotion",
"is_expired",
"is_hidden",
"is_inline_created",
"is_instagram_eligible",
"is_popular",
"is_published",
"is_spherical",
"link",
"message",
"message_tags",
"multi_share_end_card",
"multi_share_optimized",
"name",
"object_id",
"parent_id",
"permalink_url",
"picture",
"place",
"privacy",
"promotable_id",
"promotion_status",
"properties",
"scheduled_publish_time",
"shares",
"source",
"status_type",
"story",
"story_tags",
"subscribed",
"target",
"targeting",
"timeline_visibility",
"type",
"updated_time",
"via",
"video_buying_eligibility",
"width",
};
@Override
public APINodeList parseResponse(String response, String header) throws APIException {
return Post.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 APIRequestGetFeed.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestGetFeed(String nodeId, APIContext context) {
super(context, nodeId, "/feed", "GET", Arrays.asList(PARAMS));
}
@Override
public APIRequestGetFeed setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestGetFeed setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestGetFeed setIncludeHidden (Boolean includeHidden) {
this.setParam("include_hidden", includeHidden);
return this;
}
public APIRequestGetFeed setIncludeHidden (String includeHidden) {
this.setParam("include_hidden", includeHidden);
return this;
}
public APIRequestGetFeed setQ (String q) {
this.setParam("q", q);
return this;
}
public APIRequestGetFeed setShowExpired (Boolean showExpired) {
this.setParam("show_expired", showExpired);
return this;
}
public APIRequestGetFeed setShowExpired (String showExpired) {
this.setParam("show_expired", showExpired);
return this;
}
public APIRequestGetFeed setSince (String since) {
this.setParam("since", since);
return this;
}
public APIRequestGetFeed setUntil (String until) {
this.setParam("until", until);
return this;
}
public APIRequestGetFeed setWith (String with) {
this.setParam("with", with);
return this;
}
public APIRequestGetFeed requestAllFields () {
return this.requestAllFields(true);
}
public APIRequestGetFeed requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetFeed requestFields (List fields) {
return this.requestFields(fields, true);
}
@Override
public APIRequestGetFeed requestFields (List fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}
@Override
public APIRequestGetFeed requestField (String field) {
this.requestField(field, true);
return this;
}
@Override
public APIRequestGetFeed requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}
public APIRequestGetFeed requestActionsField () {
return this.requestActionsField(true);
}
public APIRequestGetFeed requestActionsField (boolean value) {
this.requestField("actions", value);
return this;
}
public APIRequestGetFeed requestAdminCreatorField () {
return this.requestAdminCreatorField(true);
}
public APIRequestGetFeed requestAdminCreatorField (boolean value) {
this.requestField("admin_creator", value);
return this;
}
public APIRequestGetFeed requestAllowedAdvertisingObjectivesField () {
return this.requestAllowedAdvertisingObjectivesField(true);
}
public APIRequestGetFeed requestAllowedAdvertisingObjectivesField (boolean value) {
this.requestField("allowed_advertising_objectives", value);
return this;
}
public APIRequestGetFeed requestApplicationField () {
return this.requestApplicationField(true);
}
public APIRequestGetFeed requestApplicationField (boolean value) {
this.requestField("application", value);
return this;
}
public APIRequestGetFeed requestBackdatedTimeField () {
return this.requestBackdatedTimeField(true);
}
public APIRequestGetFeed requestBackdatedTimeField (boolean value) {
this.requestField("backdated_time", value);
return this;
}
public APIRequestGetFeed requestCallToActionField () {
return this.requestCallToActionField(true);
}
public APIRequestGetFeed requestCallToActionField (boolean value) {
this.requestField("call_to_action", value);
return this;
}
public APIRequestGetFeed requestCanReplyPrivatelyField () {
return this.requestCanReplyPrivatelyField(true);
}
public APIRequestGetFeed requestCanReplyPrivatelyField (boolean value) {
this.requestField("can_reply_privately", value);
return this;
}
public APIRequestGetFeed requestCaptionField () {
return this.requestCaptionField(true);
}
public APIRequestGetFeed requestCaptionField (boolean value) {
this.requestField("caption", value);
return this;
}
public APIRequestGetFeed requestChildAttachmentsField () {
return this.requestChildAttachmentsField(true);
}
public APIRequestGetFeed requestChildAttachmentsField (boolean value) {
this.requestField("child_attachments", value);
return this;
}
public APIRequestGetFeed requestCommentsMirroringDomainField () {
return this.requestCommentsMirroringDomainField(true);
}
public APIRequestGetFeed requestCommentsMirroringDomainField (boolean value) {
this.requestField("comments_mirroring_domain", value);
return this;
}
public APIRequestGetFeed requestCoordinatesField () {
return this.requestCoordinatesField(true);
}
public APIRequestGetFeed requestCoordinatesField (boolean value) {
this.requestField("coordinates", value);
return this;
}
public APIRequestGetFeed requestCreatedTimeField () {
return this.requestCreatedTimeField(true);
}
public APIRequestGetFeed requestCreatedTimeField (boolean value) {
this.requestField("created_time", value);
return this;
}
public APIRequestGetFeed requestDescriptionField () {
return this.requestDescriptionField(true);
}
public APIRequestGetFeed requestDescriptionField (boolean value) {
this.requestField("description", value);
return this;
}
public APIRequestGetFeed requestEventField () {
return this.requestEventField(true);
}
public APIRequestGetFeed requestEventField (boolean value) {
this.requestField("event", value);
return this;
}
public APIRequestGetFeed requestExpandedHeightField () {
return this.requestExpandedHeightField(true);
}
public APIRequestGetFeed requestExpandedHeightField (boolean value) {
this.requestField("expanded_height", value);
return this;
}
public APIRequestGetFeed requestExpandedWidthField () {
return this.requestExpandedWidthField(true);
}
public APIRequestGetFeed requestExpandedWidthField (boolean value) {
this.requestField("expanded_width", value);
return this;
}
public APIRequestGetFeed requestFeedTargetingField () {
return this.requestFeedTargetingField(true);
}
public APIRequestGetFeed requestFeedTargetingField (boolean value) {
this.requestField("feed_targeting", value);
return this;
}
public APIRequestGetFeed requestFromField () {
return this.requestFromField(true);
}
public APIRequestGetFeed requestFromField (boolean value) {
this.requestField("from", value);
return this;
}
public APIRequestGetFeed requestFullPictureField () {
return this.requestFullPictureField(true);
}
public APIRequestGetFeed requestFullPictureField (boolean value) {
this.requestField("full_picture", value);
return this;
}
public APIRequestGetFeed requestHeightField () {
return this.requestHeightField(true);
}
public APIRequestGetFeed requestHeightField (boolean value) {
this.requestField("height", value);
return this;
}
public APIRequestGetFeed requestIconField () {
return this.requestIconField(true);
}
public APIRequestGetFeed requestIconField (boolean value) {
this.requestField("icon", value);
return this;
}
public APIRequestGetFeed requestIdField () {
return this.requestIdField(true);
}
public APIRequestGetFeed requestIdField (boolean value) {
this.requestField("id", value);
return this;
}
public APIRequestGetFeed requestInstagramEligibilityField () {
return this.requestInstagramEligibilityField(true);
}
public APIRequestGetFeed requestInstagramEligibilityField (boolean value) {
this.requestField("instagram_eligibility", value);
return this;
}
public APIRequestGetFeed requestIsAppShareField () {
return this.requestIsAppShareField(true);
}
public APIRequestGetFeed requestIsAppShareField (boolean value) {
this.requestField("is_app_share", value);
return this;
}
public APIRequestGetFeed requestIsEligibleForPromotionField () {
return this.requestIsEligibleForPromotionField(true);
}
public APIRequestGetFeed requestIsEligibleForPromotionField (boolean value) {
this.requestField("is_eligible_for_promotion", value);
return this;
}
public APIRequestGetFeed requestIsExpiredField () {
return this.requestIsExpiredField(true);
}
public APIRequestGetFeed requestIsExpiredField (boolean value) {
this.requestField("is_expired", value);
return this;
}
public APIRequestGetFeed requestIsHiddenField () {
return this.requestIsHiddenField(true);
}
public APIRequestGetFeed requestIsHiddenField (boolean value) {
this.requestField("is_hidden", value);
return this;
}
public APIRequestGetFeed requestIsInlineCreatedField () {
return this.requestIsInlineCreatedField(true);
}
public APIRequestGetFeed requestIsInlineCreatedField (boolean value) {
this.requestField("is_inline_created", value);
return this;
}
public APIRequestGetFeed requestIsInstagramEligibleField () {
return this.requestIsInstagramEligibleField(true);
}
public APIRequestGetFeed requestIsInstagramEligibleField (boolean value) {
this.requestField("is_instagram_eligible", value);
return this;
}
public APIRequestGetFeed requestIsPopularField () {
return this.requestIsPopularField(true);
}
public APIRequestGetFeed requestIsPopularField (boolean value) {
this.requestField("is_popular", value);
return this;
}
public APIRequestGetFeed requestIsPublishedField () {
return this.requestIsPublishedField(true);
}
public APIRequestGetFeed requestIsPublishedField (boolean value) {
this.requestField("is_published", value);
return this;
}
public APIRequestGetFeed requestIsSphericalField () {
return this.requestIsSphericalField(true);
}
public APIRequestGetFeed requestIsSphericalField (boolean value) {
this.requestField("is_spherical", value);
return this;
}
public APIRequestGetFeed requestLinkField () {
return this.requestLinkField(true);
}
public APIRequestGetFeed requestLinkField (boolean value) {
this.requestField("link", value);
return this;
}
public APIRequestGetFeed requestMessageField () {
return this.requestMessageField(true);
}
public APIRequestGetFeed requestMessageField (boolean value) {
this.requestField("message", value);
return this;
}
public APIRequestGetFeed requestMessageTagsField () {
return this.requestMessageTagsField(true);
}
public APIRequestGetFeed requestMessageTagsField (boolean value) {
this.requestField("message_tags", value);
return this;
}
public APIRequestGetFeed requestMultiShareEndCardField () {
return this.requestMultiShareEndCardField(true);
}
public APIRequestGetFeed requestMultiShareEndCardField (boolean value) {
this.requestField("multi_share_end_card", value);
return this;
}
public APIRequestGetFeed requestMultiShareOptimizedField () {
return this.requestMultiShareOptimizedField(true);
}
public APIRequestGetFeed requestMultiShareOptimizedField (boolean value) {
this.requestField("multi_share_optimized", value);
return this;
}
public APIRequestGetFeed requestNameField () {
return this.requestNameField(true);
}
public APIRequestGetFeed requestNameField (boolean value) {
this.requestField("name", value);
return this;
}
public APIRequestGetFeed requestObjectIdField () {
return this.requestObjectIdField(true);
}
public APIRequestGetFeed requestObjectIdField (boolean value) {
this.requestField("object_id", value);
return this;
}
public APIRequestGetFeed requestParentIdField () {
return this.requestParentIdField(true);
}
public APIRequestGetFeed requestParentIdField (boolean value) {
this.requestField("parent_id", value);
return this;
}
public APIRequestGetFeed requestPermalinkUrlField () {
return this.requestPermalinkUrlField(true);
}
public APIRequestGetFeed requestPermalinkUrlField (boolean value) {
this.requestField("permalink_url", value);
return this;
}
public APIRequestGetFeed requestPictureField () {
return this.requestPictureField(true);
}
public APIRequestGetFeed requestPictureField (boolean value) {
this.requestField("picture", value);
return this;
}
public APIRequestGetFeed requestPlaceField () {
return this.requestPlaceField(true);
}
public APIRequestGetFeed requestPlaceField (boolean value) {
this.requestField("place", value);
return this;
}
public APIRequestGetFeed requestPrivacyField () {
return this.requestPrivacyField(true);
}
public APIRequestGetFeed requestPrivacyField (boolean value) {
this.requestField("privacy", value);
return this;
}
public APIRequestGetFeed requestPromotableIdField () {
return this.requestPromotableIdField(true);
}
public APIRequestGetFeed requestPromotableIdField (boolean value) {
this.requestField("promotable_id", value);
return this;
}
public APIRequestGetFeed requestPromotionStatusField () {
return this.requestPromotionStatusField(true);
}
public APIRequestGetFeed requestPromotionStatusField (boolean value) {
this.requestField("promotion_status", value);
return this;
}
public APIRequestGetFeed requestPropertiesField () {
return this.requestPropertiesField(true);
}
public APIRequestGetFeed requestPropertiesField (boolean value) {
this.requestField("properties", value);
return this;
}
public APIRequestGetFeed requestScheduledPublishTimeField () {
return this.requestScheduledPublishTimeField(true);
}
public APIRequestGetFeed requestScheduledPublishTimeField (boolean value) {
this.requestField("scheduled_publish_time", value);
return this;
}
public APIRequestGetFeed requestSharesField () {
return this.requestSharesField(true);
}
public APIRequestGetFeed requestSharesField (boolean value) {
this.requestField("shares", value);
return this;
}
public APIRequestGetFeed requestSourceField () {
return this.requestSourceField(true);
}
public APIRequestGetFeed requestSourceField (boolean value) {
this.requestField("source", value);
return this;
}
public APIRequestGetFeed requestStatusTypeField () {
return this.requestStatusTypeField(true);
}
public APIRequestGetFeed requestStatusTypeField (boolean value) {
this.requestField("status_type", value);
return this;
}
public APIRequestGetFeed requestStoryField () {
return this.requestStoryField(true);
}
public APIRequestGetFeed requestStoryField (boolean value) {
this.requestField("story", value);
return this;
}
public APIRequestGetFeed requestStoryTagsField () {
return this.requestStoryTagsField(true);
}
public APIRequestGetFeed requestStoryTagsField (boolean value) {
this.requestField("story_tags", value);
return this;
}
public APIRequestGetFeed requestSubscribedField () {
return this.requestSubscribedField(true);
}
public APIRequestGetFeed requestSubscribedField (boolean value) {
this.requestField("subscribed", value);
return this;
}
public APIRequestGetFeed requestTargetField () {
return this.requestTargetField(true);
}
public APIRequestGetFeed requestTargetField (boolean value) {
this.requestField("target", value);
return this;
}
public APIRequestGetFeed requestTargetingField () {
return this.requestTargetingField(true);
}
public APIRequestGetFeed requestTargetingField (boolean value) {
this.requestField("targeting", value);
return this;
}
public APIRequestGetFeed requestTimelineVisibilityField () {
return this.requestTimelineVisibilityField(true);
}
public APIRequestGetFeed requestTimelineVisibilityField (boolean value) {
this.requestField("timeline_visibility", value);
return this;
}
public APIRequestGetFeed requestTypeField () {
return this.requestTypeField(true);
}
public APIRequestGetFeed requestTypeField (boolean value) {
this.requestField("type", value);
return this;
}
public APIRequestGetFeed requestUpdatedTimeField () {
return this.requestUpdatedTimeField(true);
}
public APIRequestGetFeed requestUpdatedTimeField (boolean value) {
this.requestField("updated_time", value);
return this;
}
public APIRequestGetFeed requestViaField () {
return this.requestViaField(true);
}
public APIRequestGetFeed requestViaField (boolean value) {
this.requestField("via", value);
return this;
}
public APIRequestGetFeed requestVideoBuyingEligibilityField () {
return this.requestVideoBuyingEligibilityField(true);
}
public APIRequestGetFeed requestVideoBuyingEligibilityField (boolean value) {
this.requestField("video_buying_eligibility", value);
return this;
}
public APIRequestGetFeed requestWidthField () {
return this.requestWidthField(true);
}
public APIRequestGetFeed requestWidthField (boolean value) {
this.requestField("width", value);
return this;
}
}
public static class APIRequestCreateFeed extends APIRequest {
Post lastResponse = null;
@Override
public Post getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"actions",
"album_id",
"android_key_hash",
"application_id",
"asked_fun_fact_prompt_id",
"asset3d_id",
"associated_id",
"attach_place_suggestion",
"attached_media",
"audience_exp",
"backdated_time",
"backdated_time_granularity",
"breaking_news",
"breaking_news_expiration",
"call_to_action",
"caption",
"child_attachments",
"client_mutation_id",
"composer_entry_picker",
"composer_entry_point",
"composer_entry_time",
"composer_session_events_log",
"composer_session_id",
"composer_source_surface",
"composer_type",
"connection_class",
"content_attachment",
"coordinates",
"cta_link",
"cta_type",
"description",
"direct_share_status",
"expanded_height",
"expanded_width",
"feed_targeting",
"formatting",
"fun_fact_prompt_id",
"fun_fact_toastee_id",
"height",
"holiday_card",
"home_checkin_city_id",
"image_crops",
"implicit_with_tags",
"instant_game_entry_point_data",
"ios_bundle_id",
"is_backout_draft",
"is_boost_intended",
"is_explicit_location",
"is_explicit_share",
"is_group_linking_post",
"is_photo_container",
"link",
"location_source_id",
"manual_privacy",
"message",
"multi_share_end_card",
"multi_share_optimized",
"name",
"nectar_module",
"object_attachment",
"offer_like_post_id",
"og_action_type_id",
"og_hide_object_attachment",
"og_icon_id",
"og_object_id",
"og_phrase",
"og_set_profile_badge",
"og_suggestion_mechanism",
"page_recommendation",
"picture",
"place",
"place_attachment_setting",
"place_list",
"place_list_data",
"post_surfaces_blacklist",
"posting_to_redspace",
"privacy",
"prompt_id",
"prompt_tracking_string",
"properties",
"proxied_app_id",
"publish_event_id",
"published",
"quote",
"ref",
"referenceable_image_ids",
"referral_id",
"scheduled_publish_time",
"source",
"sponsor_id",
"sponsor_relationship",
"suggested_place_id",
"tags",
"target_surface",
"targeting",
"text_format_metadata",
"text_format_preset_id",
"text_only_place",
"throwback_camera_roll_media",
"thumbnail",
"time_since_original_post",
"title",
"tracking_info",
"unpublished_content_type",
"user_selected_tags",
"video_start_time_ms",
"viewer_coordinates",
"width",
};
public static final String[] FIELDS = {
};
@Override
public Post parseResponse(String response, String header) throws APIException {
return Post.parseResponse(response, getContext(), this, header).head();
}
@Override
public Post execute() throws APIException {
return execute(new HashMap());
}
@Override
public Post 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 Post apply(ResponseWrapper result) {
try {
return APIRequestCreateFeed.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
},
MoreExecutors.directExecutor()
);
};
public APIRequestCreateFeed(String nodeId, APIContext context) {
super(context, nodeId, "/feed", "POST", Arrays.asList(PARAMS));
}
@Override
public APIRequestCreateFeed setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}
@Override
public APIRequestCreateFeed setParams(Map params) {
setParamsInternal(params);
return this;
}
public APIRequestCreateFeed setActions (Object actions) {
this.setParam("actions", actions);
return this;
}
public APIRequestCreateFeed setActions (String actions) {
this.setParam("actions", actions);
return this;
}
public APIRequestCreateFeed setAlbumId (String albumId) {
this.setParam("album_id", albumId);
return this;
}
public APIRequestCreateFeed setAndroidKeyHash (String androidKeyHash) {
this.setParam("android_key_hash", androidKeyHash);
return this;
}
public APIRequestCreateFeed setApplicationId (String applicationId) {
this.setParam("application_id", applicationId);
return this;
}
public APIRequestCreateFeed setAskedFunFactPromptId (Long askedFunFactPromptId) {
this.setParam("asked_fun_fact_prompt_id", askedFunFactPromptId);
return this;
}
public APIRequestCreateFeed setAskedFunFactPromptId (String askedFunFactPromptId) {
this.setParam("asked_fun_fact_prompt_id", askedFunFactPromptId);
return this;
}
public APIRequestCreateFeed setAsset3dId (Long asset3dId) {
this.setParam("asset3d_id", asset3dId);
return this;
}
public APIRequestCreateFeed setAsset3dId (String asset3dId) {
this.setParam("asset3d_id", asset3dId);
return this;
}
public APIRequestCreateFeed setAssociatedId (String associatedId) {
this.setParam("associated_id", associatedId);
return this;
}
public APIRequestCreateFeed setAttachPlaceSuggestion (Boolean attachPlaceSuggestion) {
this.setParam("attach_place_suggestion", attachPlaceSuggestion);
return this;
}
public APIRequestCreateFeed setAttachPlaceSuggestion (String attachPlaceSuggestion) {
this.setParam("attach_place_suggestion", attachPlaceSuggestion);
return this;
}
public APIRequestCreateFeed setAttachedMedia (List