Skip to content

Commit 69429b9

Browse files
feat(api): api update
1 parent 719f036 commit 69429b9

File tree

219 files changed

+19548
-515
lines changed

Some content is hidden

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

219 files changed

+19548
-515
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: 126
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-931771ff4ab183044ee50ce43ea794ac0a15bfafbaf7df61ac0344af3ff08944.yml
3-
openapi_spec_hash: 71371804e373f662585284bf5d93cc62
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6aa83a816c15600a3d6d378d7804a345505c76726059c19369db4e7766a71cbd.yml
3+
openapi_spec_hash: f283d730e5320f9595c3c0a5902f5cbb
44
config_hash: bcf82bddb691f6be773ac6cae8c03b9a

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

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ private constructor(
2727
private val currency: JsonField<String>,
2828
private val customExpiration: JsonField<CustomExpiration>,
2929
private val filters: JsonField<List<Filter>>,
30+
private val licenseTypeId: JsonField<String>,
3031
private val additionalProperties: MutableMap<String, JsonValue>,
3132
) {
3233

@@ -39,8 +40,13 @@ private constructor(
3940
@JsonProperty("custom_expiration")
4041
@ExcludeMissing
4142
customExpiration: JsonField<CustomExpiration> = JsonMissing.of(),
42-
@JsonProperty("filters") @ExcludeMissing filters: JsonField<List<Filter>> = JsonMissing.of(),
43-
) : this(allowsRollover, currency, customExpiration, filters, mutableMapOf())
43+
@JsonProperty("filters")
44+
@ExcludeMissing
45+
filters: JsonField<List<Filter>> = JsonMissing.of(),
46+
@JsonProperty("license_type_id")
47+
@ExcludeMissing
48+
licenseTypeId: JsonField<String> = JsonMissing.of(),
49+
) : this(allowsRollover, currency, customExpiration, filters, licenseTypeId, mutableMapOf())
4450

4551
/**
4652
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
@@ -67,6 +73,12 @@ private constructor(
6773
*/
6874
fun filters(): Optional<List<Filter>> = filters.getOptional("filters")
6975

76+
/**
77+
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
78+
* responded with an unexpected value).
79+
*/
80+
fun licenseTypeId(): Optional<String> = licenseTypeId.getOptional("license_type_id")
81+
7082
/**
7183
* Returns the raw JSON value of [allowsRollover].
7284
*
@@ -100,6 +112,15 @@ private constructor(
100112
*/
101113
@JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField<List<Filter>> = filters
102114

115+
/**
116+
* Returns the raw JSON value of [licenseTypeId].
117+
*
118+
* Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type.
119+
*/
120+
@JsonProperty("license_type_id")
121+
@ExcludeMissing
122+
fun _licenseTypeId(): JsonField<String> = licenseTypeId
123+
103124
@JsonAnySetter
104125
private fun putAdditionalProperty(key: String, value: JsonValue) {
105126
additionalProperties.put(key, value)
@@ -134,6 +155,7 @@ private constructor(
134155
private var currency: JsonField<String>? = null
135156
private var customExpiration: JsonField<CustomExpiration>? = null
136157
private var filters: JsonField<MutableList<Filter>>? = null
158+
private var licenseTypeId: JsonField<String> = JsonMissing.of()
137159
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
138160

139161
@JvmSynthetic
@@ -142,6 +164,7 @@ private constructor(
142164
currency = allocation.currency
143165
customExpiration = allocation.customExpiration
144166
filters = allocation.filters.map { it.toMutableList() }
167+
licenseTypeId = allocation.licenseTypeId
145168
additionalProperties = allocation.additionalProperties.toMutableMap()
146169
}
147170

@@ -211,6 +234,24 @@ private constructor(
211234
}
212235
}
213236

237+
fun licenseTypeId(licenseTypeId: String?) =
238+
licenseTypeId(JsonField.ofNullable(licenseTypeId))
239+
240+
/** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */
241+
fun licenseTypeId(licenseTypeId: Optional<String>) =
242+
licenseTypeId(licenseTypeId.getOrNull())
243+
244+
/**
245+
* Sets [Builder.licenseTypeId] to an arbitrary JSON value.
246+
*
247+
* You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead.
248+
* This method is primarily for setting the field to an undocumented or not yet supported
249+
* value.
250+
*/
251+
fun licenseTypeId(licenseTypeId: JsonField<String>) = apply {
252+
this.licenseTypeId = licenseTypeId
253+
}
254+
214255
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
215256
this.additionalProperties.clear()
216257
putAllAdditionalProperties(additionalProperties)
@@ -250,6 +291,7 @@ private constructor(
250291
checkRequired("currency", currency),
251292
checkRequired("customExpiration", customExpiration),
252293
(filters ?: JsonMissing.of()).map { it.toImmutable() },
294+
licenseTypeId,
253295
additionalProperties.toMutableMap(),
254296
)
255297
}
@@ -265,6 +307,7 @@ private constructor(
265307
currency()
266308
customExpiration().ifPresent { it.validate() }
267309
filters().ifPresent { it.forEach { it.validate() } }
310+
licenseTypeId()
268311
validated = true
269312
}
270313

@@ -286,7 +329,8 @@ private constructor(
286329
(if (allowsRollover.asKnown().isPresent) 1 else 0) +
287330
(if (currency.asKnown().isPresent) 1 else 0) +
288331
(customExpiration.asKnown().getOrNull()?.validity() ?: 0) +
289-
(filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
332+
(filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
333+
(if (licenseTypeId.asKnown().isPresent) 1 else 0)
290334

291335
class Filter
292336
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
@@ -828,15 +872,23 @@ private constructor(
828872
currency == other.currency &&
829873
customExpiration == other.customExpiration &&
830874
filters == other.filters &&
875+
licenseTypeId == other.licenseTypeId &&
831876
additionalProperties == other.additionalProperties
832877
}
833878

834879
private val hashCode: Int by lazy {
835-
Objects.hash(allowsRollover, currency, customExpiration, filters, additionalProperties)
880+
Objects.hash(
881+
allowsRollover,
882+
currency,
883+
customExpiration,
884+
filters,
885+
licenseTypeId,
886+
additionalProperties,
887+
)
836888
}
837889

838890
override fun hashCode(): Int = hashCode
839891

840892
override fun toString() =
841-
"Allocation{allowsRollover=$allowsRollover, currency=$currency, customExpiration=$customExpiration, filters=$filters, additionalProperties=$additionalProperties}"
893+
"Allocation{allowsRollover=$allowsRollover, currency=$currency, customExpiration=$customExpiration, filters=$filters, licenseTypeId=$licenseTypeId, additionalProperties=$additionalProperties}"
842894
}

0 commit comments

Comments
 (0)