Skip to content

Commit 21029e1

Browse files
feat(api): api update
1 parent 9a58acb commit 21029e1

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 45
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-73c284d36c1ed2d9963fc733e421005fad76e559de8efe9baa6511a43dd72668.yml
3-
openapi_spec_hash: 1e58c4445919b71c77e5c7f16bd6fa7d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-d5e464682bd08cc19d0c41aa783238846cdc1162a8765083bd5c7e3ca78655d5.yml
3+
openapi_spec_hash: 40b39b0a6fcd33ce59c96bec3ebb5985
44
config_hash: 5146b12344dae76238940989dac1e8a0

finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private constructor(
108108

109109
/**
110110
* The datetime a job is scheduled to be run. For scheduled jobs, this datetime can be in the
111-
* future if the job has not yet been enqueued. For ad-hoc jobs, this field will be null.
111+
* future if the job has not yet been enqueued. For ad-hoc jobs, this field will be null.
112112
*
113113
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
114114
* server responded with an unexpected value).
@@ -342,8 +342,8 @@ private constructor(
342342

343343
/**
344344
* The datetime a job is scheduled to be run. For scheduled jobs, this datetime can be in
345-
* the future if the job has not yet been enqueued. For ad-hoc jobs, this field will
346-
* be null.
345+
* the future if the job has not yet been enqueued. For ad-hoc jobs, this field will be
346+
* null.
347347
*/
348348
fun scheduledAt(scheduledAt: OffsetDateTime?) =
349349
scheduledAt(JsonField.ofNullable(scheduledAt))

finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ import kotlin.jvm.optionals.getOrNull
2222

2323
class ManualAsyncJob
2424
private constructor(
25-
private val body: JsonField<List<JsonValue>>,
25+
private val body: JsonField<List<JsonValue?>>,
2626
private val jobId: JsonField<String>,
2727
private val status: JsonField<Status>,
2828
private val additionalProperties: MutableMap<String, JsonValue>,
2929
) {
3030

3131
@JsonCreator
3232
private constructor(
33-
@JsonProperty("body") @ExcludeMissing body: JsonField<List<JsonValue>> = JsonMissing.of(),
33+
@JsonProperty("body") @ExcludeMissing body: JsonField<List<JsonValue?>> = JsonMissing.of(),
3434
@JsonProperty("job_id") @ExcludeMissing jobId: JsonField<String> = JsonMissing.of(),
3535
@JsonProperty("status") @ExcludeMissing status: JsonField<Status> = JsonMissing.of(),
3636
) : this(body, jobId, status, mutableMapOf())
@@ -41,7 +41,7 @@ private constructor(
4141
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
4242
* server responded with an unexpected value).
4343
*/
44-
fun body(): Optional<List<JsonValue>> = body.getOptional("body")
44+
fun body(): Optional<List<JsonValue?>> = body.getOptional("body")
4545

4646
/**
4747
* @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly
@@ -60,7 +60,7 @@ private constructor(
6060
*
6161
* Unlike [body], this method doesn't throw if the JSON field has an unexpected type.
6262
*/
63-
@JsonProperty("body") @ExcludeMissing fun _body(): JsonField<List<JsonValue>> = body
63+
@JsonProperty("body") @ExcludeMissing fun _body(): JsonField<List<JsonValue?>> = body
6464

6565
/**
6666
* Returns the raw JSON value of [jobId].
@@ -106,7 +106,7 @@ private constructor(
106106
/** A builder for [ManualAsyncJob]. */
107107
class Builder internal constructor() {
108108

109-
private var body: JsonField<MutableList<JsonValue>>? = null
109+
private var body: JsonField<MutableList<JsonValue?>>? = null
110110
private var jobId: JsonField<String>? = null
111111
private var status: JsonField<Status>? = null
112112
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -120,19 +120,19 @@ private constructor(
120120
}
121121

122122
/** Specific information about the job, such as individual statuses for batch jobs. */
123-
fun body(body: List<JsonValue>?) = body(JsonField.ofNullable(body))
123+
fun body(body: List<JsonValue?>?) = body(JsonField.ofNullable(body))
124124

125125
/** Alias for calling [Builder.body] with `body.orElse(null)`. */
126-
fun body(body: Optional<List<JsonValue>>) = body(body.getOrNull())
126+
fun body(body: Optional<List<JsonValue?>>) = body(body.getOrNull())
127127

128128
/**
129129
* Sets [Builder.body] to an arbitrary JSON value.
130130
*
131-
* You should usually call [Builder.body] with a well-typed `List<JsonValue>` value instead.
132-
* This method is primarily for setting the field to an undocumented or not yet supported
133-
* value.
131+
* You should usually call [Builder.body] with a well-typed `List<JsonValue?>` value
132+
* instead. This method is primarily for setting the field to an undocumented or not yet
133+
* supported value.
134134
*/
135-
fun body(body: JsonField<List<JsonValue>>) = apply {
135+
fun body(body: JsonField<List<JsonValue?>>) = apply {
136136
this.body = body.map { it.toMutableList() }
137137
}
138138

@@ -238,7 +238,7 @@ private constructor(
238238
*/
239239
@JvmSynthetic
240240
internal fun validity(): Int =
241-
(body.asKnown().getOrNull()?.size ?: 0) +
241+
(body.asKnown().getOrNull()?.sumOf { (if (it == null) 0 else 1).toInt() } ?: 0) +
242242
(if (jobId.asKnown().isPresent) 1 else 0) +
243243
(status.asKnown().getOrNull()?.validity() ?: 0)
244244

0 commit comments

Comments
 (0)