Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/publish-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
Expand All @@ -33,7 +33,7 @@ jobs:
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
./gradlew publishAndReleaseToMavenCentral -Dorg.gradle.jvmargs="-Xmx8g" --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
env:
SONATYPE_USERNAME: ${{ secrets.ORB_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.ORB_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
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 @@
{
".": "1.3.0"
".": "1.4.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: 116
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0db984d367f9ae04249fb6c72789b0a38ef1785d156b438fe03290fa4e262a7d.yml
openapi_spec_hash: c901c8b4fc2b0399a33b1346f8521850
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e79a36262fa3c577305a43717398fb70482bb2dca47cdb3e201cbb2a590c359c.yml
openapi_spec_hash: 1e04880dccbcc082ba451083e421a471
config_hash: 3c3524be9607afb24d2139ce26ce5389
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.4.0 (2025-07-16)

Full Changelog: [v1.3.0...v1.4.0](https://github.com/orbcorp/orb-java/compare/v1.3.0...v1.4.0)

### Features

* **api:** api update ([b80c170](https://github.com/orbcorp/orb-java/commit/b80c170203b1bbe44da7121d69d245ca6b5db2b8))
* **api:** api update ([52612a7](https://github.com/orbcorp/orb-java/commit/52612a73768f17c76ccfff8e5dacf9457dd08c0d))


### Chores

* **ci:** bump `actions/setup-java` to v4 ([ee43b24](https://github.com/orbcorp/orb-java/commit/ee43b240c6ca6968cca70b7c6db999c7de19b2bd))
* **ci:** ensure docs generation always succeeds ([00866a5](https://github.com/orbcorp/orb-java/commit/00866a557ba12a39d7899bc3bc0a2950094ad355))

## 1.3.0 (2025-07-08)

Full Changelog: [v1.2.0...v1.3.0](https://github.com/orbcorp/orb-java/compare/v1.2.0...v1.3.0)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/1.3.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/1.4.0)

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

Expand All @@ -19,7 +19,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.witho
### Gradle

```kotlin
implementation("com.withorb.api:orb-java:1.3.0")
implementation("com.withorb.api:orb-java:1.4.0")
```

### Maven
Expand All @@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:1.3.0")
<dependency>
<groupId>com.withorb.api</groupId>
<artifactId>orb-java</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
allprojects {
group = "com.withorb.api"
version = "1.3.0" // x-release-please-version
version = "1.4.0" // x-release-please-version
}
109 changes: 105 additions & 4 deletions orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNote.kt
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ private constructor(
private val subtotal: JsonField<String>,
private val taxAmounts: JsonField<List<TaxAmount>>,
private val discounts: JsonField<List<Discount>>,
private val endTimeExclusive: JsonField<OffsetDateTime>,
private val startTimeInclusive: JsonField<OffsetDateTime>,
private val additionalProperties: MutableMap<String, JsonValue>,
) {

Expand All @@ -845,6 +847,12 @@ private constructor(
@JsonProperty("discounts")
@ExcludeMissing
discounts: JsonField<List<Discount>> = JsonMissing.of(),
@JsonProperty("end_time_exclusive")
@ExcludeMissing
endTimeExclusive: JsonField<OffsetDateTime> = JsonMissing.of(),
@JsonProperty("start_time_inclusive")
@ExcludeMissing
startTimeInclusive: JsonField<OffsetDateTime> = JsonMissing.of(),
) : this(
id,
amount,
Expand All @@ -854,6 +862,8 @@ private constructor(
subtotal,
taxAmounts,
discounts,
endTimeExclusive,
startTimeInclusive,
mutableMapOf(),
)

Expand Down Expand Up @@ -921,6 +931,24 @@ private constructor(
*/
fun discounts(): Optional<List<Discount>> = discounts.getOptional("discounts")

/**
* The end time of the service period for this credit note line item.
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun endTimeExclusive(): Optional<OffsetDateTime> =
endTimeExclusive.getOptional("end_time_exclusive")

/**
* The start time of the service period for this credit note line item.
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun startTimeInclusive(): Optional<OffsetDateTime> =
startTimeInclusive.getOptional("start_time_inclusive")

/**
* Returns the raw JSON value of [id].
*
Expand Down Expand Up @@ -981,6 +1009,26 @@ private constructor(
@ExcludeMissing
fun _discounts(): JsonField<List<Discount>> = discounts

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

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

@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
Expand Down Expand Up @@ -1023,6 +1071,8 @@ private constructor(
private var subtotal: JsonField<String>? = null
private var taxAmounts: JsonField<MutableList<TaxAmount>>? = null
private var discounts: JsonField<MutableList<Discount>>? = null
private var endTimeExclusive: JsonField<OffsetDateTime> = JsonMissing.of()
private var startTimeInclusive: JsonField<OffsetDateTime> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

@JvmSynthetic
Expand All @@ -1035,6 +1085,8 @@ private constructor(
subtotal = lineItem.subtotal
taxAmounts = lineItem.taxAmounts.map { it.toMutableList() }
discounts = lineItem.discounts.map { it.toMutableList() }
endTimeExclusive = lineItem.endTimeExclusive
startTimeInclusive = lineItem.startTimeInclusive
additionalProperties = lineItem.additionalProperties.toMutableMap()
}

Expand Down Expand Up @@ -1172,6 +1224,49 @@ private constructor(
}
}

/** The end time of the service period for this credit note line item. */
fun endTimeExclusive(endTimeExclusive: OffsetDateTime?) =
endTimeExclusive(JsonField.ofNullable(endTimeExclusive))

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

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

/** The start time of the service period for this credit note line item. */
fun startTimeInclusive(startTimeInclusive: OffsetDateTime?) =
startTimeInclusive(JsonField.ofNullable(startTimeInclusive))

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

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

fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
Expand Down Expand Up @@ -1219,6 +1314,8 @@ private constructor(
checkRequired("subtotal", subtotal),
checkRequired("taxAmounts", taxAmounts).map { it.toImmutable() },
(discounts ?: JsonMissing.of()).map { it.toImmutable() },
endTimeExclusive,
startTimeInclusive,
additionalProperties.toMutableMap(),
)
}
Expand All @@ -1238,6 +1335,8 @@ private constructor(
subtotal()
taxAmounts().forEach { it.validate() }
discounts().ifPresent { it.forEach { it.validate() } }
endTimeExclusive()
startTimeInclusive()
validated = true
}

Expand All @@ -1264,7 +1363,9 @@ private constructor(
(if (quantity.asKnown().isPresent) 1 else 0) +
(if (subtotal.asKnown().isPresent) 1 else 0) +
(taxAmounts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(discounts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
(discounts.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (endTimeExclusive.asKnown().isPresent) 1 else 0) +
(if (startTimeInclusive.asKnown().isPresent) 1 else 0)

class Discount
private constructor(
Expand Down Expand Up @@ -1836,17 +1937,17 @@ private constructor(
return true
}

return /* spotless:off */ other is LineItem && id == other.id && amount == other.amount && itemId == other.itemId && name == other.name && quantity == other.quantity && subtotal == other.subtotal && taxAmounts == other.taxAmounts && discounts == other.discounts && additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is LineItem && id == other.id && amount == other.amount && itemId == other.itemId && name == other.name && quantity == other.quantity && subtotal == other.subtotal && taxAmounts == other.taxAmounts && discounts == other.discounts && endTimeExclusive == other.endTimeExclusive && startTimeInclusive == other.startTimeInclusive && additionalProperties == other.additionalProperties /* spotless:on */
}

/* spotless:off */
private val hashCode: Int by lazy { Objects.hash(id, amount, itemId, name, quantity, subtotal, taxAmounts, discounts, additionalProperties) }
private val hashCode: Int by lazy { Objects.hash(id, amount, itemId, name, quantity, subtotal, taxAmounts, discounts, endTimeExclusive, startTimeInclusive, additionalProperties) }
/* spotless:on */

override fun hashCode(): Int = hashCode

override fun toString() =
"LineItem{id=$id, amount=$amount, itemId=$itemId, name=$name, quantity=$quantity, subtotal=$subtotal, taxAmounts=$taxAmounts, discounts=$discounts, additionalProperties=$additionalProperties}"
"LineItem{id=$id, amount=$amount, itemId=$itemId, name=$name, quantity=$quantity, subtotal=$subtotal, taxAmounts=$taxAmounts, discounts=$discounts, endTimeExclusive=$endTimeExclusive, startTimeInclusive=$startTimeInclusive, additionalProperties=$additionalProperties}"
}

/** The maximum amount applied on the original invoice */
Expand Down
Loading