Skip to content

Commit

Permalink
Auto-generated java SDK code update
Browse files Browse the repository at this point in the history
Summary: ignore-conflict-markers

Reviewed By: stcheng

Differential Revision: D53019933

fbshipit-source-id: 69b86a5a5647ceae3ea7845489db5c5bfa51f850
  • Loading branch information
generatedunixname89002005295453 authored and facebook-github-bot committed Jan 23, 2024
1 parent 87c5479 commit 4d3173d
Show file tree
Hide file tree
Showing 41 changed files with 2,695 additions and 2,128 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.facebook.business.sdk</groupId>
<artifactId>facebook-java-business-sdk</artifactId>
<packaging>jar</packaging>
<version>18.0.4</version>
<version>19.0.0</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Facebook Business Solutions SDK for Java</description>
<url>https://developers.facebook.com/docs/marketing-api/sdks</url>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/facebook/ads/sdk/APIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
package com.facebook.ads.sdk;

public class APIConfig {
public static final String DEFAULT_API_VERSION = "v18.0";
public static final String DEFAULT_API_VERSION = "v19.0";
public static final String DEFAULT_API_BASE = "https://graph.facebook.com";
public static final String DEFAULT_VIDEO_API_BASE = "https://graph-video.facebook.com";
public static final String USER_AGENT = "fbbizsdk-java-v18.0.4";
public static final String USER_AGENT = "fbbizsdk-java-v19.0.0";
};
165 changes: 165 additions & 0 deletions src/main/java/com/facebook/ads/sdk/AdAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ public APIRequestGetAgencies getAgencies() {
return new APIRequestGetAgencies(this.getPrefixedId().toString(), context);
}

public APIRequestCreateAgency createAgency() {
return new APIRequestCreateAgency(this.getPrefixedId().toString(), context);
}

public APIRequestGetApplications getApplications() {
return new APIRequestGetApplications(this.getPrefixedId().toString(), context);
}
Expand Down Expand Up @@ -1121,7 +1125,9 @@ public APINodeList<AdAccountBusinessConstraints> getLastResponse() {

public static final String[] FIELDS = {
"audience_controls",
"campaigns_with_error",
"placement_controls",
"status",
};

@Override
Expand Down Expand Up @@ -1220,13 +1226,27 @@ public APIRequestGetAccountControls requestAudienceControlsField (boolean value)
this.requestField("audience_controls", value);
return this;
}
public APIRequestGetAccountControls requestCampaignsWithErrorField () {
return this.requestCampaignsWithErrorField(true);
}
public APIRequestGetAccountControls requestCampaignsWithErrorField (boolean value) {
this.requestField("campaigns_with_error", value);
return this;
}
public APIRequestGetAccountControls requestPlacementControlsField () {
return this.requestPlacementControlsField(true);
}
public APIRequestGetAccountControls requestPlacementControlsField (boolean value) {
this.requestField("placement_controls", value);
return this;
}
public APIRequestGetAccountControls requestStatusField () {
return this.requestStatusField(true);
}
public APIRequestGetAccountControls requestStatusField (boolean value) {
this.requestField("status", value);
return this;
}
}

public static class APIRequestCreateAccountControl extends APIRequest<AdAccountBusinessConstraints> {
Expand Down Expand Up @@ -13170,6 +13190,126 @@ public APIRequestGetAgencies requestVerticalIdField (boolean value) {
}
}

