Skip to content

Commit b64740c

Browse files
release: 4.5.0 (#84)
* feat(api): add audience/list/slack/msTeams/pagerduty/webhook recipients, restructure to union * codegen metadata * release: 4.5.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 0acb91b commit b64740c

105 files changed

Lines changed: 14885 additions & 2184 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "4.4.0"
2+
".": "4.5.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 77
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-9859cb664d1a9de0323c857e96cf41d0a5ac5c5903c501059f36bf62553b1583.yml
3-
openapi_spec_hash: d29149d60504eba35c63f583ce4bf0bc
4-
config_hash: 3ec521d062b05b81c22bc1a25bfe3d02
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-361d17797dff55a6d211dab1d2b797ff8674ebbb49a03f5ca0ab7292f8a88bdf.yml
3+
openapi_spec_hash: 6fdf1ea49bfaa98134463f366e9fb200
4+
config_hash: 54d2059f36ceee17804ef6c2800affd2

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 4.5.0 (2025-12-29)
4+
5+
Full Changelog: [v4.4.0...v4.5.0](https://github.com/trycourier/courier-java/compare/v4.4.0...v4.5.0)
6+
7+
### Features
8+
9+
* **api:** add audience/list/slack/msTeams/pagerduty/webhook recipients, restructure to union ([46de0d2](https://github.com/trycourier/courier-java/commit/46de0d2d85f59c4d1d220dc3e3028c7e6760c769))
10+
311
## 4.4.0 (2025-12-16)
412

513
Full Changelog: [v4.3.0...v4.4.0](https://github.com/trycourier/courier-java/compare/v4.3.0...v4.4.0)

README.md

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

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.courier/courier-java)](https://central.sonatype.com/artifact/com.courier/courier-java/4.4.0)
6-
[![javadoc](https://javadoc.io/badge2/com.courier/courier-java/4.4.0/javadoc.svg)](https://javadoc.io/doc/com.courier/courier-java/4.4.0)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.courier/courier-java)](https://central.sonatype.com/artifact/com.courier/courier-java/4.5.0)
6+
[![javadoc](https://javadoc.io/badge2/com.courier/courier-java/4.5.0/javadoc.svg)](https://javadoc.io/doc/com.courier/courier-java/4.5.0)
77

88
<!-- x-release-please-end -->
99

@@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/).
1313

1414
<!-- x-release-please-start-version -->
1515

16-
The REST API documentation can be found on [www.courier.com](https://www.courier.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.courier/courier-java/4.4.0).
16+
The REST API documentation can be found on [www.courier.com](https://www.courier.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.courier/courier-java/4.5.0).
1717

1818
<!-- x-release-please-end -->
1919

@@ -24,7 +24,7 @@ The REST API documentation can be found on [www.courier.com](https://www.courier
2424
### Gradle
2525

2626
```kotlin
27-
implementation("com.courier:courier-java:4.4.0")
27+
implementation("com.courier:courier-java:4.5.0")
2828
```
2929

3030
### Maven
@@ -33,7 +33,7 @@ implementation("com.courier:courier-java:4.4.0")
3333
<dependency>
3434
<groupId>com.courier</groupId>
3535
<artifactId>courier-java</artifactId>
36-
<version>4.4.0</version>
36+
<version>4.5.0</version>
3737
</dependency>
3838
```
3939

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
allprojects {
1010
group = "com.courier"
11-
version = "4.4.0" // x-release-please-version
11+
version = "4.5.0" // x-release-please-version
1212
}
1313

1414
subprojects {
Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package com.courier.models
4+
5+
import com.courier.core.ExcludeMissing
6+
import com.courier.core.JsonField
7+
import com.courier.core.JsonMissing
8+
import com.courier.core.JsonValue
9+
import com.courier.core.checkKnown
10+
import com.courier.core.checkRequired
11+
import com.courier.core.toImmutable
12+
import com.courier.errors.CourierInvalidDataException
13+
import com.fasterxml.jackson.annotation.JsonAnyGetter
14+
import com.fasterxml.jackson.annotation.JsonAnySetter
15+
import com.fasterxml.jackson.annotation.JsonCreator
16+
import com.fasterxml.jackson.annotation.JsonProperty
17+
import java.util.Collections
18+
import java.util.Objects
19+
import kotlin.jvm.optionals.getOrNull
20+
21+
class AirshipProfile
22+
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
23+
private constructor(
24+
private val audience: JsonField<AirshipProfileAudience>,
25+
private val deviceTypes: JsonField<List<String>>,
26+
private val additionalProperties: MutableMap<String, JsonValue>,
27+
) {
28+
29+
@JsonCreator
30+
private constructor(
31+
@JsonProperty("audience")
32+
@ExcludeMissing
33+
audience: JsonField<AirshipProfileAudience> = JsonMissing.of(),
34+
@JsonProperty("device_types")
35+
@ExcludeMissing
36+
deviceTypes: JsonField<List<String>> = JsonMissing.of(),
37+
) : this(audience, deviceTypes, mutableMapOf())
38+
39+
/**
40+
* @throws CourierInvalidDataException if the JSON field has an unexpected type or is
41+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
42+
*/
43+
fun audience(): AirshipProfileAudience = audience.getRequired("audience")
44+
45+
/**
46+
* @throws CourierInvalidDataException if the JSON field has an unexpected type or is
47+
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
48+
*/
49+
fun deviceTypes(): List<String> = deviceTypes.getRequired("device_types")
50+
51+
/**
52+
* Returns the raw JSON value of [audience].
53+
*
54+
* Unlike [audience], this method doesn't throw if the JSON field has an unexpected type.
55+
*/
56+
@JsonProperty("audience")
57+
@ExcludeMissing
58+
fun _audience(): JsonField<AirshipProfileAudience> = audience
59+
60+
/**
61+
* Returns the raw JSON value of [deviceTypes].
62+
*
63+
* Unlike [deviceTypes], this method doesn't throw if the JSON field has an unexpected type.
64+
*/
65+
@JsonProperty("device_types")
66+
@ExcludeMissing
67+
fun _deviceTypes(): JsonField<List<String>> = deviceTypes
68+
69+
@JsonAnySetter
70+
private fun putAdditionalProperty(key: String, value: JsonValue) {
71+
additionalProperties.put(key, value)
72+
}
73+
74+
@JsonAnyGetter
75+
@ExcludeMissing
76+
fun _additionalProperties(): Map<String, JsonValue> =
77+
Collections.unmodifiableMap(additionalProperties)
78+
79+
fun toBuilder() = Builder().from(this)
80+
81+
companion object {
82+
83+
/**
84+
* Returns a mutable builder for constructing an instance of [AirshipProfile].
85+
*
86+
* The following fields are required:
87+
* ```java
88+
* .audience()
89+
* .deviceTypes()
90+
* ```
91+
*/
92+
@JvmStatic fun builder() = Builder()
93+
}
94+
95+
/** A builder for [AirshipProfile]. */
96+
class Builder internal constructor() {
97+
98+
private var audience: JsonField<AirshipProfileAudience>? = null
99+
private var deviceTypes: JsonField<MutableList<String>>? = null
100+
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
101+
102+
@JvmSynthetic
103+
internal fun from(airshipProfile: AirshipProfile) = apply {
104+
audience = airshipProfile.audience
105+
deviceTypes = airshipProfile.deviceTypes.map { it.toMutableList() }
106+
additionalProperties = airshipProfile.additionalProperties.toMutableMap()
107+
}
108+
109+
fun audience(audience: AirshipProfileAudience) = audience(JsonField.of(audience))
110+
111+
/**
112+
* Sets [Builder.audience] to an arbitrary JSON value.
113+
*
114+
* You should usually call [Builder.audience] with a well-typed [AirshipProfileAudience]
115+
* value instead. This method is primarily for setting the field to an undocumented or not
116+
* yet supported value.
117+
*/
118+
fun audience(audience: JsonField<AirshipProfileAudience>) = apply {
119+
this.audience = audience
120+
}
121+
122+
fun deviceTypes(deviceTypes: List<String>) = deviceTypes(JsonField.of(deviceTypes))
123+
124+
/**
125+
* Sets [Builder.deviceTypes] to an arbitrary JSON value.
126+
*
127+
* You should usually call [Builder.deviceTypes] with a well-typed `List<String>` value
128+
* instead. This method is primarily for setting the field to an undocumented or not yet
129+
* supported value.
130+
*/
131+
fun deviceTypes(deviceTypes: JsonField<List<String>>) = apply {
132+
this.deviceTypes = deviceTypes.map { it.toMutableList() }
133+
}
134+
135+
/**
136+
* Adds a single [String] to [deviceTypes].
137+
*
138+
* @throws IllegalStateException if the field was previously set to a non-list.
139+
*/
140+
fun addDeviceType(deviceType: String) = apply {
141+
deviceTypes =
142+
(deviceTypes ?: JsonField.of(mutableListOf())).also {
143+
checkKnown("deviceTypes", it).add(deviceType)
144+
}
145+
}
146+
147+
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
148+
this.additionalProperties.clear()
149+
putAllAdditionalProperties(additionalProperties)
150+
}
151+
152+
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
153+
additionalProperties.put(key, value)
154+
}
155+
156+
fun putAllAdditionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
157+
this.additionalProperties.putAll(additionalProperties)
158+
}
159+
160+
fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
161+
162+
fun removeAllAdditionalProperties(keys: Set<String>) = apply {
163+
keys.forEach(::removeAdditionalProperty)
164+
}
165+
166+
/**
167+
* Returns an immutable instance of [AirshipProfile].
168+
*
169+
* Further updates to this [Builder] will not mutate the returned instance.
170+
*
171+
* The following fields are required:
172+
* ```java
173+
* .audience()
174+
* .deviceTypes()
175+
* ```
176+
*
177+
* @throws IllegalStateException if any required field is unset.
178+
*/
179+
fun build(): AirshipProfile =
180+
AirshipProfile(
181+
checkRequired("audience", audience),
182+
checkRequired("deviceTypes", deviceTypes).map { it.toImmutable() },
183+
additionalProperties.toMutableMap(),
184+
)
185+
}
186+
187+
private var validated: Boolean = false
188+
189+
fun validate(): AirshipProfile = apply {
190+
if (validated) {
191+
return@apply
192+
}
193+
194+
audience().validate()
195+
deviceTypes()
196+
validated = true
197+
}
198+
199+
fun isValid(): Boolean =
200+
try {
201+
validate()
202+
true
203+
} catch (e: CourierInvalidDataException) {
204+
false
205+
}
206+
207+
/**
208+
* Returns a score indicating how many valid values are contained in this object recursively.
209+
*
210+
* Used for best match union deserialization.
211+
*/
212+
@JvmSynthetic
213+
internal fun validity(): Int =
214+
(audience.asKnown().getOrNull()?.validity() ?: 0) +
215+
(deviceTypes.asKnown().getOrNull()?.size ?: 0)
216+
217+
override fun equals(other: Any?): Boolean {
218+
if (this === other) {
219+
return true
220+
}
221+
222+
return other is AirshipProfile &&
223+
audience == other.audience &&
224+
deviceTypes == other.deviceTypes &&
225+
additionalProperties == other.additionalProperties
226+
}
227+
228+
private val hashCode: Int by lazy { Objects.hash(audience, deviceTypes, additionalProperties) }
229+
230+
override fun hashCode(): Int = hashCode
231+
232+
override fun toString() =
233+
"AirshipProfile{audience=$audience, deviceTypes=$deviceTypes, additionalProperties=$additionalProperties}"
234+
}

0 commit comments

Comments
 (0)