Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.20.2"
".": "4.21.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 138
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-11e1931d767cef402bbed5a965746d1933ae72db0f41881860593a0b1424fd80.yml
openapi_spec_hash: 9def941805f233f8761c4bdae88f6137
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-1ba05406f99c844cf7b32fe80c399017d00c504563f211caf66dfbccf8dd146d.yml
openapi_spec_hash: be1b9b8a351560da21bbe3b53fd04905
config_hash: 6c3a754258f0f77e9032a90a478ab76d
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 4.21.0 (2026-07-13)

Full Changelog: [v4.20.2...v4.21.0](https://github.com/trycourier/courier-java/compare/v4.20.2...v4.21.0)

### Features

* Merge pull request [#149](https://github.com/trycourier/courier-java/issues/149) from trycourier/geraldosilva/c-19201-notification-template-subscription-topic-id ([74a301f](https://github.com/trycourier/courier-java/commit/74a301ff09a28e668a231af1ba87417bd637b8dd))

## 4.20.2 (2026-07-10)

Full Changelog: [v4.20.1...v4.20.2](https://github.com/trycourier/courier-java/compare/v4.20.1...v4.20.2)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.courier"
version = "4.20.2" // x-release-please-version
version = "4.21.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ private constructor(
private val name: JsonField<String>,
private val state: JsonField<State>,
private val tags: JsonField<List<String>>,
private val subscriptionTopicId: JsonField<String>,
private val updated: JsonField<Long>,
private val updater: JsonField<String>,
private val additionalProperties: MutableMap<String, JsonValue>,
Expand All @@ -43,9 +44,23 @@ private constructor(
@JsonProperty("name") @ExcludeMissing name: JsonField<String> = JsonMissing.of(),
@JsonProperty("state") @ExcludeMissing state: JsonField<State> = JsonMissing.of(),
@JsonProperty("tags") @ExcludeMissing tags: JsonField<List<String>> = JsonMissing.of(),
@JsonProperty("subscription_topic_id")
@ExcludeMissing
subscriptionTopicId: JsonField<String> = JsonMissing.of(),
@JsonProperty("updated") @ExcludeMissing updated: JsonField<Long> = JsonMissing.of(),
@JsonProperty("updater") @ExcludeMissing updater: JsonField<String> = JsonMissing.of(),
) : this(id, created, creator, name, state, tags, updated, updater, mutableMapOf())
) : this(
id,
created,
creator,
name,
state,
tags,
subscriptionTopicId,
updated,
updater,
mutableMapOf(),
)

/**
* @throws CourierInvalidDataException if the JSON field has an unexpected type or is
Expand Down Expand Up @@ -87,6 +102,16 @@ private constructor(
*/
fun tags(): List<String> = tags.getRequired("tags")

/**
* The linked subscription (preference) topic of the published version. Omitted when no topic is
* linked or the template has never been published.
*
* @throws CourierInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun subscriptionTopicId(): Optional<String> =
subscriptionTopicId.getOptional("subscription_topic_id")

/**
* Epoch milliseconds of last update.
*
Expand Down Expand Up @@ -145,6 +170,16 @@ private constructor(
*/
@JsonProperty("tags") @ExcludeMissing fun _tags(): JsonField<List<String>> = tags

/**
* Returns the raw JSON value of [subscriptionTopicId].
*
* Unlike [subscriptionTopicId], this method doesn't throw if the JSON field has an unexpected
* type.
*/
@JsonProperty("subscription_topic_id")
@ExcludeMissing
fun _subscriptionTopicId(): JsonField<String> = subscriptionTopicId

/**
* Returns the raw JSON value of [updated].
*
Expand Down Expand Up @@ -198,6 +233,7 @@ private constructor(
private var name: JsonField<String>? = null
private var state: JsonField<State>? = null
private var tags: JsonField<MutableList<String>>? = null
private var subscriptionTopicId: JsonField<String> = JsonMissing.of()
private var updated: JsonField<Long> = JsonMissing.of()
private var updater: JsonField<String> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
Expand All @@ -210,6 +246,7 @@ private constructor(
name = notificationTemplateSummary.name
state = notificationTemplateSummary.state
tags = notificationTemplateSummary.tags.map { it.toMutableList() }
subscriptionTopicId = notificationTemplateSummary.subscriptionTopicId
updated = notificationTemplateSummary.updated
updater = notificationTemplateSummary.updater
additionalProperties = notificationTemplateSummary.additionalProperties.toMutableMap()
Expand Down Expand Up @@ -289,6 +326,24 @@ private constructor(
tags = (tags ?: JsonField.of(mutableListOf())).also { checkKnown("tags", it).add(tag) }
}

/**
* The linked subscription (preference) topic of the published version. Omitted when no
* topic is linked or the template has never been published.
*/
fun subscriptionTopicId(subscriptionTopicId: String) =
subscriptionTopicId(JsonField.of(subscriptionTopicId))

/**
* Sets [Builder.subscriptionTopicId] to an arbitrary JSON value.
*
* You should usually call [Builder.subscriptionTopicId] with a well-typed [String] value
* instead. This method is primarily for setting the field to an undocumented or not yet
* supported value.
*/
fun subscriptionTopicId(subscriptionTopicId: JsonField<String>) = apply {
this.subscriptionTopicId = subscriptionTopicId
}

/** Epoch milliseconds of last update. */
fun updated(updated: Long) = updated(JsonField.of(updated))

Expand Down Expand Up @@ -355,6 +410,7 @@ private constructor(
checkRequired("name", name),
checkRequired("state", state),
checkRequired("tags", tags).map { it.toImmutable() },
subscriptionTopicId,
updated,
updater,
additionalProperties.toMutableMap(),
Expand Down Expand Up @@ -382,6 +438,7 @@ private constructor(
name()
state().validate()
tags()
subscriptionTopicId()
updated()
updater()
validated = true
Expand All @@ -408,6 +465,7 @@ private constructor(
(if (name.asKnown().isPresent) 1 else 0) +
(state.asKnown().getOrNull()?.validity() ?: 0) +
(tags.asKnown().getOrNull()?.size ?: 0) +
(if (subscriptionTopicId.asKnown().isPresent) 1 else 0) +
(if (updated.asKnown().isPresent) 1 else 0) +
(if (updater.asKnown().isPresent) 1 else 0)

Expand Down Expand Up @@ -557,6 +615,7 @@ private constructor(
name == other.name &&
state == other.state &&
tags == other.tags &&
subscriptionTopicId == other.subscriptionTopicId &&
updated == other.updated &&
updater == other.updater &&
additionalProperties == other.additionalProperties
Expand All @@ -570,6 +629,7 @@ private constructor(
name,
state,
tags,
subscriptionTopicId,
updated,
updater,
additionalProperties,
Expand All @@ -579,5 +639,5 @@ private constructor(
override fun hashCode(): Int = hashCode

override fun toString() =
"NotificationTemplateSummary{id=$id, created=$created, creator=$creator, name=$name, state=$state, tags=$tags, updated=$updated, updater=$updater, additionalProperties=$additionalProperties}"
"NotificationTemplateSummary{id=$id, created=$created, creator=$creator, name=$name, state=$state, tags=$tags, subscriptionTopicId=$subscriptionTopicId, updated=$updated, updater=$updater, additionalProperties=$additionalProperties}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal class NotificationTemplateSummaryTest {
.name("name")
.state(NotificationTemplateSummary.State.DRAFT)
.addTag("string")
.subscriptionTopicId("subscription_topic_id")
.updated(0L)
.updater("updater")
.build()
Expand All @@ -30,6 +31,8 @@ internal class NotificationTemplateSummaryTest {
assertThat(notificationTemplateSummary.state())
.isEqualTo(NotificationTemplateSummary.State.DRAFT)
assertThat(notificationTemplateSummary.tags()).containsExactly("string")
assertThat(notificationTemplateSummary.subscriptionTopicId())
.contains("subscription_topic_id")
assertThat(notificationTemplateSummary.updated()).contains(0L)
assertThat(notificationTemplateSummary.updater()).contains("updater")
}
Expand All @@ -45,6 +48,7 @@ internal class NotificationTemplateSummaryTest {
.name("name")
.state(NotificationTemplateSummary.State.DRAFT)
.addTag("string")
.subscriptionTopicId("subscription_topic_id")
.updated(0L)
.updater("updater")
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal class AssociatedNotificationListResponseTest {
.name("name")
.state(NotificationTemplateSummary.State.DRAFT)
.addTag("string")
.subscriptionTopicId("subscription_topic_id")
.updated(0L)
.updater("updater")
.build()
Expand All @@ -41,6 +42,7 @@ internal class AssociatedNotificationListResponseTest {
.name("name")
.state(NotificationTemplateSummary.State.DRAFT)
.addTag("string")
.subscriptionTopicId("subscription_topic_id")
.updated(0L)
.updater("updater")
.build()
Expand All @@ -61,6 +63,7 @@ internal class AssociatedNotificationListResponseTest {
.name("name")
.state(NotificationTemplateSummary.State.DRAFT)
.addTag("string")
.subscriptionTopicId("subscription_topic_id")
.updated(0L)
.updater("updater")
.build()
Expand Down
Loading