public static class APIRequestCreateAgency extends APIRequest<AdAccount> {

AdAccount lastResponse = null;
@Override
public AdAccount getLastResponse() {
return lastResponse;
}
public static final String[] PARAMS = {
"business",
"permitted_tasks",
};

public static final String[] FIELDS = {
};

@Override
public AdAccount parseResponse(String response, String header) throws APIException {
return AdAccount.parseResponse(response, getContext(), this, header).head();
}

@Override
public AdAccount execute() throws APIException {
return execute(new HashMap<String, Object>());
}

@Override
public AdAccount execute(Map<String, Object> extraParams) throws APIException {
ResponseWrapper rw = executeInternal(extraParams);
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
return lastResponse;
}

public ListenableFuture<AdAccount> executeAsync() throws APIException {
return executeAsync(new HashMap<String, Object>());
};

public ListenableFuture<AdAccount> executeAsync(Map<String, Object> extraParams) throws APIException {
return Futures.transform(
executeAsyncInternal(extraParams),
new Function<ResponseWrapper, AdAccount>() {
public AdAccount apply(ResponseWrapper result) {
try {
return APIRequestCreateAgency.this.parseResponse(result.getBody(), result.getHeader());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
);
};

public APIRequestCreateAgency(String nodeId, APIContext context) {
super(context, nodeId, "/agencies", "POST", Arrays.asList(PARAMS));
}

@Override
public APIRequestCreateAgency setParam(String param, Object value) {
setParamInternal(param, value);
return this;
}

@Override
public APIRequestCreateAgency setParams(Map<String, Object> params) {
setParamsInternal(params);
return this;
}


public APIRequestCreateAgency setBusiness (String business) {
this.setParam("business", business);
return this;
}

public APIRequestCreateAgency setPermittedTasks (List<AdAccount.EnumPermittedTasks> permittedTasks) {
this.setParam("permitted_tasks", permittedTasks);
return this;
}
public APIRequestCreateAgency setPermittedTasks (String permittedTasks) {
this.setParam("permitted_tasks", permittedTasks);
return this;
}

public APIRequestCreateAgency requestAllFields () {
return this.requestAllFields(true);
}

public APIRequestCreateAgency requestAllFields (boolean value) {
for (String field : FIELDS) {
this.requestField(field, value);
}
return this;
}

@Override
public APIRequestCreateAgency requestFields (List<String> fields) {
return this.requestFields(fields, true);
}

@Override
public APIRequestCreateAgency requestFields (List<String> fields, boolean value) {
for (String field : fields) {
this.requestField(field, value);
}
return this;
}

@Override
public APIRequestCreateAgency requestField (String field) {
this.requestField(field, true);
return this;
}

@Override
public APIRequestCreateAgency requestField (String field, boolean value) {
this.requestFieldInternal(field, value);
return this;
}

}

public static class APIRequestGetApplications extends APIRequest<Application> {

APINodeList<Application> lastResponse = null;
Expand Down Expand Up @@ -29091,6 +29231,31 @@ public String toString() {
}
}

public static enum EnumPermittedTasks {
@SerializedName("AA_ANALYZE")
VALUE_AA_ANALYZE("AA_ANALYZE"),
@SerializedName("ADVERTISE")
VALUE_ADVERTISE("ADVERTISE"),
@SerializedName("ANALYZE")
VALUE_ANALYZE("ANALYZE"),
@SerializedName("DRAFT")
VALUE_DRAFT("DRAFT"),
@SerializedName("MANAGE")
VALUE_MANAGE("MANAGE"),
;

private String value;

private EnumPermittedTasks(String value) {
this.value = value;
}

@Override
public String toString() {
return value;
}
}

public static enum EnumTasks {
@SerializedName("AA_ANALYZE")
VALUE_AA_ANALYZE("AA_ANALYZE"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,12 @@ public static enum EnumAction {
VALUE_EMAIL("EMAIL"),
@SerializedName("ENABLE_ADVANTAGE_PLUS_CREATIVE")
VALUE_ENABLE_ADVANTAGE_PLUS_CREATIVE("ENABLE_ADVANTAGE_PLUS_CREATIVE"),
@SerializedName("ENABLE_ADVANTAGE_PLUS_PLACEMENTS")
VALUE_ENABLE_ADVANTAGE_PLUS_PLACEMENTS("ENABLE_ADVANTAGE_PLUS_PLACEMENTS"),
@SerializedName("ENABLE_AUTOFLOW")
VALUE_ENABLE_AUTOFLOW("ENABLE_AUTOFLOW"),
@SerializedName("ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION")
VALUE_ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION("ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION"),
@SerializedName("ENDPOINT_PINGED")
VALUE_ENDPOINT_PINGED("ENDPOINT_PINGED"),
@SerializedName("ERROR")
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/facebook/ads/sdk/AdAccountAdVolume.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,18 @@ public static enum EnumRecommendationType {
VALUE_ADS_REPORTING("ADS_REPORTING"),
@SerializedName("ADVANCED_CAMPAIGN_BUDGET")
VALUE_ADVANCED_CAMPAIGN_BUDGET("ADVANCED_CAMPAIGN_BUDGET"),
@SerializedName("ADVANTAGE_APP_CAMPAIGN")
VALUE_ADVANTAGE_APP_CAMPAIGN("ADVANTAGE_APP_CAMPAIGN"),
@SerializedName("ADVANTAGE_CUSTOM_AUDIENCE")
VALUE_ADVANTAGE_CUSTOM_AUDIENCE("ADVANTAGE_CUSTOM_AUDIENCE"),
@SerializedName("ADVANTAGE_CUSTOM_AUDIENCE_UPSELL")
VALUE_ADVANTAGE_CUSTOM_AUDIENCE_UPSELL("ADVANTAGE_CUSTOM_AUDIENCE_UPSELL"),
@SerializedName("ADVANTAGE_DETAILED_TARGETING")
VALUE_ADVANTAGE_DETAILED_TARGETING("ADVANTAGE_DETAILED_TARGETING"),
@SerializedName("ADVANTAGE_LOOKALIKE_AUDIENCE")
VALUE_ADVANTAGE_LOOKALIKE_AUDIENCE("ADVANTAGE_LOOKALIKE_AUDIENCE"),
@SerializedName("ADVANTAGE_PLUS_AUDIENCE")
VALUE_ADVANTAGE_PLUS_AUDIENCE("ADVANTAGE_PLUS_AUDIENCE"),
@SerializedName("ADVANTAGE_PLUS_AUDIENCE_FRICTION")
VALUE_ADVANTAGE_PLUS_AUDIENCE_FRICTION("ADVANTAGE_PLUS_AUDIENCE_FRICTION"),
@SerializedName("ADVANTAGE_PLUS_AUDIENCE_TOGGLE")
Expand All @@ -356,6 +364,8 @@ public static enum EnumRecommendationType {
VALUE_ADVANTAGE_PLUS_CREATIVE("ADVANTAGE_PLUS_CREATIVE"),
@SerializedName("ADVANTAGE_PLUS_CREATIVE_CATALOG")
VALUE_ADVANTAGE_PLUS_CREATIVE_CATALOG("ADVANTAGE_PLUS_CREATIVE_CATALOG"),
@SerializedName("ADVANTAGE_PLUS_PLACEMENTS_FRICTION")
VALUE_ADVANTAGE_PLUS_PLACEMENTS_FRICTION("ADVANTAGE_PLUS_PLACEMENTS_FRICTION"),
@SerializedName("ADVANTAGE_SHOPPING_CAMPAIGN")
VALUE_ADVANTAGE_SHOPPING_CAMPAIGN("ADVANTAGE_SHOPPING_CAMPAIGN"),
@SerializedName("ADVANTAGE_SHOPPING_CAMPAIGN_FRAGMENTATION")
Expand Down Expand Up @@ -456,6 +466,8 @@ public static enum EnumRecommendationType {
VALUE_HIGH_COST("HIGH_COST"),
@SerializedName("HISTORICAL_BENCHMARK")
VALUE_HISTORICAL_BENCHMARK("HISTORICAL_BENCHMARK"),
@SerializedName("IG_MULTI_ADS")
VALUE_IG_MULTI_ADS("IG_MULTI_ADS"),
@SerializedName("LEARNING_LIMITED")
VALUE_LEARNING_LIMITED("LEARNING_LIMITED"),
@SerializedName("LEARNING_PAUSE_FRICTION")
Expand Down Expand Up @@ -518,6 +530,8 @@ public static enum EnumRecommendationType {
VALUE_SPEND_LIMIT("SPEND_LIMIT"),
@SerializedName("SYD_TEST_MODE")
VALUE_SYD_TEST_MODE("SYD_TEST_MODE"),
@SerializedName("TAILORED_LEAD_AD_CAMPAIGN")
VALUE_TAILORED_LEAD_AD_CAMPAIGN("TAILORED_LEAD_AD_CAMPAIGN"),
@SerializedName("TOP_ADSETS_WITH_ADS_UNDER_CAP")
VALUE_TOP_ADSETS_WITH_ADS_UNDER_CAP("TOP_ADSETS_WITH_ADS_UNDER_CAP"),
@SerializedName("TOP_CAMPAIGNS_WITH_ADS_UNDER_CAP")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@
public class AdAccountBusinessConstraints extends APINode {
@SerializedName("audience_controls")
private Object mAudienceControls = null;
@SerializedName("campaigns_with_error")
private List<String> mCampaignsWithError = null;
@SerializedName("placement_controls")
private Object mPlacementControls = null;
@SerializedName("status")
private String mStatus = null;
protected static Gson gson = null;

public AdAccountBusinessConstraints() {
Expand Down Expand Up @@ -204,6 +208,15 @@ public AdAccountBusinessConstraints setFieldAudienceControls(Object value) {
return this;
}

public List<String> getFieldCampaignsWithError() {
return mCampaignsWithError;
}

public AdAccountBusinessConstraints setFieldCampaignsWithError(List<String> value) {
this.mCampaignsWithError = value;
return this;
}

public Object getFieldPlacementControls() {
return mPlacementControls;
}
Expand All @@ -213,6 +226,15 @@ public AdAccountBusinessConstraints setFieldPlacementControls(Object value) {
return this;
}

public String getFieldStatus() {
return mStatus;
}

public AdAccountBusinessConstraints setFieldStatus(String value) {
this.mStatus = value;
return this;
}




Expand All @@ -231,7 +253,9 @@ public AdAccountBusinessConstraints setFieldPlacementControls(Object value) {

public AdAccountBusinessConstraints copyFrom(AdAccountBusinessConstraints instance) {
this.mAudienceControls = instance.mAudienceControls;
this.mCampaignsWithError = instance.mCampaignsWithError;
this.mPlacementControls = instance.mPlacementControls;
this.mStatus = instance.mStatus;
this.context = instance.context;
this.rawValue = instance.rawValue;
return this;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/facebook/ads/sdk/AdCreative.java
Original file line number Diff line number Diff line change
Expand Up @@ -2734,6 +2734,8 @@ public static enum EnumAuthorizationCategory {
VALUE_NONE("NONE"),
@SerializedName("POLITICAL")
VALUE_POLITICAL("POLITICAL"),
@SerializedName("POLITICAL_WITH_DIGITALLY_CREATED_MEDIA")
VALUE_POLITICAL_WITH_DIGITALLY_CREATED_MEDIA("POLITICAL_WITH_DIGITALLY_CREATED_MEDIA"),
;

private String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class AdCreativeBrandedContentAds extends APINode {
private Boolean mIsMcaInternal = null;
@SerializedName("partners")
private List<AdCreativeBrandedContentAdsPartners> mPartners = null;
@SerializedName("promoted_page_id")
private String mPromotedPageId = null;
@SerializedName("ui_version")
private Long mUiVersion = null;
protected static Gson gson = null;
Expand Down Expand Up @@ -253,6 +255,15 @@ public AdCreativeBrandedContentAds setFieldPartners(String value) {
this.mPartners = AdCreativeBrandedContentAdsPartners.getGson().fromJson(value, type);
return this;
}
public String getFieldPromotedPageId() {
return mPromotedPageId;
}

public AdCreativeBrandedContentAds setFieldPromotedPageId(String value) {
this.mPromotedPageId = value;
return this;
}

public Long getFieldUiVersion() {
return mUiVersion;
}
Expand Down Expand Up @@ -284,6 +295,7 @@ public AdCreativeBrandedContentAds copyFrom(AdCreativeBrandedContentAds instance
this.mInstagramBoostPostAccessToken = instance.mInstagramBoostPostAccessToken;
this.mIsMcaInternal = instance.mIsMcaInternal;
this.mPartners = instance.mPartners;
this.mPromotedPageId = instance.mPromotedPageId;
this.mUiVersion = instance.mUiVersion;
this.context = instance.context;
this.rawValue = instance.rawValue;
Expand Down
Loading

0 comments on commit 4d3173d

Please sign in to comment.