Skip to content

Commit ae187f6

Browse files
generatedunixname89002005295453facebook-github-bot
generatedunixname89002005295453
authored andcommitted
Auto-generated java SDK code update
Summary: ignore-conflict-markers Reviewed By: jingping2015 Differential Revision: D21239174 fbshipit-source-id: 3bb139a7
1 parent 5174d6f commit ae187f6

File tree

63 files changed

+1339
-3552
lines changed

Some content is hidden

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

63 files changed

+1339
-3552
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
3+
*
4+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
5+
* use, copy, modify, and distribute this software in source code or binary
6+
* form for use in connection with the web services and APIs provided by
7+
* Facebook.
8+
*
9+
* As with any software that integrates with the Facebook platform, your use
10+
* of this software is subject to the Facebook Developer Principles and
11+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
12+
* shall be included in all copies or substantial portions of the software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20+
* DEALINGS IN THE SOFTWARE.
21+
*
22+
*/
23+
24+
import com.facebook.ads.sdk.*;
25+
import java.io.File;
26+
import java.util.Arrays;
27+
28+
public class AdAccountAdCreativesPost2CreateAdCreativeLinkAd {
29+
public static void main (String args[]) throws APIException {
30+
31+
String access_token = "<ACCESS_TOKEN>";
32+
String app_secret = "<APP_SECRET>";
33+
String app_id = "<APP_ID>";
34+
String id = "<AD_ACCOUNT_ID>";
35+
APIContext context = new APIContext(access_token).enableDebug(true);
36+
37+
new AdAccount(id, context).createAdCreative()
38+
.setName("Sample Creative")
39+
.setObjectStorySpec(
40+
new AdCreativeObjectStorySpec()
41+
.setFieldLinkData(
42+
new AdCreativeLinkData()
43+
.setFieldImageHash("<imageHash>")
44+
.setFieldLink("https://facebook.com/<pageID>")
45+
.setFieldMessage("try it out")
46+
)
47+
.setFieldPageId("<pageID>")
48+
)
49+
.execute();
50+
51+
}
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
3+
*
4+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
5+
* use, copy, modify, and distribute this software in source code or binary
6+
* form for use in connection with the web services and APIs provided by
7+
* Facebook.
8+
*
9+
* As with any software that integrates with the Facebook platform, your use
10+
* of this software is subject to the Facebook Developer Principles and
11+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
12+
* shall be included in all copies or substantial portions of the software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20+
* DEALINGS IN THE SOFTWARE.
21+
*
22+
*/
23+
24+
import com.facebook.ads.sdk.*;
25+
import java.io.File;
26+
import java.util.Arrays;
27+
28+
public class AdAccountAdCreativesPost2CreateCarouselCallToActionAppInstall {
29+
public static void main (String args[]) throws APIException {
30+
31+
String access_token = "<ACCESS_TOKEN>";
32+
String app_secret = "<APP_SECRET>";
33+
String app_id = "<APP_ID>";
34+
String id = "<AD_ACCOUNT_ID>";
35+
APIContext context = new APIContext(access_token).enableDebug(true);
36+
37+
new AdAccount(id, context).createAdCreative()
38+
.setName("Carousel app ad")
39+
.setObjectStorySpec(
40+
new AdCreativeObjectStorySpec()
41+
.setFieldLinkData(
42+
new AdCreativeLinkData()
43+
.setFieldCaption("WWW.ITUNES.COM")
44+
.setFieldChildAttachments(Arrays.asList(
45+
new AdCreativeLinkDataChildAttachment()
46+
.setFieldCallToAction(
47+
new AdCreativeLinkDataCallToAction()
48+
.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_USE_MOBILE_APP)
49+
.setFieldValue(
50+
new AdCreativeLinkDataCallToActionValue()
51+
.setFieldAppLink("<deepLink>")
52+
)
53+
)
54+
.setFieldImageHash("<imageHash>")
55+
.setFieldLink("http://www.example.com/appstoreurl")
56+
,
57+
new AdCreativeLinkDataChildAttachment()
58+
.setFieldCallToAction(
59+
new AdCreativeLinkDataCallToAction()
60+
.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_USE_MOBILE_APP)
61+
.setFieldValue(
62+
new AdCreativeLinkDataCallToActionValue()
63+
.setFieldAppLink("<deepLink>")
64+
)
65+
)
66+
.setFieldImageHash("<imageHash>")
67+
.setFieldLink("http://www.example.com/appstoreurl")
68+
,
69+
new AdCreativeLinkDataChildAttachment()
70+
.setFieldCallToAction(
71+
new AdCreativeLinkDataCallToAction()
72+
.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_USE_MOBILE_APP)
73+
.setFieldValue(
74+
new AdCreativeLinkDataCallToActionValue()
75+
.setFieldAppLink("<deepLink>")
76+
)
77+
)
78+
.setFieldImageHash("<imageHash>")
79+
.setFieldLink("http://www.example.com/appstoreurl")
80+
,
81+
new AdCreativeLinkDataChildAttachment()
82+
.setFieldCallToAction(
83+
new AdCreativeLinkDataCallToAction()
84+
.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_USE_MOBILE_APP)
85+
.setFieldValue(
86+
new AdCreativeLinkDataCallToActionValue()
87+
.setFieldAppLink("<deepLink>")
88+
)
89+
)
90+
.setFieldImageHash("<imageHash>")
91+
.setFieldLink("http://www.example.com/appstoreurl")
92+
))
93+
.setFieldDescription("The link description")
94+
.setFieldLink("http://www.example.com/appstoreurl")
95+
.setFieldMessage("My message")
96+
.setFieldMultiShareOptimized(true)
97+
.setFieldName("The link name")
98+
)
99+
.setFieldPageId("<pageID>")
100+
)
101+
.execute();
102+
103+
}
104+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
3+
*
4+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
5+
* use, copy, modify, and distribute this software in source code or binary
6+
* form for use in connection with the web services and APIs provided by
7+
* Facebook.
8+
*
9+
* As with any software that integrates with the Facebook platform, your use
10+
* of this software is subject to the Facebook Developer Principles and
11+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
12+
* shall be included in all copies or substantial portions of the software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20+
* DEALINGS IN THE SOFTWARE.
21+
*
22+
*/
23+
24+
import com.facebook.ads.sdk.*;
25+
import java.io.File;
26+
import java.util.Arrays;
27+
28+
public class AdAccountAdCreativesPost2CreateLinkAdCallToActionAppInstall {
29+
public static void main (String args[]) throws APIException {
30+
31+
String access_token = "<ACCESS_TOKEN>";
32+
String app_secret = "<APP_SECRET>";
33+
String app_id = "<APP_ID>";
34+
String id = "<AD_ACCOUNT_ID>";
35+
APIContext context = new APIContext(access_token).enableDebug(true);
36+
37+
new AdAccount(id, context).createAdCreative()
38+
.setName("Sample Creative")
39+
.setObjectStorySpec(
40+
new AdCreativeObjectStorySpec()
41+
.setFieldLinkData(
42+
new AdCreativeLinkData()
43+
.setFieldCallToAction(
44+
new AdCreativeLinkDataCallToAction()
45+
.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_INSTALL_MOBILE_APP)
46+
.setFieldValue(
47+
new AdCreativeLinkDataCallToActionValue()
48+
.setFieldLink("<appLink>")
49+
)
50+
)
51+
.setFieldImageHash("<imageHash>")
52+
.setFieldLink("<appLink>")
53+
.setFieldMessage("Try it out")
54+
)
55+
.setFieldPageId("<pageID>")
56+
)
57+
.execute();
58+
59+
}
60+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
3+
*
4+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
5+
* use, copy, modify, and distribute this software in source code or binary
6+
* form for use in connection with the web services and APIs provided by
7+
* Facebook.
8+
*
9+
* As with any software that integrates with the Facebook platform, your use
10+
* of this software is subject to the Facebook Developer Principles and
11+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
12+
* shall be included in all copies or substantial portions of the software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20+
* DEALINGS IN THE SOFTWARE.
21+
*
22+
*/
23+
24+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
3+
*
4+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
5+
* use, copy, modify, and distribute this software in source code or binary
6+
* form for use in connection with the web services and APIs provided by
7+
* Facebook.
8+
*
9+
* As with any software that integrates with the Facebook platform, your use
10+
* of this software is subject to the Facebook Developer Principles and
11+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
12+
* shall be included in all copies or substantial portions of the software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20+
* DEALINGS IN THE SOFTWARE.
21+
*
22+
*/
23+
24+
import com.facebook.ads.sdk.*;
25+
import java.io.File;
26+
import java.util.Arrays;
27+
28+
public class AdAccountAdCreativesPost2CreateMAIDPA {
29+
public static void main (String args[]) throws APIException {
30+
31+
String access_token = "<ACCESS_TOKEN>";
32+
String app_secret = "<APP_SECRET>";
33+
String app_id = "<APP_ID>";
34+
String id = "<AD_ACCOUNT_ID>";
35+
APIContext context = new APIContext(access_token).enableDebug(true);
36+
37+
new AdAccount(id, context).createAdCreative()
38+
.setName("Dynamic Ad Template Creative Sample")
39+
.setObjectStorySpec(
40+
new AdCreativeObjectStorySpec()
41+
.setFieldPageId("<pageID>")
42+
.setFieldTemplateData(
43+
new AdCreativeLinkData()
44+
.setFieldCallToAction(
45+
new AdCreativeLinkDataCallToAction()
46+
.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_INSTALL_MOBILE_APP)
47+
.setFieldValue(
48+
new AdCreativeLinkDataCallToActionValue()
49+
.setFieldLink("http://www.example.com/appstoreurl")
50+
)
51+
)
52+
.setFieldDescription("Description {{product.description}}")
53+
.setFieldLink("http://www.example.com/appstoreurl")
54+
.setFieldMessage("Test {{product.name | titleize}}")
55+
.setFieldName("Headline {{product.price}}")
56+
)
57+
)
58+
.setProductSetId("<productSetID>")
59+
.execute();
60+
61+
}
62+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
3+
*
4+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
5+
* use, copy, modify, and distribute this software in source code or binary
6+
* form for use in connection with the web services and APIs provided by
7+
* Facebook.
8+
*
9+
* As with any software that integrates with the Facebook platform, your use
10+
* of this software is subject to the Facebook Developer Principles and
11+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
12+
* shall be included in all copies or substantial portions of the software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20+
* DEALINGS IN THE SOFTWARE.
21+
*
22+
*/
23+
24+
import com.facebook.ads.sdk.*;
25+
import java.io.File;
26+
import java.util.Arrays;
27+
28+
public class AdAccountAdCreativesPost2CreateVideoLeadAd {
29+
public static void main (String args[]) throws APIException {
30+
31+
String access_token = "<ACCESS_TOKEN>";
32+
String app_secret = "<APP_SECRET>";
33+
String app_id = "<APP_ID>";
34+
String id = "<AD_ACCOUNT_ID>";
35+
APIContext context = new APIContext(access_token).enableDebug(true);
36+
37+
new AdAccount(id, context).createAdCreative()
38+
.setObjectStorySpec(
39+
new AdCreativeObjectStorySpec()
40+
.setFieldPageId("<pageID>")
41+
.setFieldVideoData(
42+
new AdCreativeVideoData()
43+
.setFieldCallToAction(
44+
new AdCreativeLinkDataCallToAction()
45+
.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_SIGN_UP)
46+
.setFieldValue(
47+
new AdCreativeLinkDataCallToActionValue()
48+
.setFieldLeadGenFormId("<formID>")
49+
.setFieldLink("http://fb.me/")
50+
)
51+
)
52+
.setFieldImageUrl("<imageURL>")
53+
.setFieldLinkDescription("try it out")
54+
.setFieldVideoId("<videoID>")
55+
)
56+
)
57+
.execute();
58+
59+
}
60+
}

0 commit comments

Comments
 (0)