Skip to content

Commit 0f4e585

Browse files
feat(api): api update
1 parent 617892e commit 0f4e585

28 files changed

+37079
-12241
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-26020bd285825dac04bf642a414ea07c786fc6e42ee6bbcf795e11f8db426519.yml
3-
openapi_spec_hash: 897fedec83f0960539b3aa4ec0e3308d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-297c7ce95bc0aa1ac6f324a487515f49b8a30b74eb9d39ca9dcd2d9cf065f0ef.yml
3+
openapi_spec_hash: 29e9af981bc78379336079bb4208c54d
44
config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2

orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt

Lines changed: 6198 additions & 2796 deletions
Large diffs are not rendered by default.

orb-java-core/src/main/kotlin/com/withorb/api/models/BetaExternalPlanIdCreatePlanVersionParams.kt

Lines changed: 6198 additions & 2796 deletions
Large diffs are not rendered by default.

orb-java-core/src/main/kotlin/com/withorb/api/models/ChangedSubscriptionResources.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5730,6 +5730,9 @@ private constructor(
57305730
/** Alias for calling [price] with `Price.ofMinimum(minimum)`. */
57315731
fun price(minimum: Price.Minimum) = price(Price.ofMinimum(minimum))
57325732

5733+
/** Alias for calling [price] with `Price.ofEventOutput(eventOutput)`. */
5734+
fun price(eventOutput: Price.EventOutput) = price(Price.ofEventOutput(eventOutput))
5735+
57335736
/** Either the fixed fee quantity or the usage during the service period. */
57345737
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
57355738

orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5194,6 +5194,9 @@ private constructor(
51945194
/** Alias for calling [price] with `Price.ofMinimum(minimum)`. */
51955195
fun price(minimum: Price.Minimum) = price(Price.ofMinimum(minimum))
51965196

5197+
/** Alias for calling [price] with `Price.ofEventOutput(eventOutput)`. */
5198+
fun price(eventOutput: Price.EventOutput) = price(Price.ofEventOutput(eventOutput))
5199+
51975200
/** Either the fixed fee quantity or the usage during the service period. */
51985201
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
51995202

orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5188,6 +5188,9 @@ private constructor(
51885188
/** Alias for calling [price] with `Price.ofMinimum(minimum)`. */
51895189
fun price(minimum: Price.Minimum) = price(Price.ofMinimum(minimum))
51905190

5191+
/** Alias for calling [price] with `Price.ofEventOutput(eventOutput)`. */
5192+
fun price(eventOutput: Price.EventOutput) = price(Price.ofEventOutput(eventOutput))
5193+
51915194
/** Either the fixed fee quantity or the usage during the service period. */
51925195
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
51935196

orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,9 @@ private constructor(
11101110
/** Alias for calling [price] with `Price.ofMinimum(minimum)`. */
11111111
fun price(minimum: Price.Minimum) = price(Price.ofMinimum(minimum))
11121112

1113+
/** Alias for calling [price] with `Price.ofEventOutput(eventOutput)`. */
1114+
fun price(eventOutput: Price.EventOutput) = price(Price.ofEventOutput(eventOutput))
1115+
11131116
/** Either the fixed fee quantity or the usage during the service period. */
11141117
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
11151118

orb-java-core/src/main/kotlin/com/withorb/api/models/Item.kt

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import com.withorb.api.errors.OrbInvalidDataException
1818
import java.time.OffsetDateTime
1919
import java.util.Collections
2020
import java.util.Objects
21+
import java.util.Optional
2122
import kotlin.jvm.optionals.getOrNull
2223

2324
/**
@@ -33,6 +34,7 @@ private constructor(
3334
private val externalConnections: JsonField<List<ExternalConnection>>,
3435
private val metadata: JsonField<Metadata>,
3536
private val name: JsonField<String>,
37+
private val archivedAt: JsonField<OffsetDateTime>,
3638
private val additionalProperties: MutableMap<String, JsonValue>,
3739
) {
3840

@@ -47,21 +49,31 @@ private constructor(
4749
externalConnections: JsonField<List<ExternalConnection>> = JsonMissing.of(),
4850
@JsonProperty("metadata") @ExcludeMissing metadata: JsonField<Metadata> = JsonMissing.of(),
4951
@JsonProperty("name") @ExcludeMissing name: JsonField<String> = JsonMissing.of(),
50-
) : this(id, createdAt, externalConnections, metadata, name, mutableMapOf())
52+
@JsonProperty("archived_at")
53+
@ExcludeMissing
54+
archivedAt: JsonField<OffsetDateTime> = JsonMissing.of(),
55+
) : this(id, createdAt, externalConnections, metadata, name, archivedAt, mutableMapOf())
5156

5257
/**
58+
* The Orb-assigned unique identifier for the item.
59+
*
5360
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
5461
* missing or null (e.g. if the server responded with an unexpected value).
5562
*/
5663
fun id(): String = id.getRequired("id")
5764

5865
/**
66+
* The time at which the item was created.
67+
*
5968
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
6069
* missing or null (e.g. if the server responded with an unexpected value).
6170
*/
6271
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
6372

6473
/**
74+
* A list of external connections for this item, used to sync with external invoicing and tax
75+
* systems.
76+
*
6577
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
6678
* missing or null (e.g. if the server responded with an unexpected value).
6779
*/
@@ -79,11 +91,21 @@ private constructor(
7991
fun metadata(): Metadata = metadata.getRequired("metadata")
8092

8193
/**
94+
* The name of the item.
95+
*
8296
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
8397
* missing or null (e.g. if the server responded with an unexpected value).
8498
*/
8599
fun name(): String = name.getRequired("name")
86100

101+
/**
102+
* The time at which the item was archived. If null, the item is not archived.
103+
*
104+
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
105+
* responded with an unexpected value).
106+
*/
107+
fun archivedAt(): Optional<OffsetDateTime> = archivedAt.getOptional("archived_at")
108+
87109
/**
88110
* Returns the raw JSON value of [id].
89111
*
@@ -124,6 +146,15 @@ private constructor(
124146
*/
125147
@JsonProperty("name") @ExcludeMissing fun _name(): JsonField<String> = name
126148

149+
/**
150+
* Returns the raw JSON value of [archivedAt].
151+
*
152+
* Unlike [archivedAt], this method doesn't throw if the JSON field has an unexpected type.
153+
*/
154+
@JsonProperty("archived_at")
155+
@ExcludeMissing
156+
fun _archivedAt(): JsonField<OffsetDateTime> = archivedAt
157+
127158
@JsonAnySetter
128159
private fun putAdditionalProperty(key: String, value: JsonValue) {
129160
additionalProperties.put(key, value)
@@ -161,6 +192,7 @@ private constructor(
161192
private var externalConnections: JsonField<MutableList<ExternalConnection>>? = null
162193
private var metadata: JsonField<Metadata>? = null
163194
private var name: JsonField<String>? = null
195+
private var archivedAt: JsonField<OffsetDateTime> = JsonMissing.of()
164196
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
165197

166198
@JvmSynthetic
@@ -170,9 +202,11 @@ private constructor(
170202
externalConnections = item.externalConnections.map { it.toMutableList() }
171203
metadata = item.metadata
172204
name = item.name
205+
archivedAt = item.archivedAt
173206
additionalProperties = item.additionalProperties.toMutableMap()
174207
}
175208

209+
/** The Orb-assigned unique identifier for the item. */
176210
fun id(id: String) = id(JsonField.of(id))
177211

178212
/**
@@ -183,6 +217,7 @@ private constructor(
183217
*/
184218
fun id(id: JsonField<String>) = apply { this.id = id }
185219

220+
/** The time at which the item was created. */
186221
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
187222

188223
/**
@@ -194,6 +229,10 @@ private constructor(
194229
*/
195230
fun createdAt(createdAt: JsonField<OffsetDateTime>) = apply { this.createdAt = createdAt }
196231

232+
/**
233+
* A list of external connections for this item, used to sync with external invoicing and
234+
* tax systems.
235+
*/
197236
fun externalConnections(externalConnections: List<ExternalConnection>) =
198237
externalConnections(JsonField.of(externalConnections))
199238

@@ -236,6 +275,7 @@ private constructor(
236275
*/
237276
fun metadata(metadata: JsonField<Metadata>) = apply { this.metadata = metadata }
238277

278+
/** The name of the item. */
239279
fun name(name: String) = name(JsonField.of(name))
240280

241281
/**
@@ -246,6 +286,23 @@ private constructor(
246286
*/
247287
fun name(name: JsonField<String>) = apply { this.name = name }
248288

289+
/** The time at which the item was archived. If null, the item is not archived. */
290+
fun archivedAt(archivedAt: OffsetDateTime?) = archivedAt(JsonField.ofNullable(archivedAt))
291+
292+
/** Alias for calling [Builder.archivedAt] with `archivedAt.orElse(null)`. */
293+
fun archivedAt(archivedAt: Optional<OffsetDateTime>) = archivedAt(archivedAt.getOrNull())
294+
295+
/**
296+
* Sets [Builder.archivedAt] to an arbitrary JSON value.
297+
*
298+
* You should usually call [Builder.archivedAt] with a well-typed [OffsetDateTime] value
299+
* instead. This method is primarily for setting the field to an undocumented or not yet
300+
* supported value.
301+
*/
302+
fun archivedAt(archivedAt: JsonField<OffsetDateTime>) = apply {
303+
this.archivedAt = archivedAt
304+
}
305+
249306
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
250307
this.additionalProperties.clear()
251308
putAllAdditionalProperties(additionalProperties)
@@ -288,6 +345,7 @@ private constructor(
288345
checkRequired("externalConnections", externalConnections).map { it.toImmutable() },
289346
checkRequired("metadata", metadata),
290347
checkRequired("name", name),
348+
archivedAt,
291349
additionalProperties.toMutableMap(),
292350
)
293351
}
@@ -304,6 +362,7 @@ private constructor(
304362
externalConnections().forEach { it.validate() }
305363
metadata().validate()
306364
name()
365+
archivedAt()
307366
validated = true
308367
}
309368

@@ -326,8 +385,13 @@ private constructor(
326385
(if (createdAt.asKnown().isPresent) 1 else 0) +
327386
(externalConnections.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
328387
(metadata.asKnown().getOrNull()?.validity() ?: 0) +
329-
(if (name.asKnown().isPresent) 1 else 0)
388+
(if (name.asKnown().isPresent) 1 else 0) +
389+
(if (archivedAt.asKnown().isPresent) 1 else 0)
330390

391+
/**
392+
* Represents a connection between an Item and an external system for invoicing or tax
393+
* calculation purposes.
394+
*/
331395
class ExternalConnection
332396
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
333397
private constructor(
@@ -347,13 +411,17 @@ private constructor(
347411
) : this(externalConnectionName, externalEntityId, mutableMapOf())
348412

349413
/**
414+
* The name of the external system this item is connected to.
415+
*
350416
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is
351417
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
352418
*/
353419
fun externalConnectionName(): ExternalConnectionName =
354420
externalConnectionName.getRequired("external_connection_name")
355421

356422
/**
423+
* The identifier of this item in the external system.
424+
*
357425
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is
358426
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
359427
*/
@@ -419,6 +487,7 @@ private constructor(
419487
additionalProperties = externalConnection.additionalProperties.toMutableMap()
420488
}
421489

490+
/** The name of the external system this item is connected to. */
422491
fun externalConnectionName(externalConnectionName: ExternalConnectionName) =
423492
externalConnectionName(JsonField.of(externalConnectionName))
424493

@@ -434,6 +503,7 @@ private constructor(
434503
this.externalConnectionName = externalConnectionName
435504
}
436505

506+
/** The identifier of this item in the external system. */
437507
fun externalEntityId(externalEntityId: String) =
438508
externalEntityId(JsonField.of(externalEntityId))
439509

@@ -519,6 +589,7 @@ private constructor(
519589
(externalConnectionName.asKnown().getOrNull()?.validity() ?: 0) +
520590
(if (externalEntityId.asKnown().isPresent) 1 else 0)
521591

592+
/** The name of the external system this item is connected to. */
522593
class ExternalConnectionName
523594
@JsonCreator
524595
private constructor(private val value: JsonField<String>) : Enum {
@@ -823,15 +894,24 @@ private constructor(
823894
externalConnections == other.externalConnections &&
824895
metadata == other.metadata &&
825896
name == other.name &&
897+
archivedAt == other.archivedAt &&
826898
additionalProperties == other.additionalProperties
827899
}
828900

829901
private val hashCode: Int by lazy {
830-
Objects.hash(id, createdAt, externalConnections, metadata, name, additionalProperties)
902+
Objects.hash(
903+
id,
904+
createdAt,
905+
externalConnections,
906+
metadata,
907+
name,
908+
archivedAt,
909+
additionalProperties,
910+
)
831911
}
832912

833913
override fun hashCode(): Int = hashCode
834914

835915
override fun toString() =
836-
"Item{id=$id, createdAt=$createdAt, externalConnections=$externalConnections, metadata=$metadata, name=$name, additionalProperties=$additionalProperties}"
916+
"Item{id=$id, createdAt=$createdAt, externalConnections=$externalConnections, metadata=$metadata, name=$name, archivedAt=$archivedAt, additionalProperties=$additionalProperties}"
837917
}

orb-java-core/src/main/kotlin/com/withorb/api/models/ItemSlim.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import com.withorb.api.errors.OrbInvalidDataException
1515
import java.util.Collections
1616
import java.util.Objects
1717

18+
/** A minimal representation of an Item containing only the essential identifying information. */
1819
class ItemSlim
1920
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
2021
private constructor(
@@ -30,12 +31,16 @@ private constructor(
3031
) : this(id, name, mutableMapOf())
3132

3233
/**
34+
* The Orb-assigned unique identifier for the item.
35+
*
3336
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
3437
* missing or null (e.g. if the server responded with an unexpected value).
3538
*/
3639
fun id(): String = id.getRequired("id")
3740

3841
/**
42+
* The name of the item.
43+
*
3944
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
4045
* missing or null (e.g. if the server responded with an unexpected value).
4146
*/
@@ -95,6 +100,7 @@ private constructor(
95100
additionalProperties = itemSlim.additionalProperties.toMutableMap()
96101
}
97102

103+
/** The Orb-assigned unique identifier for the item. */
98104
fun id(id: String) = id(JsonField.of(id))
99105

100106
/**
@@ -105,6 +111,7 @@ private constructor(
105111
*/
106112
fun id(id: JsonField<String>) = apply { this.id = id }
107113

114+
/** The name of the item. */
108115
fun name(name: String) = name(JsonField.of(name))
109116

110117
/**

orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@ private constructor(
594594
"Body{externalConnections=$externalConnections, metadata=$metadata, name=$name, additionalProperties=$additionalProperties}"
595595
}
596596

597+
/**
598+
* Represents a connection between an Item and an external system for invoicing or tax
599+
* calculation purposes.
600+
*/
597601
class ExternalConnection
598602
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
599603
private constructor(
@@ -613,13 +617,17 @@ private constructor(
613617
) : this(externalConnectionName, externalEntityId, mutableMapOf())
614618

615619
/**
620+
* The name of the external system this item is connected to.
621+
*
616622
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is
617623
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
618624
*/
619625
fun externalConnectionName(): ExternalConnectionName =
620626
externalConnectionName.getRequired("external_connection_name")
621627

622628
/**
629+
* The identifier of this item in the external system.
630+
*
623631
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is
624632
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
625633
*/
@@ -685,6 +693,7 @@ private constructor(
685693
additionalProperties = externalConnection.additionalProperties.toMutableMap()
686694
}
687695

696+
/** The name of the external system this item is connected to. */
688697
fun externalConnectionName(externalConnectionName: ExternalConnectionName) =
689698
externalConnectionName(JsonField.of(externalConnectionName))
690699

@@ -700,6 +709,7 @@ private constructor(
700709
this.externalConnectionName = externalConnectionName
701710
}
702711

712+
/** The identifier of this item in the external system. */
703713
fun externalEntityId(externalEntityId: String) =
704714
externalEntityId(JsonField.of(externalEntityId))
705715

@@ -785,6 +795,7 @@ private constructor(
785795
(externalConnectionName.asKnown().getOrNull()?.validity() ?: 0) +
786796
(if (externalEntityId.asKnown().isPresent) 1 else 0)
787797

798+
/** The name of the external system this item is connected to. */
788799
class ExternalConnectionName
789800
@JsonCreator
790801
private constructor(private val value: JsonField<String>) : Enum {

0 commit comments

Comments
 (0)