From eba28932d315b3a288e134f9da9f9a10c89dcc88 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2026 08:46:53 +0000 Subject: [PATCH 1/2] feat(api): add usagePeriodEnd field to usage report response credit --- .stats.yml | 4 +- .../models/v1/usage/UsageReportResponse.kt | 75 ++++++++++++++++++- .../v1/usage/UsageReportResponseTest.kt | 3 + 3 files changed, 76 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 976874ff..a87492aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 110 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stigg/stigg-a3b1cb64a010bc54278d208eb9ef309cb7c31e9099c45470fa3d032b1f4a17f6.yml -openapi_spec_hash: 09e5366c0f3dd1ea84dadb90e7cbf762 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stigg/stigg-7dccccd9c809d3fcc5f0ba477228a67b5f1fc5352b282081131f9fa0d90577d4.yml +openapi_spec_hash: 43d3823a6e045c2fd0b832877f2d8739 config_hash: 0eca08dde117ac62155a012abb0ecac7 diff --git a/stigg-java-core/src/main/kotlin/io/stigg/models/v1/usage/UsageReportResponse.kt b/stigg-java-core/src/main/kotlin/io/stigg/models/v1/usage/UsageReportResponse.kt index 64c0490f..000ba49c 100644 --- a/stigg-java-core/src/main/kotlin/io/stigg/models/v1/usage/UsageReportResponse.kt +++ b/stigg-java-core/src/main/kotlin/io/stigg/models/v1/usage/UsageReportResponse.kt @@ -841,6 +841,7 @@ private constructor( private val currentUsage: JsonField, private val timestamp: JsonField, private val usageLimit: JsonField, + private val usagePeriodEnd: JsonField, private val additionalProperties: MutableMap, ) { @@ -858,7 +859,17 @@ private constructor( @JsonProperty("usageLimit") @ExcludeMissing usageLimit: JsonField = JsonMissing.of(), - ) : this(currencyId, currentUsage, timestamp, usageLimit, mutableMapOf()) + @JsonProperty("usagePeriodEnd") + @ExcludeMissing + usagePeriodEnd: JsonField = JsonMissing.of(), + ) : this( + currencyId, + currentUsage, + timestamp, + usageLimit, + usagePeriodEnd, + mutableMapOf(), + ) /** * The credit currency identifier @@ -897,6 +908,15 @@ private constructor( */ fun usageLimit(): Double = usageLimit.getRequired("usageLimit") + /** + * End of the current credit grant period (when recurring credits reset), if applicable + * + * @throws StiggInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun usagePeriodEnd(): Optional = + usagePeriodEnd.getOptional("usagePeriodEnd") + /** * Returns the raw JSON value of [currencyId]. * @@ -937,6 +957,16 @@ private constructor( @ExcludeMissing fun _usageLimit(): JsonField = usageLimit + /** + * Returns the raw JSON value of [usagePeriodEnd]. + * + * Unlike [usagePeriodEnd], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("usagePeriodEnd") + @ExcludeMissing + fun _usagePeriodEnd(): JsonField = usagePeriodEnd + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -972,6 +1002,7 @@ private constructor( private var currentUsage: JsonField? = null private var timestamp: JsonField? = null private var usageLimit: JsonField? = null + private var usagePeriodEnd: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -980,6 +1011,7 @@ private constructor( currentUsage = credit.currentUsage timestamp = credit.timestamp usageLimit = credit.usageLimit + usagePeriodEnd = credit.usagePeriodEnd additionalProperties = credit.additionalProperties.toMutableMap() } @@ -1042,6 +1074,30 @@ private constructor( this.usageLimit = usageLimit } + /** + * End of the current credit grant period (when recurring credits reset), if + * applicable + */ + fun usagePeriodEnd(usagePeriodEnd: OffsetDateTime?) = + usagePeriodEnd(JsonField.ofNullable(usagePeriodEnd)) + + /** + * Alias for calling [Builder.usagePeriodEnd] with `usagePeriodEnd.orElse(null)`. + */ + fun usagePeriodEnd(usagePeriodEnd: Optional) = + usagePeriodEnd(usagePeriodEnd.getOrNull()) + + /** + * Sets [Builder.usagePeriodEnd] to an arbitrary JSON value. + * + * You should usually call [Builder.usagePeriodEnd] with a well-typed + * [OffsetDateTime] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun usagePeriodEnd(usagePeriodEnd: JsonField) = apply { + this.usagePeriodEnd = usagePeriodEnd + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1085,6 +1141,7 @@ private constructor( checkRequired("currentUsage", currentUsage), checkRequired("timestamp", timestamp), checkRequired("usageLimit", usageLimit), + usagePeriodEnd, additionalProperties.toMutableMap(), ) } @@ -1110,6 +1167,7 @@ private constructor( currentUsage() timestamp() usageLimit() + usagePeriodEnd() validated = true } @@ -1132,7 +1190,8 @@ private constructor( (if (currencyId.asKnown().isPresent) 1 else 0) + (if (currentUsage.asKnown().isPresent) 1 else 0) + (if (timestamp.asKnown().isPresent) 1 else 0) + - (if (usageLimit.asKnown().isPresent) 1 else 0) + (if (usageLimit.asKnown().isPresent) 1 else 0) + + (if (usagePeriodEnd.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1144,17 +1203,25 @@ private constructor( currentUsage == other.currentUsage && timestamp == other.timestamp && usageLimit == other.usageLimit && + usagePeriodEnd == other.usagePeriodEnd && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(currencyId, currentUsage, timestamp, usageLimit, additionalProperties) + Objects.hash( + currencyId, + currentUsage, + timestamp, + usageLimit, + usagePeriodEnd, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Credit{currencyId=$currencyId, currentUsage=$currentUsage, timestamp=$timestamp, usageLimit=$usageLimit, additionalProperties=$additionalProperties}" + "Credit{currencyId=$currencyId, currentUsage=$currentUsage, timestamp=$timestamp, usageLimit=$usageLimit, usagePeriodEnd=$usagePeriodEnd, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/stigg-java-core/src/test/kotlin/io/stigg/models/v1/usage/UsageReportResponseTest.kt b/stigg-java-core/src/test/kotlin/io/stigg/models/v1/usage/UsageReportResponseTest.kt index 3a2e4396..4d581805 100644 --- a/stigg-java-core/src/test/kotlin/io/stigg/models/v1/usage/UsageReportResponseTest.kt +++ b/stigg-java-core/src/test/kotlin/io/stigg/models/v1/usage/UsageReportResponseTest.kt @@ -28,6 +28,7 @@ internal class UsageReportResponseTest { .currentUsage(0.0) .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .usageLimit(0.0) + .usagePeriodEnd(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) .currentUsage(0.0) @@ -54,6 +55,7 @@ internal class UsageReportResponseTest { .currentUsage(0.0) .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .usageLimit(0.0) + .usagePeriodEnd(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) .currentUsage(0.0) @@ -84,6 +86,7 @@ internal class UsageReportResponseTest { .currentUsage(0.0) .timestamp(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .usageLimit(0.0) + .usagePeriodEnd(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() ) .currentUsage(0.0) From e0f1a6262366db36b65788870be36bbda095f13b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2026 08:47:21 +0000 Subject: [PATCH 2/2] release: 0.1.0-beta.27 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index eafd5663..1d0616cb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-beta.26" + ".": "0.1.0-beta.27" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 39121caa..1dc756b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.1.0-beta.27 (2026-06-23) + +Full Changelog: [v0.1.0-beta.26...v0.1.0-beta.27](https://github.com/stiggio/stigg-java/compare/v0.1.0-beta.26...v0.1.0-beta.27) + +### Features + +* **api:** add usagePeriodEnd field to usage report response credit ([eba2893](https://github.com/stiggio/stigg-java/commit/eba28932d315b3a288e134f9da9f9a10c89dcc88)) + ## 0.1.0-beta.26 (2026-06-23) Full Changelog: [v0.1.0-beta.25...v0.1.0-beta.26](https://github.com/stiggio/stigg-java/compare/v0.1.0-beta.25...v0.1.0-beta.26) diff --git a/README.md b/README.md index 6c2ef149..29f2a9c3 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/io.stigg/stigg-java)](https://central.sonatype.com/artifact/io.stigg/stigg-java/0.1.0-beta.26) -[![javadoc](https://javadoc.io/badge2/io.stigg/stigg-java/0.1.0-beta.26/javadoc.svg)](https://javadoc.io/doc/io.stigg/stigg-java/0.1.0-beta.26) +[![Maven Central](https://img.shields.io/maven-central/v/io.stigg/stigg-java)](https://central.sonatype.com/artifact/io.stigg/stigg-java/0.1.0-beta.27) +[![javadoc](https://javadoc.io/badge2/io.stigg/stigg-java/0.1.0-beta.27/javadoc.svg)](https://javadoc.io/doc/io.stigg/stigg-java/0.1.0-beta.27) @@ -22,7 +22,7 @@ Use the Stigg MCP Server to enable AI assistants to interact with this API, allo -Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.stigg/stigg-java/0.1.0-beta.26). +Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.stigg/stigg-java/0.1.0-beta.27). @@ -33,7 +33,7 @@ Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.stigg/stigg-jav ### Gradle ```kotlin -implementation("io.stigg:stigg-java:0.1.0-beta.26") +implementation("io.stigg:stigg-java:0.1.0-beta.27") ``` ### Maven @@ -42,7 +42,7 @@ implementation("io.stigg:stigg-java:0.1.0-beta.26") io.stigg stigg-java - 0.1.0-beta.26 + 0.1.0-beta.27 ``` diff --git a/build.gradle.kts b/build.gradle.kts index b902f98f..91756151 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "io.stigg" - version = "0.1.0-beta.26" // x-release-please-version + version = "0.1.0-beta.27" // x-release-please-version } subprojects {