Skip to content

Commit 932bc32

Browse files
jingping2015facebook-github-bot
authored andcommitted
Auto-generated java SDK code update
Summary: ignore-conflict-markers Reviewed By: jingping2015 Differential Revision: D15244775 fbshipit-source-id: 5893aef6
1 parent 742fbba commit 932bc32

File tree

108 files changed

+29456
-109299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+29456
-109299
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55

66
## Unreleased
77

8+
## v3.3.1
9+
### Changed
10+
- Remove list of API call from Business SDK, [here](https://developers.facebook.com/docs/graph-api/changelog/4-30-2019-endpoint-deprecations)
11+
812
## v3.3.0
913
### Changed
1014
- Graph API call upgrade to [v3.3](https://developers.facebook.com/docs/graph-api/changelog/version3.3)

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ The executor needs to implement ``IRequestExecutor`` interface:
282282

283283
``DefaultRequestExecutor`` is used by default, and it is also a good starting point for Customization.
284284

285-
####Missing or Incorrect Request Params/Fields
285+
#### Missing or Incorrect Request Params/Fields
286286
It is recommended to use setXXX() or requestXXXField() to construct a proper APIRequest, which prevents mis-spelling of parameter/field names. However, if you believe that some needed params/fields are missing from these methods, you can call:
287287

288288
```java
@@ -294,14 +294,14 @@ This also works if you believe the type of the param is not correct in SDK.
294294

295295
In this case, please help us make improvement by filing issues.
296296

297-
####Missing Fields in Class Definition
297+
#### Missing Fields in Class Definition
298298
If you believe that certain fields are returned from server, but they are missing in class definition, then you can still access those fields by fetching it from raw response:
299299

300300
campaign.getRawResponseAsJsonObject().get("field").getAsString();
301301

302302
This situation can occasionally happen if new fields are added to server response while SDK is not up-to-date. We'll update the SDK periodically to include new fields.
303303

304-
####Ad-hoc APIRequest
304+
#### Ad-hoc APIRequest
305305
Most of Marketing API can be found in SDK classes. If you don't find the one you want to access, it is possible to construct an Ad-hoc APIRequest:
306306

307307
```java
@@ -318,7 +318,7 @@ When constructing the APIRequest, you need to provide
318318
* The parser for the expected response type. You can use null if it is not in the SDK, which will return APINodeList<APINode> when executed.
319319

320320

321-
####FailedRequestException Troubleshooting
321+
#### FailedRequestException Troubleshooting
322322
There are many possible causes for a failed request:
323323

324324
* Incorrect parameters are provided in the API request (check <a href="https://developers.facebook.com/docs/graph-api" target="_blank">Graph API Docs</a>)
@@ -339,5 +339,10 @@ Here are some hints on troubleshooting:
339339
* For temporary server issue, typically retry should work after a few seconds.
340340
* If server persistently responds with "Unknown error," then it is potentially server bug.
341341

342+
## SDK Codegen
343+
Our SDK is autogenerated from [SDK Codegen](https://github.com/facebook/facebook-business-sdk-codegen). If you want to learn more about how our SDK code is generated, please check this repository.
344+
345+
346+
342347
## License
343348
Facebook Business SDK for Java is licensed under the LICENSE file in the root directory of this source tree.

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.facebook.business.sdk</groupId>
55
<artifactId>facebook-java-business-sdk</artifactId>
66
<packaging>jar</packaging>
7-
<version>3.3.0</version>
7+
<version>3.3.1</version>
88
<name>${project.groupId}:${project.artifactId}</name>
99
<description>Facebook Business Solutions SDK for Java</description>
1010
<url>https://developers.facebook.com/docs/marketing-api/sdks</url>

src/main/java/com/facebook/ads/sdk/Ad.java

-234
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@ public APIRequestGetLeads getLeads() {
368368
return new APIRequestGetLeads(this.getPrefixedId().toString(), context);
369369
}
370370

371-
public APIRequestCreateLead createLead() {
372-
return new APIRequestCreateLead(this.getPrefixedId().toString(), context);
373-
}
374-
375371
public APIRequestGetPreviews getPreviews() {
376372
return new APIRequestGetPreviews(this.getPrefixedId().toString(), context);
377373
}
@@ -380,10 +376,6 @@ public APIRequestGetTargetingSentenceLines getTargetingSentenceLines() {
380376
return new APIRequestGetTargetingSentenceLines(this.getPrefixedId().toString(), context);
381377
}
382378

383-
public APIRequestDeleteTrackingTag deleteTrackingTag() {
384-
return new APIRequestDeleteTrackingTag(this.getPrefixedId().toString(), context);
385-
}
386-
387379
public APIRequestCreateTrackingTag createTrackingTag() {
388380
return new APIRequestCreateTrackingTag(this.getPrefixedId().toString(), context);
389381
}
@@ -3139,128 +3131,6 @@ public APIRequestGetLeads requestRetailerItemIdField (boolean value) {
31393131
}
31403132
}
31413133

3142-
public static class APIRequestCreateLead extends APIRequest<Lead> {
3143-
3144-
Lead lastResponse = null;
3145-
@Override
3146-
public Lead getLastResponse() {
3147-
return lastResponse;
3148-
}
3149-
public static final String[] PARAMS = {
3150-
"end_time",
3151-
"session_id",
3152-
"start_time",
3153-
};
3154-
3155-
public static final String[] FIELDS = {
3156-
};
3157-
3158-
@Override
3159-
public Lead parseResponse(String response, String header) throws APIException {
3160-
return Lead.parseResponse(response, getContext(), this, header).head();
3161-
}
3162-
3163-
@Override
3164-
public Lead execute() throws APIException {
3165-
return execute(new HashMap<String, Object>());
3166-
}
3167-
3168-
@Override
3169-
public Lead execute(Map<String, Object> extraParams) throws APIException {
3170-
ResponseWrapper rw = executeInternal(extraParams);
3171-
lastResponse = parseResponse(rw.getBody(), rw.getHeader());
3172-
return lastResponse;
3173-
}
3174-
3175-
public ListenableFuture<Lead> executeAsync() throws APIException {
3176-
return executeAsync(new HashMap<String, Object>());
3177-
};
3178-
3179-
public ListenableFuture<Lead> executeAsync(Map<String, Object> extraParams) throws APIException {
3180-
return Futures.transform(
3181-
executeAsyncInternal(extraParams),
3182-
new Function<ResponseWrapper, Lead>() {
3183-
public Lead apply(ResponseWrapper result) {
3184-
try {
3185-
return APIRequestCreateLead.this.parseResponse(result.getBody(), result.getHeader());
3186-
} catch (Exception e) {
3187-
throw new RuntimeException(e);
3188-
}
3189-
}
3190-
}
3191-
);
3192-
};
3193-
3194-
public APIRequestCreateLead(String nodeId, APIContext context) {
3195-
super(context, nodeId, "/leads", "POST", Arrays.asList(PARAMS));
3196-
}
3197-
3198-
@Override
3199-
public APIRequestCreateLead setParam(String param, Object value) {
3200-
setParamInternal(param, value);
3201-
return this;
3202-
}
3203-
3204-
@Override
3205-
public APIRequestCreateLead setParams(Map<String, Object> params) {
3206-
setParamsInternal(params);
3207-
return this;
3208-
}
3209-
3210-
3211-
public APIRequestCreateLead setEndTime (String endTime) {
3212-
this.setParam("end_time", endTime);
3213-
return this;
3214-
}
3215-
3216-
public APIRequestCreateLead setSessionId (String sessionId) {
3217-
this.setParam("session_id", sessionId);
3218-
return this;
3219-
}
3220-
3221-
public APIRequestCreateLead setStartTime (String startTime) {
3222-
this.setParam("start_time", startTime);
3223-
return this;
3224-
}
3225-
3226-
public APIRequestCreateLead requestAllFields () {
3227-
return this.requestAllFields(true);
3228-
}
3229-
3230-
public APIRequestCreateLead requestAllFields (boolean value) {
3231-
for (String field : FIELDS) {
3232-
this.requestField(field, value);
3233-
}
3234-
return this;
3235-
}
3236-
3237-
@Override
3238-
public APIRequestCreateLead requestFields (List<String> fields) {
3239-
return this.requestFields(fields, true);
3240-
}
3241-
3242-
@Override
3243-
public APIRequestCreateLead requestFields (List<String> fields, boolean value) {
3244-
for (String field : fields) {
3245-
this.requestField(field, value);
3246-
}
3247-
return this;
3248-
}
3249-
3250-
@Override
3251-
public APIRequestCreateLead requestField (String field) {
3252-
this.requestField(field, true);
3253-
return this;
3254-
}
3255-
3256-
@Override
3257-
public APIRequestCreateLead requestField (String field, boolean value) {
3258-
this.requestFieldInternal(field, value);
3259-
return this;
3260-
}
3261-
3262-
}
3263-
32643134
public static class APIRequestGetPreviews extends APIRequest<AdPreview> {
32653135

32663136
APINodeList<AdPreview> lastResponse = null;
@@ -3625,110 +3495,6 @@ public APIRequestGetTargetingSentenceLines requestTargetingsentencelinesField (b
36253495
}
36263496
}
36273497

3628-
public static class APIRequestDeleteTrackingTag extends APIRequest<APINode> {
3629-
3630-
APINodeList<APINode> lastResponse = null;
3631-
@Override
3632-
public APINodeList<APINode> getLastResponse() {
3633-
return lastResponse;
3634-
}
3635-
public static final String[] PARAMS = {
3636-
};
3637-
3638-
public static final String[] FIELDS = {
3639-
};
3640-
3641-
@Override
3642-
public APINodeList<APINode> parseResponse(String response, String header) throws APIException {
3643-
return APINode.parseResponse(response, getContext(), this, header);
3644-
}
3645-
3646-
@Override
3647-
public APINodeList<APINode> execute() throws APIException {
3648-
return execute(new HashMap<String, Object>());
3649-
}
3650-
3651-
@Override
3652-
public APINodeList<APINode> execute(Map<String, Object> extraParams) throws APIException {
3653-
ResponseWrapper rw = executeInternal(extraParams);
3654-
lastResponse = parseResponse(rw.getBody(),rw.getHeader());
3655-
return lastResponse;
3656-
}
3657-
3658-
public ListenableFuture<APINodeList<APINode>> executeAsync() throws APIException {
3659-
return executeAsync(new HashMap<String, Object>());
3660-
};
3661-
3662-
public ListenableFuture<APINodeList<APINode>> executeAsync(Map<String, Object> extraParams) throws APIException {
3663-
return Futures.transform(
3664-
executeAsyncInternal(extraParams),
3665-
new Function<ResponseWrapper, APINodeList<APINode>>() {
3666-
public APINodeList<APINode> apply(ResponseWrapper result) {
3667-
try {
3668-
return APIRequestDeleteTrackingTag.this.parseResponse(result.getBody(), result.getHeader());
3669-
} catch (Exception e) {
3670-
throw new RuntimeException(e);
3671-
}
3672-
}
3673-
}
3674-
);
3675-
};
3676-
3677-
public APIRequestDeleteTrackingTag(String nodeId, APIContext context) {
3678-
super(context, nodeId, "/trackingtag", "DELETE", Arrays.asList(PARAMS));
3679-
}
3680-
3681-
@Override
3682-
public APIRequestDeleteTrackingTag setParam(String param, Object value) {
3683-
setParamInternal(param, value);
3684-
return this;
3685-
}
3686-
3687-
@Override
3688-
public APIRequestDeleteTrackingTag setParams(Map<String, Object> params) {
3689-
setParamsInternal(params);
3690-
return this;
3691-
}
3692-
3693-
3694-
public APIRequestDeleteTrackingTag requestAllFields () {
3695-
return this.requestAllFields(true);
3696-
}
3697-
3698-
public APIRequestDeleteTrackingTag requestAllFields (boolean value) {
3699-
for (String field : FIELDS) {
3700-
this.requestField(field, value);
3701-
}
3702-
return this;
3703-
}
3704-
3705-
@Override
3706-
public APIRequestDeleteTrackingTag requestFields (List<String> fields) {
3707-
return this.requestFields(fields, true);
3708-
}
3709-
3710-
@Override
3711-
public APIRequestDeleteTrackingTag requestFields (List<String> fields, boolean value) {
3712-
for (String field : fields) {
3713-
this.requestField(field, value);
3714-
}
3715-
return this;
3716-
}
3717-
3718-
@Override
3719-
public APIRequestDeleteTrackingTag requestField (String field) {
3720-
this.requestField(field, true);
3721-
return this;
3722-
}
3723-
3724-
@Override
3725-
public APIRequestDeleteTrackingTag requestField (String field, boolean value) {
3726-
this.requestFieldInternal(field, value);
3727-
return this;
3728-
}
3729-
3730-
}
3731-
37323498
public static class APIRequestCreateTrackingTag extends APIRequest<APINode> {
37333499

37343500
APINode lastResponse = null;

0 commit comments

Comments
 (0)