diff --git a/courier-java-core/src/main/kotlin/com/courier/models/ElementalTextNode.kt b/courier-java-core/src/main/kotlin/com/courier/models/ElementalTextNode.kt index 957a5f34..fdae8bdd 100644 --- a/courier-java-core/src/main/kotlin/com/courier/models/ElementalTextNode.kt +++ b/courier-java-core/src/main/kotlin/com/courier/models/ElementalTextNode.kt @@ -8,7 +8,6 @@ import com.courier.core.JsonField import com.courier.core.JsonMissing import com.courier.core.JsonValue import com.courier.core.checkKnown -import com.courier.core.checkRequired import com.courier.core.toImmutable import com.courier.errors.CourierInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter @@ -28,10 +27,10 @@ private constructor( private val if_: JsonField, private val loop: JsonField, private val ref: JsonField, - private val content: JsonField, private val align: JsonField, private val bold: JsonField, private val color: JsonField, + private val content: JsonField, private val fontSize: JsonField, private val format: JsonField, private val italic: JsonField, @@ -51,10 +50,10 @@ private constructor( @JsonProperty("if") @ExcludeMissing if_: JsonField = JsonMissing.of(), @JsonProperty("loop") @ExcludeMissing loop: JsonField = JsonMissing.of(), @JsonProperty("ref") @ExcludeMissing ref: JsonField = JsonMissing.of(), - @JsonProperty("content") @ExcludeMissing content: JsonField = JsonMissing.of(), @JsonProperty("align") @ExcludeMissing align: JsonField = JsonMissing.of(), @JsonProperty("bold") @ExcludeMissing bold: JsonField = JsonMissing.of(), @JsonProperty("color") @ExcludeMissing color: JsonField = JsonMissing.of(), + @JsonProperty("content") @ExcludeMissing content: JsonField = JsonMissing.of(), @JsonProperty("font_size") @ExcludeMissing fontSize: JsonField = JsonMissing.of(), @JsonProperty("format") @ExcludeMissing format: JsonField = JsonMissing.of(), @JsonProperty("italic") @ExcludeMissing italic: JsonField = JsonMissing.of(), @@ -74,10 +73,10 @@ private constructor( if_, loop, ref, - content, align, bold, color, + content, fontSize, format, italic, @@ -116,15 +115,6 @@ private constructor( */ fun ref(): Optional = ref.getOptional("ref") - /** - * The text content displayed in the notification. Either this field must be specified, or the - * elements field - * - * @throws CourierInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun content(): String = content.getRequired("content") - /** * Text alignment. * @@ -149,6 +139,15 @@ private constructor( */ fun color(): Optional = color.getOptional("color") + /** + * The text content displayed in the notification. Either this field must be specified, or the + * elements field + * + * @throws CourierInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun content(): Optional = content.getOptional("content") + /** * CSS px font size for this text block, e.g. `16px`. Overrides the size of the `text_style` * preset. Email only. @@ -243,13 +242,6 @@ private constructor( */ @JsonProperty("ref") @ExcludeMissing fun _ref(): JsonField = ref - /** - * Returns the raw JSON value of [content]. - * - * Unlike [content], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("content") @ExcludeMissing fun _content(): JsonField = content - /** * Returns the raw JSON value of [align]. * @@ -271,6 +263,13 @@ private constructor( */ @JsonProperty("color") @ExcludeMissing fun _color(): JsonField = color + /** + * Returns the raw JSON value of [content]. + * + * Unlike [content], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("content") @ExcludeMissing fun _content(): JsonField = content + /** * Returns the raw JSON value of [fontSize]. * @@ -343,14 +342,7 @@ private constructor( companion object { - /** - * Returns a mutable builder for constructing an instance of [ElementalTextNode]. - * - * The following fields are required: - * ```java - * .content() - * ``` - */ + /** Returns a mutable builder for constructing an instance of [ElementalTextNode]. */ @JvmStatic fun builder() = Builder() } @@ -361,10 +353,10 @@ private constructor( private var if_: JsonField = JsonMissing.of() private var loop: JsonField = JsonMissing.of() private var ref: JsonField = JsonMissing.of() - private var content: JsonField? = null private var align: JsonField = JsonMissing.of() private var bold: JsonField = JsonMissing.of() private var color: JsonField = JsonMissing.of() + private var content: JsonField = JsonMissing.of() private var fontSize: JsonField = JsonMissing.of() private var format: JsonField = JsonMissing.of() private var italic: JsonField = JsonMissing.of() @@ -381,10 +373,10 @@ private constructor( if_ = elementalTextNode.if_ loop = elementalTextNode.loop ref = elementalTextNode.ref - content = elementalTextNode.content align = elementalTextNode.align bold = elementalTextNode.bold color = elementalTextNode.color + content = elementalTextNode.content fontSize = elementalTextNode.fontSize format = elementalTextNode.format italic = elementalTextNode.italic @@ -463,20 +455,6 @@ private constructor( */ fun ref(ref: JsonField) = apply { this.ref = ref } - /** - * The text content displayed in the notification. Either this field must be specified, or - * the elements field - */ - fun content(content: String) = content(JsonField.of(content)) - - /** - * Sets [Builder.content] to an arbitrary JSON value. - * - * You should usually call [Builder.content] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun content(content: JsonField) = apply { this.content = content } - /** Text alignment. */ fun align(align: Align) = align(JsonField.of(align)) @@ -516,6 +494,20 @@ private constructor( */ fun color(color: JsonField) = apply { this.color = color } + /** + * The text content displayed in the notification. Either this field must be specified, or + * the elements field + */ + fun content(content: String) = content(JsonField.of(content)) + + /** + * Sets [Builder.content] to an arbitrary JSON value. + * + * You should usually call [Builder.content] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun content(content: JsonField) = apply { this.content = content } + /** * CSS px font size for this text block, e.g. `16px`. Overrides the size of the `text_style` * preset. Email only. @@ -668,13 +660,6 @@ private constructor( * Returns an immutable instance of [ElementalTextNode]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .content() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ fun build(): ElementalTextNode = ElementalTextNode( @@ -682,10 +667,10 @@ private constructor( if_, loop, ref, - checkRequired("content", content), align, bold, color, + content, fontSize, format, italic, @@ -717,10 +702,10 @@ private constructor( if_() loop() ref() - content() align().ifPresent { it.validate() } bold() color() + content() fontSize() format().ifPresent { it.validate() } italic() @@ -751,10 +736,10 @@ private constructor( (if (if_.asKnown().isPresent) 1 else 0) + (if (loop.asKnown().isPresent) 1 else 0) + (if (ref.asKnown().isPresent) 1 else 0) + - (if (content.asKnown().isPresent) 1 else 0) + (align.asKnown().getOrNull()?.validity() ?: 0) + (if (bold.asKnown().isPresent) 1 else 0) + (if (color.asKnown().isPresent) 1 else 0) + + (if (content.asKnown().isPresent) 1 else 0) + (if (fontSize.asKnown().isPresent) 1 else 0) + (format.asKnown().getOrNull()?.validity() ?: 0) + (if (italic.asKnown().isPresent) 1 else 0) + @@ -1043,10 +1028,10 @@ private constructor( if_ == other.if_ && loop == other.loop && ref == other.ref && - content == other.content && align == other.align && bold == other.bold && color == other.color && + content == other.content && fontSize == other.fontSize && format == other.format && italic == other.italic && @@ -1064,10 +1049,10 @@ private constructor( if_, loop, ref, - content, align, bold, color, + content, fontSize, format, italic, @@ -1083,5 +1068,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ElementalTextNode{channels=$channels, if_=$if_, loop=$loop, ref=$ref, content=$content, align=$align, bold=$bold, color=$color, fontSize=$fontSize, format=$format, italic=$italic, lineHeight=$lineHeight, locales=$locales, strikethrough=$strikethrough, textStyle=$textStyle, underline=$underline, additionalProperties=$additionalProperties}" + "ElementalTextNode{channels=$channels, if_=$if_, loop=$loop, ref=$ref, align=$align, bold=$bold, color=$color, content=$content, fontSize=$fontSize, format=$format, italic=$italic, lineHeight=$lineHeight, locales=$locales, strikethrough=$strikethrough, textStyle=$textStyle, underline=$underline, additionalProperties=$additionalProperties}" } diff --git a/courier-java-core/src/main/kotlin/com/courier/models/ElementalTextNodeWithType.kt b/courier-java-core/src/main/kotlin/com/courier/models/ElementalTextNodeWithType.kt index 31153847..1d55fe86 100644 --- a/courier-java-core/src/main/kotlin/com/courier/models/ElementalTextNodeWithType.kt +++ b/courier-java-core/src/main/kotlin/com/courier/models/ElementalTextNodeWithType.kt @@ -8,7 +8,6 @@ import com.courier.core.JsonField import com.courier.core.JsonMissing import com.courier.core.JsonValue import com.courier.core.checkKnown -import com.courier.core.checkRequired import com.courier.core.toImmutable import com.courier.errors.CourierInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter @@ -28,10 +27,10 @@ private constructor( private val if_: JsonField, private val loop: JsonField, private val ref: JsonField, - private val content: JsonField, private val align: JsonField, private val bold: JsonField, private val color: JsonField, + private val content: JsonField, private val fontSize: JsonField, private val format: JsonField, private val italic: JsonField, @@ -52,12 +51,12 @@ private constructor( @JsonProperty("if") @ExcludeMissing if_: JsonField = JsonMissing.of(), @JsonProperty("loop") @ExcludeMissing loop: JsonField = JsonMissing.of(), @JsonProperty("ref") @ExcludeMissing ref: JsonField = JsonMissing.of(), - @JsonProperty("content") @ExcludeMissing content: JsonField = JsonMissing.of(), @JsonProperty("align") @ExcludeMissing align: JsonField = JsonMissing.of(), @JsonProperty("bold") @ExcludeMissing bold: JsonField = JsonMissing.of(), @JsonProperty("color") @ExcludeMissing color: JsonField = JsonMissing.of(), + @JsonProperty("content") @ExcludeMissing content: JsonField = JsonMissing.of(), @JsonProperty("font_size") @ExcludeMissing fontSize: JsonField = JsonMissing.of(), @JsonProperty("format") @ExcludeMissing @@ -80,10 +79,10 @@ private constructor( if_, loop, ref, - content, align, bold, color, + content, fontSize, format, italic, @@ -102,10 +101,10 @@ private constructor( .if_(if_) .loop(loop) .ref(ref) - .content(content) .align(align) .bold(bold) .color(color) + .content(content) .fontSize(fontSize) .format(format) .italic(italic) @@ -140,15 +139,6 @@ private constructor( */ fun ref(): Optional = ref.getOptional("ref") - /** - * The text content displayed in the notification. Either this field must be specified, or the - * elements field - * - * @throws CourierInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun content(): String = content.getRequired("content") - /** * Text alignment. * @@ -173,6 +163,15 @@ private constructor( */ fun color(): Optional = color.getOptional("color") + /** + * The text content displayed in the notification. Either this field must be specified, or the + * elements field + * + * @throws CourierInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun content(): Optional = content.getOptional("content") + /** * CSS px font size for this text block, e.g. `16px`. Overrides the size of the `text_style` * preset. Email only. @@ -273,13 +272,6 @@ private constructor( */ @JsonProperty("ref") @ExcludeMissing fun _ref(): JsonField = ref - /** - * Returns the raw JSON value of [content]. - * - * Unlike [content], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("content") @ExcludeMissing fun _content(): JsonField = content - /** * Returns the raw JSON value of [align]. * @@ -301,6 +293,13 @@ private constructor( */ @JsonProperty("color") @ExcludeMissing fun _color(): JsonField = color + /** + * Returns the raw JSON value of [content]. + * + * Unlike [content], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("content") @ExcludeMissing fun _content(): JsonField = content + /** * Returns the raw JSON value of [fontSize]. * @@ -384,11 +383,6 @@ private constructor( /** * Returns a mutable builder for constructing an instance of [ElementalTextNodeWithType]. - * - * The following fields are required: - * ```java - * .content() - * ``` */ @JvmStatic fun builder() = Builder() } @@ -400,10 +394,10 @@ private constructor( private var if_: JsonField = JsonMissing.of() private var loop: JsonField = JsonMissing.of() private var ref: JsonField = JsonMissing.of() - private var content: JsonField? = null private var align: JsonField = JsonMissing.of() private var bold: JsonField = JsonMissing.of() private var color: JsonField = JsonMissing.of() + private var content: JsonField = JsonMissing.of() private var fontSize: JsonField = JsonMissing.of() private var format: JsonField = JsonMissing.of() private var italic: JsonField = JsonMissing.of() @@ -421,10 +415,10 @@ private constructor( if_ = elementalTextNodeWithType.if_ loop = elementalTextNodeWithType.loop ref = elementalTextNodeWithType.ref - content = elementalTextNodeWithType.content align = elementalTextNodeWithType.align bold = elementalTextNodeWithType.bold color = elementalTextNodeWithType.color + content = elementalTextNodeWithType.content fontSize = elementalTextNodeWithType.fontSize format = elementalTextNodeWithType.format italic = elementalTextNodeWithType.italic @@ -504,20 +498,6 @@ private constructor( */ fun ref(ref: JsonField) = apply { this.ref = ref } - /** - * The text content displayed in the notification. Either this field must be specified, or - * the elements field - */ - fun content(content: String) = content(JsonField.of(content)) - - /** - * Sets [Builder.content] to an arbitrary JSON value. - * - * You should usually call [Builder.content] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun content(content: JsonField) = apply { this.content = content } - /** Text alignment. */ fun align(align: ElementalTextNode.Align) = align(JsonField.of(align)) @@ -558,6 +538,20 @@ private constructor( */ fun color(color: JsonField) = apply { this.color = color } + /** + * The text content displayed in the notification. Either this field must be specified, or + * the elements field + */ + fun content(content: String) = content(JsonField.of(content)) + + /** + * Sets [Builder.content] to an arbitrary JSON value. + * + * You should usually call [Builder.content] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun content(content: JsonField) = apply { this.content = content } + /** * CSS px font size for this text block, e.g. `16px`. Overrides the size of the `text_style` * preset. Email only. @@ -721,13 +715,6 @@ private constructor( * Returns an immutable instance of [ElementalTextNodeWithType]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .content() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ fun build(): ElementalTextNodeWithType = ElementalTextNodeWithType( @@ -735,10 +722,10 @@ private constructor( if_, loop, ref, - checkRequired("content", content), align, bold, color, + content, fontSize, format, italic, @@ -771,10 +758,10 @@ private constructor( if_() loop() ref() - content() align().ifPresent { it.validate() } bold() color() + content() fontSize() format().ifPresent { it.validate() } italic() @@ -806,10 +793,10 @@ private constructor( (if (if_.asKnown().isPresent) 1 else 0) + (if (loop.asKnown().isPresent) 1 else 0) + (if (ref.asKnown().isPresent) 1 else 0) + - (if (content.asKnown().isPresent) 1 else 0) + (align.asKnown().getOrNull()?.validity() ?: 0) + (if (bold.asKnown().isPresent) 1 else 0) + (if (color.asKnown().isPresent) 1 else 0) + + (if (content.asKnown().isPresent) 1 else 0) + (if (fontSize.asKnown().isPresent) 1 else 0) + (format.asKnown().getOrNull()?.validity() ?: 0) + (if (italic.asKnown().isPresent) 1 else 0) + @@ -958,10 +945,10 @@ private constructor( if_ == other.if_ && loop == other.loop && ref == other.ref && - content == other.content && align == other.align && bold == other.bold && color == other.color && + content == other.content && fontSize == other.fontSize && format == other.format && italic == other.italic && @@ -980,10 +967,10 @@ private constructor( if_, loop, ref, - content, align, bold, color, + content, fontSize, format, italic, @@ -1000,5 +987,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ElementalTextNodeWithType{channels=$channels, if_=$if_, loop=$loop, ref=$ref, content=$content, align=$align, bold=$bold, color=$color, fontSize=$fontSize, format=$format, italic=$italic, lineHeight=$lineHeight, locales=$locales, strikethrough=$strikethrough, textStyle=$textStyle, underline=$underline, type=$type, additionalProperties=$additionalProperties}" + "ElementalTextNodeWithType{channels=$channels, if_=$if_, loop=$loop, ref=$ref, align=$align, bold=$bold, color=$color, content=$content, fontSize=$fontSize, format=$format, italic=$italic, lineHeight=$lineHeight, locales=$locales, strikethrough=$strikethrough, textStyle=$textStyle, underline=$underline, type=$type, additionalProperties=$additionalProperties}" } diff --git a/courier-java-core/src/test/kotlin/com/courier/models/ElementalTextNodeTest.kt b/courier-java-core/src/test/kotlin/com/courier/models/ElementalTextNodeTest.kt index 6cf1d955..c2a6bbe2 100644 --- a/courier-java-core/src/test/kotlin/com/courier/models/ElementalTextNodeTest.kt +++ b/courier-java-core/src/test/kotlin/com/courier/models/ElementalTextNodeTest.kt @@ -19,10 +19,10 @@ internal class ElementalTextNodeTest { .if_("if") .loop("loop") .ref("ref") - .content("content") .align(ElementalTextNode.Align.LEFT) .bold("bold") .color("color") + .content("content") .fontSize("font_size") .format(ElementalTextNode.Format.MARKDOWN) .italic("italic") @@ -41,10 +41,10 @@ internal class ElementalTextNodeTest { assertThat(elementalTextNode.if_()).contains("if") assertThat(elementalTextNode.loop()).contains("loop") assertThat(elementalTextNode.ref()).contains("ref") - assertThat(elementalTextNode.content()).isEqualTo("content") assertThat(elementalTextNode.align()).contains(ElementalTextNode.Align.LEFT) assertThat(elementalTextNode.bold()).contains("bold") assertThat(elementalTextNode.color()).contains("color") + assertThat(elementalTextNode.content()).contains("content") assertThat(elementalTextNode.fontSize()).contains("font_size") assertThat(elementalTextNode.format()).contains(ElementalTextNode.Format.MARKDOWN) assertThat(elementalTextNode.italic()).contains("italic") @@ -69,10 +69,10 @@ internal class ElementalTextNodeTest { .if_("if") .loop("loop") .ref("ref") - .content("content") .align(ElementalTextNode.Align.LEFT) .bold("bold") .color("color") + .content("content") .fontSize("font_size") .format(ElementalTextNode.Format.MARKDOWN) .italic("italic") diff --git a/courier-java-core/src/test/kotlin/com/courier/models/broadcasts/BroadcastPutContentParamsTest.kt b/courier-java-core/src/test/kotlin/com/courier/models/broadcasts/BroadcastPutContentParamsTest.kt index af67f717..d00ea72a 100644 --- a/courier-java-core/src/test/kotlin/com/courier/models/broadcasts/BroadcastPutContentParamsTest.kt +++ b/courier-java-core/src/test/kotlin/com/courier/models/broadcasts/BroadcastPutContentParamsTest.kt @@ -47,7 +47,7 @@ internal class BroadcastPutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .addElement(ElementalTextNodeWithType.builder().build()) .build() ) @@ -121,7 +121,7 @@ internal class BroadcastPutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .addElement(ElementalTextNodeWithType.builder().build()) .build() ) @@ -136,7 +136,7 @@ internal class BroadcastPutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .addElement(ElementalTextNodeWithType.builder().build()) .build() ) diff --git a/courier-java-core/src/test/kotlin/com/courier/models/journeys/templates/TemplatePutContentParamsTest.kt b/courier-java-core/src/test/kotlin/com/courier/models/journeys/templates/TemplatePutContentParamsTest.kt index b2fb87e5..20314d34 100644 --- a/courier-java-core/src/test/kotlin/com/courier/models/journeys/templates/TemplatePutContentParamsTest.kt +++ b/courier-java-core/src/test/kotlin/com/courier/models/journeys/templates/TemplatePutContentParamsTest.kt @@ -3,7 +3,7 @@ package com.courier.models.journeys.templates import com.courier.models.ElementalChannelNodeWithType -import com.courier.models.ElementalMetaNodeWithType +import com.courier.models.ElementalTextNodeWithType import com.courier.models.notifications.NotificationContentPutRequest import com.courier.models.notifications.NotificationTemplateState import org.assertj.core.api.Assertions.assertThat @@ -44,7 +44,7 @@ internal class TemplatePutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .build() ) .build() @@ -110,7 +110,7 @@ internal class TemplatePutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .build() ) .build() @@ -124,7 +124,7 @@ internal class TemplatePutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .build() ) .build() diff --git a/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationCreateParamsTest.kt b/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationCreateParamsTest.kt index 949ecfde..0ba9e050 100644 --- a/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationCreateParamsTest.kt +++ b/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationCreateParamsTest.kt @@ -5,7 +5,7 @@ package com.courier.models.notifications import com.courier.core.http.Headers import com.courier.models.ElementalChannelNodeWithType import com.courier.models.ElementalContent -import com.courier.models.ElementalMetaNodeWithType +import com.courier.models.ElementalTextNodeWithType import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -129,7 +129,7 @@ internal class NotificationCreateParamsTest { ) .content( ElementalContent.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .version("2022-01-01") .build() ) @@ -261,7 +261,7 @@ internal class NotificationCreateParamsTest { ) .content( ElementalContent.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .version("2022-01-01") .build() ) @@ -298,7 +298,7 @@ internal class NotificationCreateParamsTest { ) .content( ElementalContent.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .version("2022-01-01") .build() ) diff --git a/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationPutContentParamsTest.kt b/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationPutContentParamsTest.kt index 68ffd8af..e163ae7a 100644 --- a/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationPutContentParamsTest.kt +++ b/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationPutContentParamsTest.kt @@ -3,7 +3,7 @@ package com.courier.models.notifications import com.courier.models.ElementalChannelNodeWithType -import com.courier.models.ElementalMetaNodeWithType +import com.courier.models.ElementalTextNodeWithType import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -40,7 +40,7 @@ internal class NotificationPutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .build() ) .build() @@ -103,7 +103,7 @@ internal class NotificationPutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .build() ) .build() @@ -117,7 +117,7 @@ internal class NotificationPutContentParamsTest { NotificationContentPutRequest.builder() .content( NotificationContentPutRequest.Content.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .build() ) .build() diff --git a/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationReplaceParamsTest.kt b/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationReplaceParamsTest.kt index 570259e0..b6f5f240 100644 --- a/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationReplaceParamsTest.kt +++ b/courier-java-core/src/test/kotlin/com/courier/models/notifications/NotificationReplaceParamsTest.kt @@ -4,7 +4,7 @@ package com.courier.models.notifications import com.courier.models.ElementalChannelNodeWithType import com.courier.models.ElementalContent -import com.courier.models.ElementalMetaNodeWithType +import com.courier.models.ElementalTextNodeWithType import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -62,7 +62,7 @@ internal class NotificationReplaceParamsTest { .brand(NotificationTemplatePayload.Brand.builder().id("id").build()) .content( ElementalContent.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .version("2022-01-01") .build() ) @@ -179,7 +179,7 @@ internal class NotificationReplaceParamsTest { .brand(NotificationTemplatePayload.Brand.builder().id("id").build()) .content( ElementalContent.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .version("2022-01-01") .build() ) @@ -211,7 +211,7 @@ internal class NotificationReplaceParamsTest { .brand(NotificationTemplatePayload.Brand.builder().id("id").build()) .content( ElementalContent.builder() - .addElement(ElementalMetaNodeWithType.builder().build()) + .addElement(ElementalTextNodeWithType.builder().build()) .version("2022-01-01") .build() )