Skip to content

Commit d308fb1

Browse files
mikemillacodegen
andauthored
chore(api): regenerate SDK (#181)
Co-authored-by: courier-codegen <codegen@users.noreply.github.com>
1 parent b316c55 commit d308fb1

39 files changed

Lines changed: 4077 additions & 16 deletions

‎courier-java-core/src/test/kotlin/com/courier/models/ElementalActionNodeWithTypeTest.kt‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
package com.courier.models
44

5+
import com.courier.core.JsonValue
56
import com.courier.core.jsonMapper
67
import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
8+
import kotlin.jvm.optionals.getOrNull
79
import org.assertj.core.api.Assertions.assertThat
810
import org.junit.jupiter.api.Test
911

@@ -13,9 +15,50 @@ internal class ElementalActionNodeWithTypeTest {
1315
fun create() {
1416
val elementalActionNodeWithType =
1517
ElementalActionNodeWithType.builder()
18+
.addChannel("string")
19+
.if_("if")
20+
.loop("loop")
21+
.ref("ref")
22+
.content("content")
23+
.href("href")
24+
.actionId("action_id")
25+
.align(Alignment.CENTER)
26+
.backgroundColor("background_color")
27+
.borderRadius("border_radius")
28+
.borderSize("border_size")
29+
.disableTracking(true)
30+
.fontSize("font_size")
31+
.locales(
32+
Locales.builder()
33+
.putAdditionalProperty("foo", JsonValue.from(mapOf("content" to "content")))
34+
.build()
35+
)
36+
.padding("padding")
37+
.style(ElementalActionNode.Style.BUTTON)
1638
.type(ElementalActionNodeWithType.Type.ACTION)
1739
.build()
1840

41+
assertThat(elementalActionNodeWithType.channels().getOrNull()).containsExactly("string")
42+
assertThat(elementalActionNodeWithType.if_()).contains("if")
43+
assertThat(elementalActionNodeWithType.loop()).contains("loop")
44+
assertThat(elementalActionNodeWithType.ref()).contains("ref")
45+
assertThat(elementalActionNodeWithType.content()).isEqualTo("content")
46+
assertThat(elementalActionNodeWithType.href()).isEqualTo("href")
47+
assertThat(elementalActionNodeWithType.actionId()).contains("action_id")
48+
assertThat(elementalActionNodeWithType.align()).contains(Alignment.CENTER)
49+
assertThat(elementalActionNodeWithType.backgroundColor()).contains("background_color")
50+
assertThat(elementalActionNodeWithType.borderRadius()).contains("border_radius")
51+
assertThat(elementalActionNodeWithType.borderSize()).contains("border_size")
52+
assertThat(elementalActionNodeWithType.disableTracking()).contains(true)
53+
assertThat(elementalActionNodeWithType.fontSize()).contains("font_size")
54+
assertThat(elementalActionNodeWithType.locales())
55+
.contains(
56+
Locales.builder()
57+
.putAdditionalProperty("foo", JsonValue.from(mapOf("content" to "content")))
58+
.build()
59+
)
60+
assertThat(elementalActionNodeWithType.padding()).contains("padding")
61+
assertThat(elementalActionNodeWithType.style()).contains(ElementalActionNode.Style.BUTTON)
1962
assertThat(elementalActionNodeWithType.type())
2063
.contains(ElementalActionNodeWithType.Type.ACTION)
2164
}
@@ -25,6 +68,26 @@ internal class ElementalActionNodeWithTypeTest {
2568
val jsonMapper = jsonMapper()
2669
val elementalActionNodeWithType =
2770
ElementalActionNodeWithType.builder()
71+
.addChannel("string")
72+
.if_("if")
73+
.loop("loop")
74+
.ref("ref")
75+
.content("content")
76+
.href("href")
77+
.actionId("action_id")
78+
.align(Alignment.CENTER)
79+
.backgroundColor("background_color")
80+
.borderRadius("border_radius")
81+
.borderSize("border_size")
82+
.disableTracking(true)
83+
.fontSize("font_size")
84+
.locales(
85+
Locales.builder()
86+
.putAdditionalProperty("foo", JsonValue.from(mapOf("content" to "content")))
87+
.build()
88+
)
89+
.padding("padding")
90+
.style(ElementalActionNode.Style.BUTTON)
2891
.type(ElementalActionNodeWithType.Type.ACTION)
2992
.build()
3093

‎courier-java-core/src/test/kotlin/com/courier/models/ElementalChannelNodeTest.kt‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,29 @@ internal class ElementalChannelNodeTest {
2222
.channel("email")
2323
.addElement(
2424
ElementalNodeNonChannel.UnionMember0.builder()
25+
.addChannel("string")
26+
.if_("if")
27+
.loop("loop")
28+
.ref("ref")
29+
.align(ElementalTextNode.Align.LEFT)
30+
.bold("bold")
31+
.color("color")
32+
.content("content")
33+
.fontSize("font_size")
34+
.format(ElementalTextNode.Format.MARKDOWN)
35+
.italic("italic")
36+
.lineHeight("line_height")
37+
.locales(
38+
Locales.builder()
39+
.putAdditionalProperty(
40+
"foo",
41+
JsonValue.from(mapOf("content" to "content")),
42+
)
43+
.build()
44+
)
45+
.strikethrough("strikethrough")
46+
.textStyle(TextStyle.TEXT)
47+
.underline("underline")
2548
.type(ElementalNodeNonChannel.UnionMember0.Type.TEXT)
2649
.build()
2750
)
@@ -44,6 +67,29 @@ internal class ElementalChannelNodeTest {
4467
.containsExactly(
4568
ElementalNodeNonChannel.ofUnionMember0(
4669
ElementalNodeNonChannel.UnionMember0.builder()
70+
.addChannel("string")
71+
.if_("if")
72+
.loop("loop")
73+
.ref("ref")
74+
.align(ElementalTextNode.Align.LEFT)
75+
.bold("bold")
76+
.color("color")
77+
.content("content")
78+
.fontSize("font_size")
79+
.format(ElementalTextNode.Format.MARKDOWN)
80+
.italic("italic")
81+
.lineHeight("line_height")
82+
.locales(
83+
Locales.builder()
84+
.putAdditionalProperty(
85+
"foo",
86+
JsonValue.from(mapOf("content" to "content")),
87+
)
88+
.build()
89+
)
90+
.strikethrough("strikethrough")
91+
.textStyle(TextStyle.TEXT)
92+
.underline("underline")
4793
.type(ElementalNodeNonChannel.UnionMember0.Type.TEXT)
4894
.build()
4995
)
@@ -71,6 +117,29 @@ internal class ElementalChannelNodeTest {
71117
.channel("email")
72118
.addElement(
73119
ElementalNodeNonChannel.UnionMember0.builder()
120+
.addChannel("string")
121+
.if_("if")
122+
.loop("loop")
123+
.ref("ref")
124+
.align(ElementalTextNode.Align.LEFT)
125+
.bold("bold")
126+
.color("color")
127+
.content("content")
128+
.fontSize("font_size")
129+
.format(ElementalTextNode.Format.MARKDOWN)
130+
.italic("italic")
131+
.lineHeight("line_height")
132+
.locales(
133+
Locales.builder()
134+
.putAdditionalProperty(
135+
"foo",
136+
JsonValue.from(mapOf("content" to "content")),
137+
)
138+
.build()
139+
)
140+
.strikethrough("strikethrough")
141+
.textStyle(TextStyle.TEXT)
142+
.underline("underline")
74143
.type(ElementalNodeNonChannel.UnionMember0.Type.TEXT)
75144
.build()
76145
)

‎courier-java-core/src/test/kotlin/com/courier/models/ElementalChannelNodeWithTypeTest.kt‎

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
package com.courier.models
44

5+
import com.courier.core.JsonValue
56
import com.courier.core.jsonMapper
67
import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
8+
import kotlin.jvm.optionals.getOrNull
79
import org.assertj.core.api.Assertions.assertThat
810
import org.junit.jupiter.api.Test
911

@@ -13,9 +15,95 @@ internal class ElementalChannelNodeWithTypeTest {
1315
fun create() {
1416
val elementalChannelNodeWithType =
1517
ElementalChannelNodeWithType.builder()
18+
.addChannel("string")
19+
.if_("if")
20+
.loop("loop")
21+
.ref("ref")
22+
.channel("email")
23+
.addElement(
24+
ElementalNodeNonChannel.UnionMember0.builder()
25+
.addChannel("string")
26+
.if_("if")
27+
.loop("loop")
28+
.ref("ref")
29+
.align(ElementalTextNode.Align.LEFT)
30+
.bold("bold")
31+
.color("color")
32+
.content("content")
33+
.fontSize("font_size")
34+
.format(ElementalTextNode.Format.MARKDOWN)
35+
.italic("italic")
36+
.lineHeight("line_height")
37+
.locales(
38+
Locales.builder()
39+
.putAdditionalProperty(
40+
"foo",
41+
JsonValue.from(mapOf("content" to "content")),
42+
)
43+
.build()
44+
)
45+
.strikethrough("strikethrough")
46+
.textStyle(TextStyle.TEXT)
47+
.underline("underline")
48+
.type(ElementalNodeNonChannel.UnionMember0.Type.TEXT)
49+
.build()
50+
)
51+
.fontSize("font_size")
52+
.lineHeight("line_height")
53+
.padding("padding")
54+
.raw(
55+
ElementalChannelNode.Raw.builder()
56+
.putAdditionalProperty("foo", JsonValue.from("bar"))
57+
.build()
58+
)
1659
.type(ElementalChannelNodeWithType.Type.CHANNEL)
1760
.build()
1861

62+
assertThat(elementalChannelNodeWithType.channels().getOrNull()).containsExactly("string")
63+
assertThat(elementalChannelNodeWithType.if_()).contains("if")
64+
assertThat(elementalChannelNodeWithType.loop()).contains("loop")
65+
assertThat(elementalChannelNodeWithType.ref()).contains("ref")
66+
assertThat(elementalChannelNodeWithType.channel()).contains("email")
67+
assertThat(elementalChannelNodeWithType.elements().getOrNull())
68+
.containsExactly(
69+
ElementalNodeNonChannel.ofUnionMember0(
70+
ElementalNodeNonChannel.UnionMember0.builder()
71+
.addChannel("string")
72+
.if_("if")
73+
.loop("loop")
74+
.ref("ref")
75+
.align(ElementalTextNode.Align.LEFT)
76+
.bold("bold")
77+
.color("color")
78+
.content("content")
79+
.fontSize("font_size")
80+
.format(ElementalTextNode.Format.MARKDOWN)
81+
.italic("italic")
82+
.lineHeight("line_height")
83+
.locales(
84+
Locales.builder()
85+
.putAdditionalProperty(
86+
"foo",
87+
JsonValue.from(mapOf("content" to "content")),
88+
)
89+
.build()
90+
)
91+
.strikethrough("strikethrough")
92+
.textStyle(TextStyle.TEXT)
93+
.underline("underline")
94+
.type(ElementalNodeNonChannel.UnionMember0.Type.TEXT)
95+
.build()
96+
)
97+
)
98+
assertThat(elementalChannelNodeWithType.fontSize()).contains("font_size")
99+
assertThat(elementalChannelNodeWithType.lineHeight()).contains("line_height")
100+
assertThat(elementalChannelNodeWithType.padding()).contains("padding")
101+
assertThat(elementalChannelNodeWithType.raw())
102+
.contains(
103+
ElementalChannelNode.Raw.builder()
104+
.putAdditionalProperty("foo", JsonValue.from("bar"))
105+
.build()
106+
)
19107
assertThat(elementalChannelNodeWithType.type())
20108
.contains(ElementalChannelNodeWithType.Type.CHANNEL)
21109
}
@@ -25,6 +113,47 @@ internal class ElementalChannelNodeWithTypeTest {
25113
val jsonMapper = jsonMapper()
26114
val elementalChannelNodeWithType =
27115
ElementalChannelNodeWithType.builder()
116+
.addChannel("string")
117+
.if_("if")
118+
.loop("loop")
119+
.ref("ref")
120+
.channel("email")
121+
.addElement(
122+
ElementalNodeNonChannel.UnionMember0.builder()
123+
.addChannel("string")
124+
.if_("if")
125+
.loop("loop")
126+
.ref("ref")
127+
.align(ElementalTextNode.Align.LEFT)
128+
.bold("bold")
129+
.color("color")
130+
.content("content")
131+
.fontSize("font_size")
132+
.format(ElementalTextNode.Format.MARKDOWN)
133+
.italic("italic")
134+
.lineHeight("line_height")
135+
.locales(
136+
Locales.builder()
137+
.putAdditionalProperty(
138+
"foo",
139+
JsonValue.from(mapOf("content" to "content")),
140+
)
141+
.build()
142+
)
143+
.strikethrough("strikethrough")
144+
.textStyle(TextStyle.TEXT)
145+
.underline("underline")
146+
.type(ElementalNodeNonChannel.UnionMember0.Type.TEXT)
147+
.build()
148+
)
149+
.fontSize("font_size")
150+
.lineHeight("line_height")
151+
.padding("padding")
152+
.raw(
153+
ElementalChannelNode.Raw.builder()
154+
.putAdditionalProperty("foo", JsonValue.from("bar"))
155+
.build()
156+
)
28157
.type(ElementalChannelNodeWithType.Type.CHANNEL)
29158
.build()
30159

0 commit comments

Comments
 (0)