Skip to content

Commit 760ac06

Browse files
authored
Merge pull request #217 from BingAds/v13.0.24.1
v13.0.24.1
2 parents c308fd3 + 283cfb5 commit 760ac06

File tree

10 files changed

+133
-6
lines changed

10 files changed

+133
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The Bing Ads Java SDK includes and depends on the microsoft.bingads Maven artifa
1616
<dependency>
1717
<groupId>com.microsoft.bingads</groupId>
1818
<artifactId>microsoft.bingads</artifactId>
19-
<version>13.0.24</version>
19+
<version>13.0.24.1</version>
2020
</dependency>
2121
```
2222
If you are not using a Maven project, you must include the correct version of each dependency. You can review the complete list of Bing Ads Java SDK dependencies at the [Maven Repository](http://mvnrepository.com/artifact/com.microsoft.bingads/microsoft.bingads/).

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.microsoft.bingads</groupId>
4-
<version>13.0.24</version>
4+
<version>13.0.24.1</version>
55
<name>Bing Ads Java SDK</name>
66
<description>The Bing Ads Java SDK is a library improving developer experience when working with the Bing Ads services by providing high-level access to features such as Bulk API, OAuth Authorization and SOAP API.</description>
77
<url>https://github.com/BingAds/BingAds-Java-SDK</url>

src/main/java/com/microsoft/bingads/internal/ServiceFactoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
public class ServiceFactoryImpl implements ServiceFactory {
2929

30-
public static final String VERSION = "13.0.24";
30+
public static final String VERSION = "13.0.24.1";
3131

3232
private static final int DEFAULT_WS_CREATE_TIMEOUT_IN_SECOND = 60;
3333

src/main/java/com/microsoft/bingads/v13/bulk/entities/BulkCampaign.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ public void accept(String v, BulkCampaign c) {
14231423
if (setting == null) {
14241424
return;
14251425
}
1426-
((NewCustomerAcquisitionGoalSetting)setting).setNewCustomerAcquisitionGoalId(v == null ? null : Long.parseLong(v));
1426+
((NewCustomerAcquisitionGoalSetting)setting).setNewCustomerAcquisitionGoalId(v == null || v.isEmpty() ? null : Long.parseLong(v));
14271427
}
14281428
}
14291429
));

src/main/java/com/microsoft/bingads/v13/bulk/entities/BulkKeyword.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
*/
5151
public class BulkKeyword extends SingleRecordBulkEntity {
5252

53+
private Long campaignId;
54+
5355
private Long adGroupId;
5456

5557
private Keyword keyword;
@@ -81,6 +83,26 @@ public void accept(String v, BulkKeyword c) {
8183
}
8284
}
8385
));
86+
87+
m.add(new SimpleBulkMapping<BulkKeyword, Long>(StringTable.CampaignId,
88+
new Function<BulkKeyword, Long>() {
89+
@Override
90+
public Long apply(BulkKeyword c) {
91+
return c.getCampaignId();
92+
}
93+
},
94+
new BiConsumer<String, BulkKeyword>() {
95+
@Override
96+
public void accept(String v, BulkKeyword c) {
97+
c.setCampaignId(StringExtensions.<Long>parseOptional(v, new Function<String, Long>() {
98+
@Override
99+
public Long apply(String value) {
100+
return Long.parseLong(value);
101+
}
102+
}));
103+
}
104+
}
105+
));
84106

85107
m.add(new SimpleBulkMapping<BulkKeyword, Long>(StringTable.ParentId,
86108
new Function<BulkKeyword, Long>() {
@@ -487,6 +509,28 @@ public void writeAdditionalData(BulkObjectWriter writer) throws IOException {
487509
BulkKeywordBidSuggestion.writeIfNotNull(getBidSuggestions().getFirstPage(), writer);
488510
}
489511
}
512+
513+
/**
514+
* Gets the identifier of the campaign that contains the keyword.
515+
*
516+
* <p>
517+
* Corresponds to the 'Campaign Id' field in the bulk file.
518+
* </p>
519+
*/
520+
public Long getCampaignId() {
521+
return campaignId;
522+
}
523+
524+
/**
525+
* Sets the identifier of the ad group that contains the keyword.
526+
*
527+
* <p>
528+
* Corresponds to the 'Campaign Id' field in the bulk file.
529+
* </p>
530+
*/
531+
public void setCampaignId(Long campaignId) {
532+
this.campaignId = campaignId;
533+
}
490534

491535
/**
492536
* Gets the identifier of the ad group that contains the keyword.

src/test/java/com/microsoft/bingads/v13/api/test/entities/campaign/read/BulkCampaignReadFromRowValuesNewCustomerAcquisitionGoalSettingsTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,18 @@ public static Collection<Object[]> data() {
4949
setting2.setNewCustomerAcquisitionBidOnlyMode(true);
5050
setting2.setNewCustomerAcquisitionGoalId(Long.MAX_VALUE);
5151
setting2.setType("NewCustomerAcquisitionGoalSetting");
52+
53+
NewCustomerAcquisitionGoalSetting setting3 = new NewCustomerAcquisitionGoalSetting();
54+
setting3.setAdditionalConversionValue(null);
55+
setting3.setNewCustomerAcquisitionBidOnlyMode(false);
56+
setting3.setNewCustomerAcquisitionGoalId(null);
57+
setting3.setType("NewCustomerAcquisitionGoalSetting");
5258

5359
return Arrays.asList(
5460
new Object[][]{
5561
{"PerformanceMax", "123.45", "false", "123", Collections.singletonList(setting1)},
5662
{"PerformanceMax", "123.45", "true", "9223372036854775807", Collections.singletonList(setting2)},
63+
{"PerformanceMax", "", "", "", Collections.singletonList(setting3)}
5764
}
5865
);
5966
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.microsoft.bingads.v13.api.test.entities.keyword.read;
2+
3+
import java.util.Arrays;
4+
import java.util.Collection;
5+
6+
import org.junit.Test;
7+
import org.junit.runners.Parameterized.Parameter;
8+
import org.junit.runners.Parameterized.Parameters;
9+
10+
import com.microsoft.bingads.internal.functionalinterfaces.Function;
11+
import com.microsoft.bingads.v13.api.test.entities.keyword.BulkKeywordTest;
12+
import com.microsoft.bingads.v13.bulk.entities.BulkKeyword;
13+
14+
public class BulkKeywordReadFromRowValuesCampaignIdTest extends BulkKeywordTest {
15+
16+
@Parameter(value = 1)
17+
public Long expectedResult;
18+
19+
@Parameters
20+
public static Collection<Object[]> data() {
21+
return Arrays.asList(new Object[][]{
22+
{"123", 123L},
23+
{"9223372036854775807", 9223372036854775807L},});
24+
}
25+
26+
@Test
27+
public void testRead() {
28+
this.<Long>testReadProperty("Campaign Id", this.datum, this.expectedResult, new Function<BulkKeyword, Long>() {
29+
@Override
30+
public Long apply(BulkKeyword c) {
31+
return c.getCampaignId();
32+
}
33+
});
34+
}
35+
}

src/test/java/com/microsoft/bingads/v13/api/test/entities/keyword/read/BulkKeywordReadTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
BulkKeywordReadFromRowValuesStatusTest.class,
2121
BulkKeywordReadFromRowValuesTextTest.class,
2222
BulkKeywordReadFromRowValuesBidStrategyTypeTest.class,
23-
BulkKeywordReadFromRowValuesFinalUrlSuffixTest.class})
23+
BulkKeywordReadFromRowValuesFinalUrlSuffixTest.class,
24+
BulkKeywordReadFromRowValuesCampaignIdTest.class})
2425
public class BulkKeywordReadTests {
2526

2627
}

src/test/java/com/microsoft/bingads/v13/api/test/entities/keyword/write/BulkKeywordWriteTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
BulkKeywordWriteToRowValuesStatusTest.class,
1717
BulkKeywordWriteToRowValuesTextTest.class,
1818
BulkKeywordWriteToRowValuesBidStrategyTypeTest.class,
19-
BulkKeywordWriteToRowValuesFinalUrlSuffixTest.class})
19+
BulkKeywordWriteToRowValuesFinalUrlSuffixTest.class,
20+
BulkKeywordWriteToRowValuesCampaignIdTest.class})
2021
public class BulkKeywordWriteTests {
2122

2223
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.microsoft.bingads.v13.api.test.entities.keyword.write;
2+
3+
import java.util.Arrays;
4+
import java.util.Collection;
5+
6+
import org.junit.Test;
7+
import org.junit.runner.RunWith;
8+
import org.junit.runners.Parameterized;
9+
import org.junit.runners.Parameterized.Parameter;
10+
import org.junit.runners.Parameterized.Parameters;
11+
12+
import com.microsoft.bingads.internal.functionalinterfaces.BiConsumer;
13+
import com.microsoft.bingads.v13.api.test.entities.keyword.BulkKeywordTest;
14+
import com.microsoft.bingads.v13.bulk.entities.BulkKeyword;
15+
16+
@RunWith(Parameterized.class)
17+
public class BulkKeywordWriteToRowValuesCampaignIdTest extends BulkKeywordTest {
18+
19+
@Parameter(value = 1)
20+
public Long propertyValue;
21+
22+
@Parameters
23+
public static Collection<Object[]> data() {
24+
return Arrays.asList(new Object[][]{
25+
{"123", 123L},
26+
{"9223372036854775807", 9223372036854775807L}
27+
});
28+
}
29+
30+
@Test
31+
public void testWrite() {
32+
this.<Long>testWriteProperty("Campaign Id", this.datum, this.propertyValue, new BiConsumer<BulkKeyword, Long>() {
33+
@Override
34+
public void accept(BulkKeyword c, Long v) {
35+
c.setCampaignId(v);
36+
}
37+
});
38+
}
39+
}

0 commit comments

Comments
 (0)