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
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -17,7 +19,7 @@ jobs:
timeout-minutes: 15
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/courier-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')

steps:
- uses: actions/checkout@v6
Expand All @@ -44,7 +46,7 @@ jobs:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/courier-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')

steps:
- uses: actions/checkout@v6
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
.gradle
.idea
.kotlin
Expand Down
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.10.0"
".": "4.11.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 83
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-19330fca8fa9bbae835ec9d9f83b37b3df364d9b462090b9623bfc9b6eae99c2.yml
openapi_spec_hash: 0bc6889464c9ac2542b4837f569c1837
config_hash: 1ae49ed522c8423378d9463cdd0fb880
configured_endpoints: 88
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-288ef53fff4d0cc92b3ac14bc1e03dc41c112b55634713adb75158b1c97c4576.yml
openapi_spec_hash: 5c4fed9a1639a6cdfcb5adaf666c9ed6
config_hash: a0ecf9dfbd637db38508b3de2b81aeeb
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## 4.11.0 (2026-03-25)

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

### Features

* **api:** add create/retrieve/archive/publish/replace methods, event_id param to notifications ([d0341ec](https://github.com/trycourier/courier-java/commit/d0341ecd91cd175c1fbd252f3f5caa4961a38a11))


### Bug Fixes

* **client:** allow updating header/query affecting fields in `toBuilder()` ([ed456e5](https://github.com/trycourier/courier-java/commit/ed456e5be6b63dd0c16ddf1e5c90dde476d4d7e5))


### Chores

* **ci:** skip lint on metadata-only changes ([2b3cd27](https://github.com/trycourier/courier-java/commit/2b3cd2798e31d09d6e0d329e3bb46f45a73c9aac))
* **internal:** bump ktfmt ([affb7da](https://github.com/trycourier/courier-java/commit/affb7dae80ab5957a15a0b497dcf1afd3146eec7))
* **internal:** tweak CI branches ([1bd9068](https://github.com/trycourier/courier-java/commit/1bd906869c298547c59c2ffbc0f0ef0e37958206))
* **internal:** update gitignore ([d801bca](https://github.com/trycourier/courier-java/commit/d801bca833d04aa2adb2f9bb4df7b6777cfb022a))
* **internal:** update retry delay tests ([e3ecdf0](https://github.com/trycourier/courier-java/commit/e3ecdf0b1b898a83eb234cb289db18e51cfd8982))


### Documentation

* sync README from mintlify-docs (2026-03-23 19:31 UTC) ([#95](https://github.com/trycourier/courier-java/issues/95)) ([8efc854](https://github.com/trycourier/courier-java/commit/8efc8542cbe37b8ba7673d53a37995625e574785))

## 4.10.0 (2026-03-12)

Full Changelog: [v4.9.1...v4.10.0](https://github.com/trycourier/courier-java/compare/v4.9.1...v4.10.0)
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.10.0" // x-release-please-version
version = "4.11.0" // x-release-please-version
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/courier.kotlin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tasks.withType<Test>().configureEach {

val ktfmt by configurations.creating
dependencies {
ktfmt("com.facebook:ktfmt:0.56")
ktfmt("com.facebook:ktfmt:0.61")
}

fun registerKtfmt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,14 @@ private constructor(
headers.put("X-Stainless-Runtime", "JRE")
headers.put("X-Stainless-Runtime-Version", getJavaVersion())
headers.put("X-Stainless-Kotlin-Version", KotlinVersion.CURRENT.toString())
// We replace after all the default headers to allow end-users to overwrite them.
headers.replaceAll(this.headers.build())
queryParams.replaceAll(this.queryParams.build())
apiKey.let {
if (!it.isEmpty()) {
headers.put("Authorization", "Bearer $it")
headers.replace("Authorization", "Bearer $it")
}
}
headers.replaceAll(this.headers.build())
queryParams.replaceAll(this.queryParams.build())

return ClientOptions(
httpClient,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
// File generated from our OpenAPI spec by Stainless.

package com.courier.models.notifications

import com.courier.core.JsonValue
import com.courier.core.Params
import com.courier.core.http.Headers
import com.courier.core.http.QueryParams
import com.courier.core.toImmutable
import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

/** Archive a notification template. */
class NotificationArchiveParams
private constructor(
private val id: String?,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
private val additionalBodyProperties: Map<String, JsonValue>,
) : Params {

fun id(): Optional<String> = Optional.ofNullable(id)

/** Additional body properties to send with the request. */
fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

/** Additional headers to send with the request. */
fun _additionalHeaders(): Headers = additionalHeaders

/** Additional query param to send with the request. */
fun _additionalQueryParams(): QueryParams = additionalQueryParams

fun toBuilder() = Builder().from(this)

companion object {

@JvmStatic fun none(): NotificationArchiveParams = builder().build()

/**
* Returns a mutable builder for constructing an instance of [NotificationArchiveParams].
*/
@JvmStatic fun builder() = Builder()
}

/** A builder for [NotificationArchiveParams]. */
class Builder internal constructor() {

private var id: String? = null
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
internal fun from(notificationArchiveParams: NotificationArchiveParams) = apply {
id = notificationArchiveParams.id
additionalHeaders = notificationArchiveParams.additionalHeaders.toBuilder()
additionalQueryParams = notificationArchiveParams.additionalQueryParams.toBuilder()
additionalBodyProperties =
notificationArchiveParams.additionalBodyProperties.toMutableMap()
}

fun id(id: String?) = apply { this.id = id }

/** Alias for calling [Builder.id] with `id.orElse(null)`. */
fun id(id: Optional<String>) = id(id.getOrNull())

fun additionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.clear()
putAllAdditionalHeaders(additionalHeaders)
}

fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
this.additionalHeaders.clear()
putAllAdditionalHeaders(additionalHeaders)
}

fun putAdditionalHeader(name: String, value: String) = apply {
additionalHeaders.put(name, value)
}

fun putAdditionalHeaders(name: String, values: Iterable<String>) = apply {
additionalHeaders.put(name, values)
}

fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.putAll(additionalHeaders)
}

fun putAllAdditionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
this.additionalHeaders.putAll(additionalHeaders)
}

fun replaceAdditionalHeaders(name: String, value: String) = apply {
additionalHeaders.replace(name, value)
}

fun replaceAdditionalHeaders(name: String, values: Iterable<String>) = apply {
additionalHeaders.replace(name, values)
}

fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.replaceAll(additionalHeaders)
}

fun replaceAllAdditionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
this.additionalHeaders.replaceAll(additionalHeaders)
}

fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }

fun removeAllAdditionalHeaders(names: Set<String>) = apply {
additionalHeaders.removeAll(names)
}

fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
this.additionalQueryParams.clear()
putAllAdditionalQueryParams(additionalQueryParams)
}

fun additionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply {
this.additionalQueryParams.clear()
putAllAdditionalQueryParams(additionalQueryParams)
}

fun putAdditionalQueryParam(key: String, value: String) = apply {
additionalQueryParams.put(key, value)
}

fun putAdditionalQueryParams(key: String, values: Iterable<String>) = apply {
additionalQueryParams.put(key, values)
}

fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
this.additionalQueryParams.putAll(additionalQueryParams)
}

fun putAllAdditionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) =
apply {
this.additionalQueryParams.putAll(additionalQueryParams)
}

fun replaceAdditionalQueryParams(key: String, value: String) = apply {
additionalQueryParams.replace(key, value)
}

fun replaceAdditionalQueryParams(key: String, values: Iterable<String>) = apply {
additionalQueryParams.replace(key, values)
}

fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
this.additionalQueryParams.replaceAll(additionalQueryParams)
}

fun replaceAllAdditionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) =
apply {
this.additionalQueryParams.replaceAll(additionalQueryParams)
}

fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }

fun removeAllAdditionalQueryParams(keys: Set<String>) = apply {
additionalQueryParams.removeAll(keys)
}

fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
this.additionalBodyProperties.clear()
putAllAdditionalBodyProperties(additionalBodyProperties)
}

fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
additionalBodyProperties.put(key, value)
}

fun putAllAdditionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) =
apply {
this.additionalBodyProperties.putAll(additionalBodyProperties)
}

fun removeAdditionalBodyProperty(key: String) = apply {
additionalBodyProperties.remove(key)
}

fun removeAllAdditionalBodyProperties(keys: Set<String>) = apply {
keys.forEach(::removeAdditionalBodyProperty)
}

/**
* Returns an immutable instance of [NotificationArchiveParams].
*
* Further updates to this [Builder] will not mutate the returned instance.
*/
fun build(): NotificationArchiveParams =
NotificationArchiveParams(
id,
additionalHeaders.build(),
additionalQueryParams.build(),
additionalBodyProperties.toImmutable(),
)
}

fun _body(): Optional<Map<String, JsonValue>> =
Optional.ofNullable(additionalBodyProperties.ifEmpty { null })

fun _pathParam(index: Int): String =
when (index) {
0 -> id ?: ""
else -> ""
}

override fun _headers(): Headers = additionalHeaders

override fun _queryParams(): QueryParams = additionalQueryParams

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is NotificationArchiveParams &&
id == other.id &&
additionalHeaders == other.additionalHeaders &&
additionalQueryParams == other.additionalQueryParams &&
additionalBodyProperties == other.additionalBodyProperties
}

override fun hashCode(): Int =
Objects.hash(id, additionalHeaders, additionalQueryParams, additionalBodyProperties)

override fun toString() =
"NotificationArchiveParams{id=$id, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
}
Loading
Loading