Skip to content

Commit e333bdb

Browse files
Merge pull request #949 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 55c0f3c + 9d9ad10 commit e333bdb

File tree

9 files changed

+169
-19
lines changed

9 files changed

+169
-19
lines changed

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/recurrence_policy/DayOfMonthSchedule.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ public interface DayOfMonthSchedule extends RecurrencePolicySchedule {
3737
*/
3838
String DAY_OF_MONTH = "dayOfMonth";
3939

40-
/**
41-
*
42-
* @return type
43-
*/
44-
@NotNull
45-
@JsonProperty("type")
46-
public String getType();
47-
4840
/**
4941
* <p>The day of the month when the Recurring Order is created. If the value is greater than the number of days in a given month, the order is created on the last day of the month.</p>
5042
* @return day

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/recurrence_policy/DayOfMonthScheduleDraft.java

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,16 @@
3131
* </code></pre>
3232
* </div>
3333
*/
34+
@io.vrap.rmf.base.client.utils.json.SubType("dayOfMonth")
3435
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
36+
@JsonDeserialize(as = DayOfMonthScheduleDraftImpl.class)
3537
public interface DayOfMonthScheduleDraft
3638
extends RecurrencePolicyScheduleDraft, io.vrap.rmf.base.client.Draft<DayOfMonthScheduleDraft> {
3739

3840
/**
39-
*
40-
* @return type
41+
* discriminator value for DayOfMonthScheduleDraft
4142
*/
42-
@NotNull
43-
@JsonProperty("type")
44-
public String getType();
43+
String DAY_OF_MONTH = "dayOfMonth";
4544

4645
/**
4746
* <p>The day of the month when the Recurring Order should be created. If the value is greater than the number of days in a given month, the order will be created on the last day of the month.</p>
@@ -58,6 +57,25 @@ public interface DayOfMonthScheduleDraft
5857

5958
public void setDay(final Integer day);
6059

60+
/**
61+
* factory method
62+
* @return instance of DayOfMonthScheduleDraft
63+
*/
64+
public static DayOfMonthScheduleDraft of() {
65+
return new DayOfMonthScheduleDraftImpl();
66+
}
67+
68+
/**
69+
* factory method to create a shallow copy DayOfMonthScheduleDraft
70+
* @param template instance to be copied
71+
* @return copy instance
72+
*/
73+
public static DayOfMonthScheduleDraft of(final DayOfMonthScheduleDraft template) {
74+
DayOfMonthScheduleDraftImpl instance = new DayOfMonthScheduleDraftImpl();
75+
instance.setDay(template.getDay());
76+
return instance;
77+
}
78+
6179
public DayOfMonthScheduleDraft copyDeep();
6280

6381
/**
@@ -75,6 +93,23 @@ public static DayOfMonthScheduleDraft deepCopy(@Nullable final DayOfMonthSchedul
7593
return instance;
7694
}
7795

96+
/**
97+
* builder factory method for DayOfMonthScheduleDraft
98+
* @return builder
99+
*/
100+
public static DayOfMonthScheduleDraftBuilder builder() {
101+
return DayOfMonthScheduleDraftBuilder.of();
102+
}
103+
104+
/**
105+
* create builder for DayOfMonthScheduleDraft instance
106+
* @param template instance with prefilled values for the builder
107+
* @return builder
108+
*/
109+
public static DayOfMonthScheduleDraftBuilder builder(final DayOfMonthScheduleDraft template) {
110+
return DayOfMonthScheduleDraftBuilder.of(template);
111+
}
112+
78113
/**
79114
* accessor map function
80115
* @param <T> mapped type
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
2+
package com.commercetools.api.models.recurrence_policy;
3+
4+
import java.util.*;
5+
6+
import io.vrap.rmf.base.client.Builder;
7+
import io.vrap.rmf.base.client.utils.Generated;
8+
9+
/**
10+
* DayOfMonthScheduleDraftBuilder
11+
* <hr>
12+
* Example to create an instance using the builder pattern
13+
* <div class=code-example>
14+
* <pre><code class='java'>
15+
* DayOfMonthScheduleDraft dayOfMonthScheduleDraft = DayOfMonthScheduleDraft.builder()
16+
* .day(1)
17+
* .build()
18+
* </code></pre>
19+
* </div>
20+
*/
21+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
22+
public class DayOfMonthScheduleDraftBuilder implements Builder<DayOfMonthScheduleDraft> {
23+
24+
private Integer day;
25+
26+
/**
27+
* <p>The day of the month when the Recurring Order should be created. If the value is greater than the number of days in a given month, the order will be created on the last day of the month.</p>
28+
* @param day value to be set
29+
* @return Builder
30+
*/
31+
32+
public DayOfMonthScheduleDraftBuilder day(final Integer day) {
33+
this.day = day;
34+
return this;
35+
}
36+
37+
/**
38+
* <p>The day of the month when the Recurring Order should be created. If the value is greater than the number of days in a given month, the order will be created on the last day of the month.</p>
39+
* @return day
40+
*/
41+
42+
public Integer getDay() {
43+
return this.day;
44+
}
45+
46+
/**
47+
* builds DayOfMonthScheduleDraft with checking for non-null required values
48+
* @return DayOfMonthScheduleDraft
49+
*/
50+
public DayOfMonthScheduleDraft build() {
51+
Objects.requireNonNull(day, DayOfMonthScheduleDraft.class + ": day is missing");
52+
return new DayOfMonthScheduleDraftImpl(day);
53+
}
54+
55+
/**
56+
* builds DayOfMonthScheduleDraft without checking for non-null required values
57+
* @return DayOfMonthScheduleDraft
58+
*/
59+
public DayOfMonthScheduleDraft buildUnchecked() {
60+
return new DayOfMonthScheduleDraftImpl(day);
61+
}
62+
63+
/**
64+
* factory method for an instance of DayOfMonthScheduleDraftBuilder
65+
* @return builder
66+
*/
67+
public static DayOfMonthScheduleDraftBuilder of() {
68+
return new DayOfMonthScheduleDraftBuilder();
69+
}
70+
71+
/**
72+
* create builder for DayOfMonthScheduleDraft instance
73+
* @param template instance with prefilled values for the builder
74+
* @return builder
75+
*/
76+
public static DayOfMonthScheduleDraftBuilder of(final DayOfMonthScheduleDraft template) {
77+
DayOfMonthScheduleDraftBuilder builder = new DayOfMonthScheduleDraftBuilder();
78+
builder.day = template.getDay();
79+
return builder;
80+
}
81+
82+
}

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/recurrence_policy/DayOfMonthScheduleDraftImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ public class DayOfMonthScheduleDraftImpl implements DayOfMonthScheduleDraft, Mod
3434
* create instance with all properties
3535
*/
3636
@JsonCreator
37-
DayOfMonthScheduleDraftImpl(@JsonProperty("type") final String type, @JsonProperty("day") final Integer day) {
38-
this.type = type;
37+
DayOfMonthScheduleDraftImpl(@JsonProperty("day") final Integer day) {
3938
this.day = day;
39+
this.type = DAY_OF_MONTH;
4040
}
4141

4242
/**
4343
* create empty instance
4444
*/
4545
public DayOfMonthScheduleDraftImpl() {
46+
this.type = DAY_OF_MONTH;
4647
}
4748

4849
/**

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/recurrence_policy/RecurrencePolicyScheduleDraft.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
* Example to create a subtype instance using the builder pattern
2222
* <div class=code-example>
2323
* <pre><code class='java'>
24-
* RecurrencePolicyScheduleDraft recurrencePolicyScheduleDraft = RecurrencePolicyScheduleDraft.standardBuilder()
25-
* value(0.3)
26-
* intervalUnit(IntervalUnit.DAYS)
24+
* RecurrencePolicyScheduleDraft recurrencePolicyScheduleDraft = RecurrencePolicyScheduleDraft.dayOfMonthBuilder()
25+
* day(1)
2726
* .build()
2827
* </code></pre>
2928
* </div>
@@ -61,6 +60,14 @@ public static RecurrencePolicyScheduleDraft deepCopy(@Nullable final RecurrenceP
6160
return instance;
6261
}
6362

63+
/**
64+
* builder for dayOfMonth subtype
65+
* @return builder
66+
*/
67+
public static com.commercetools.api.models.recurrence_policy.DayOfMonthScheduleDraftBuilder dayOfMonthBuilder() {
68+
return com.commercetools.api.models.recurrence_policy.DayOfMonthScheduleDraftBuilder.of();
69+
}
70+
6471
/**
6572
* builder for standard subtype
6673
* @return builder

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/recurrence_policy/RecurrencePolicyScheduleDraftBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
1212
public class RecurrencePolicyScheduleDraftBuilder {
1313

14+
public com.commercetools.api.models.recurrence_policy.DayOfMonthScheduleDraftBuilder dayOfMonthBuilder() {
15+
return com.commercetools.api.models.recurrence_policy.DayOfMonthScheduleDraftBuilder.of();
16+
}
17+
1418
public com.commercetools.api.models.recurrence_policy.StandardScheduleDraftBuilder standardBuilder() {
1519
return com.commercetools.api.models.recurrence_policy.StandardScheduleDraftBuilder.of();
1620
}

commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/recurrence_policy/RecurrencePolicyScheduleDraftQueryBuilderDsl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public StringComparisonPredicateBuilder<RecurrencePolicyScheduleDraftQueryBuilde
1919
p -> new CombinationQueryPredicate<>(p, RecurrencePolicyScheduleDraftQueryBuilderDsl::of));
2020
}
2121

22-
public CombinationQueryPredicate<RecurrencePolicyScheduleDraftQueryBuilderDsl> asDayOfMonthScheduleDraft(
22+
public CombinationQueryPredicate<RecurrencePolicyScheduleDraftQueryBuilderDsl> asDayOfMonth(
2323
Function<com.commercetools.api.predicates.query.recurrence_policy.DayOfMonthScheduleDraftQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.recurrence_policy.DayOfMonthScheduleDraftQueryBuilderDsl>> fn) {
2424
return new CombinationQueryPredicate<>(
2525
fn.apply(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
package com.commercetools.api.models.recurrence_policy;
3+
4+
import org.assertj.core.api.Assertions;
5+
import org.junit.jupiter.api.Test;
6+
import org.junit.jupiter.params.ParameterizedTest;
7+
import org.junit.jupiter.params.provider.MethodSource;
8+
9+
public class DayOfMonthScheduleDraftTest {
10+
11+
@ParameterizedTest(name = "#{index} with {0}")
12+
@MethodSource("objectBuilder")
13+
public void buildUnchecked(String name, DayOfMonthScheduleDraftBuilder builder) {
14+
DayOfMonthScheduleDraft dayOfMonthScheduleDraft = builder.buildUnchecked();
15+
Assertions.assertThat(dayOfMonthScheduleDraft).isInstanceOf(DayOfMonthScheduleDraft.class);
16+
}
17+
18+
public static Object[][] objectBuilder() {
19+
return new Object[][] { new Object[] { "day", DayOfMonthScheduleDraft.builder().day(5) } };
20+
}
21+
22+
@Test
23+
public void day() {
24+
DayOfMonthScheduleDraft value = DayOfMonthScheduleDraft.of();
25+
value.setDay(5);
26+
Assertions.assertThat(value.getDay()).isEqualTo(5);
27+
}
28+
}

references.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,3 +442,4 @@ c12d33dda145602c607dcf1bb77f503f4508a1ee
442442
cd07396232802b1c29238fb92214946462f19e5d
443443
75be7d69ebbeef0c07001c09c4c84e318aead40c
444444
53775bb9cfdee1169d81256fcf9b33ce5718b6e5
445+
0e52ed3672e48fed855eed94497de9b16e7a50fa

0 commit comments

Comments
 (0)