Skip to content

Commit acfd5b0

Browse files
feat(api): api update
1 parent 7dfba2e commit acfd5b0

4 files changed

Lines changed: 112 additions & 6 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: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-537300bc28122d048ddd1b35dd797cf80154ea8e2282c92ce7cc8e041802184d.yml
3-
openapi_spec_hash: 58474f523bca2c01c89dc1391dc8570b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-1ef78b1a5567d95e588e2e41522ada4568b5ef06258a7b1a752226f58d3c519e.yml
3+
openapi_spec_hash: 7ad5c8d91d66b56d56b0788b5ef40d77
44
config_hash: 2d4163acdeacd75903f978cd79c35d14

arcade-java-core/src/main/kotlin/dev/arcade/models/workers/WorkerResponse.kt

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,10 @@ private constructor(
12971297
class Mcp
12981298
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
12991299
private constructor(
1300+
private val externalId: JsonField<String>,
13001301
private val headers: JsonField<Headers>,
13011302
private val oauth2: JsonField<Oauth2>,
1303+
private val redirectUri: JsonField<String>,
13021304
private val retry: JsonField<Long>,
13031305
private val secrets: JsonField<Secrets>,
13041306
private val timeout: JsonField<Long>,
@@ -1308,13 +1310,35 @@ private constructor(
13081310

13091311
@JsonCreator
13101312
private constructor(
1313+
@JsonProperty("external_id")
1314+
@ExcludeMissing
1315+
externalId: JsonField<String> = JsonMissing.of(),
13111316
@JsonProperty("headers") @ExcludeMissing headers: JsonField<Headers> = JsonMissing.of(),
13121317
@JsonProperty("oauth2") @ExcludeMissing oauth2: JsonField<Oauth2> = JsonMissing.of(),
1318+
@JsonProperty("redirect_uri")
1319+
@ExcludeMissing
1320+
redirectUri: JsonField<String> = JsonMissing.of(),
13131321
@JsonProperty("retry") @ExcludeMissing retry: JsonField<Long> = JsonMissing.of(),
13141322
@JsonProperty("secrets") @ExcludeMissing secrets: JsonField<Secrets> = JsonMissing.of(),
13151323
@JsonProperty("timeout") @ExcludeMissing timeout: JsonField<Long> = JsonMissing.of(),
13161324
@JsonProperty("uri") @ExcludeMissing uri: JsonField<String> = JsonMissing.of(),
1317-
) : this(headers, oauth2, retry, secrets, timeout, uri, mutableMapOf())
1325+
) : this(
1326+
externalId,
1327+
headers,
1328+
oauth2,
1329+
redirectUri,
1330+
retry,
1331+
secrets,
1332+
timeout,
1333+
uri,
1334+
mutableMapOf(),
1335+
)
1336+
1337+
/**
1338+
* @throws ArcadeInvalidDataException if the JSON field has an unexpected type (e.g. if the
1339+
* server responded with an unexpected value).
1340+
*/
1341+
fun externalId(): Optional<String> = externalId.getOptional("external_id")
13181342

13191343
/**
13201344
* @throws ArcadeInvalidDataException if the JSON field has an unexpected type (e.g. if the
@@ -1328,6 +1352,12 @@ private constructor(
13281352
*/
13291353
fun oauth2(): Optional<Oauth2> = oauth2.getOptional("oauth2")
13301354

1355+
/**
1356+
* @throws ArcadeInvalidDataException if the JSON field has an unexpected type (e.g. if the
1357+
* server responded with an unexpected value).
1358+
*/
1359+
fun redirectUri(): Optional<String> = redirectUri.getOptional("redirect_uri")
1360+
13311361
/**
13321362
* @throws ArcadeInvalidDataException if the JSON field has an unexpected type (e.g. if the
13331363
* server responded with an unexpected value).
@@ -1352,6 +1382,15 @@ private constructor(
13521382
*/
13531383
fun uri(): Optional<String> = uri.getOptional("uri")
13541384

1385+
/**
1386+
* Returns the raw JSON value of [externalId].
1387+
*
1388+
* Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type.
1389+
*/
1390+
@JsonProperty("external_id")
1391+
@ExcludeMissing
1392+
fun _externalId(): JsonField<String> = externalId
1393+
13551394
/**
13561395
* Returns the raw JSON value of [headers].
13571396
*
@@ -1366,6 +1405,15 @@ private constructor(
13661405
*/
13671406
@JsonProperty("oauth2") @ExcludeMissing fun _oauth2(): JsonField<Oauth2> = oauth2
13681407

1408+
/**
1409+
* Returns the raw JSON value of [redirectUri].
1410+
*
1411+
* Unlike [redirectUri], this method doesn't throw if the JSON field has an unexpected type.
1412+
*/
1413+
@JsonProperty("redirect_uri")
1414+
@ExcludeMissing
1415+
fun _redirectUri(): JsonField<String> = redirectUri
1416+
13691417
/**
13701418
* Returns the raw JSON value of [retry].
13711419
*
@@ -1415,8 +1463,10 @@ private constructor(
14151463
/** A builder for [Mcp]. */
14161464
class Builder internal constructor() {
14171465

1466+
private var externalId: JsonField<String> = JsonMissing.of()
14181467
private var headers: JsonField<Headers> = JsonMissing.of()
14191468
private var oauth2: JsonField<Oauth2> = JsonMissing.of()
1469+
private var redirectUri: JsonField<String> = JsonMissing.of()
14201470
private var retry: JsonField<Long> = JsonMissing.of()
14211471
private var secrets: JsonField<Secrets> = JsonMissing.of()
14221472
private var timeout: JsonField<Long> = JsonMissing.of()
@@ -1425,15 +1475,28 @@ private constructor(
14251475

14261476
@JvmSynthetic
14271477
internal fun from(mcp: Mcp) = apply {
1478+
externalId = mcp.externalId
14281479
headers = mcp.headers
14291480
oauth2 = mcp.oauth2
1481+
redirectUri = mcp.redirectUri
14301482
retry = mcp.retry
14311483
secrets = mcp.secrets
14321484
timeout = mcp.timeout
14331485
uri = mcp.uri
14341486
additionalProperties = mcp.additionalProperties.toMutableMap()
14351487
}
14361488

1489+
fun externalId(externalId: String) = externalId(JsonField.of(externalId))
1490+
1491+
/**
1492+
* Sets [Builder.externalId] to an arbitrary JSON value.
1493+
*
1494+
* You should usually call [Builder.externalId] with a well-typed [String] value
1495+
* instead. This method is primarily for setting the field to an undocumented or not yet
1496+
* supported value.
1497+
*/
1498+
fun externalId(externalId: JsonField<String>) = apply { this.externalId = externalId }
1499+
14371500
fun headers(headers: Headers) = headers(JsonField.of(headers))
14381501

14391502
/**
@@ -1456,6 +1519,19 @@ private constructor(
14561519
*/
14571520
fun oauth2(oauth2: JsonField<Oauth2>) = apply { this.oauth2 = oauth2 }
14581521

1522+
fun redirectUri(redirectUri: String) = redirectUri(JsonField.of(redirectUri))
1523+
1524+
/**
1525+
* Sets [Builder.redirectUri] to an arbitrary JSON value.
1526+
*
1527+
* You should usually call [Builder.redirectUri] with a well-typed [String] value
1528+
* instead. This method is primarily for setting the field to an undocumented or not yet
1529+
* supported value.
1530+
*/
1531+
fun redirectUri(redirectUri: JsonField<String>) = apply {
1532+
this.redirectUri = redirectUri
1533+
}
1534+
14591535
fun retry(retry: Long) = retry(JsonField.of(retry))
14601536

14611537
/**
@@ -1526,8 +1602,10 @@ private constructor(
15261602
*/
15271603
fun build(): Mcp =
15281604
Mcp(
1605+
externalId,
15291606
headers,
15301607
oauth2,
1608+
redirectUri,
15311609
retry,
15321610
secrets,
15331611
timeout,
@@ -1543,8 +1621,10 @@ private constructor(
15431621
return@apply
15441622
}
15451623

1624+
externalId()
15461625
headers().ifPresent { it.validate() }
15471626
oauth2().ifPresent { it.validate() }
1627+
redirectUri()
15481628
retry()
15491629
secrets().ifPresent { it.validate() }
15501630
timeout()
@@ -1568,8 +1648,10 @@ private constructor(
15681648
*/
15691649
@JvmSynthetic
15701650
internal fun validity(): Int =
1571-
(headers.asKnown().getOrNull()?.validity() ?: 0) +
1651+
(if (externalId.asKnown().isPresent) 1 else 0) +
1652+
(headers.asKnown().getOrNull()?.validity() ?: 0) +
15721653
(oauth2.asKnown().getOrNull()?.validity() ?: 0) +
1654+
(if (redirectUri.asKnown().isPresent) 1 else 0) +
15731655
(if (retry.asKnown().isPresent) 1 else 0) +
15741656
(secrets.asKnown().getOrNull()?.validity() ?: 0) +
15751657
(if (timeout.asKnown().isPresent) 1 else 0) +
@@ -2572,8 +2654,10 @@ private constructor(
25722654
}
25732655

25742656
return other is Mcp &&
2657+
externalId == other.externalId &&
25752658
headers == other.headers &&
25762659
oauth2 == other.oauth2 &&
2660+
redirectUri == other.redirectUri &&
25772661
retry == other.retry &&
25782662
secrets == other.secrets &&
25792663
timeout == other.timeout &&
@@ -2582,13 +2666,23 @@ private constructor(
25822666
}
25832667

25842668
private val hashCode: Int by lazy {
2585-
Objects.hash(headers, oauth2, retry, secrets, timeout, uri, additionalProperties)
2669+
Objects.hash(
2670+
externalId,
2671+
headers,
2672+
oauth2,
2673+
redirectUri,
2674+
retry,
2675+
secrets,
2676+
timeout,
2677+
uri,
2678+
additionalProperties,
2679+
)
25862680
}
25872681

25882682
override fun hashCode(): Int = hashCode
25892683

25902684
override fun toString() =
2591-
"Mcp{headers=$headers, oauth2=$oauth2, retry=$retry, secrets=$secrets, timeout=$timeout, uri=$uri, additionalProperties=$additionalProperties}"
2685+
"Mcp{externalId=$externalId, headers=$headers, oauth2=$oauth2, redirectUri=$redirectUri, retry=$retry, secrets=$secrets, timeout=$timeout, uri=$uri, additionalProperties=$additionalProperties}"
25922686
}
25932687

25942688
class Requirements

arcade-java-core/src/test/kotlin/dev/arcade/models/workers/WorkerListPageResponseTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ internal class WorkerListPageResponseTest {
4343
.managed(true)
4444
.mcp(
4545
WorkerResponse.Mcp.builder()
46+
.externalId("external_id")
4647
.headers(
4748
WorkerResponse.Mcp.Headers.builder()
4849
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -68,6 +69,7 @@ internal class WorkerListPageResponseTest {
6869
.addSupportedScope("string")
6970
.build()
7071
)
72+
.redirectUri("redirect_uri")
7173
.retry(0L)
7274
.secrets(
7375
WorkerResponse.Mcp.Secrets.builder()
@@ -142,6 +144,7 @@ internal class WorkerListPageResponseTest {
142144
.managed(true)
143145
.mcp(
144146
WorkerResponse.Mcp.builder()
147+
.externalId("external_id")
145148
.headers(
146149
WorkerResponse.Mcp.Headers.builder()
147150
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -167,6 +170,7 @@ internal class WorkerListPageResponseTest {
167170
.addSupportedScope("string")
168171
.build()
169172
)
173+
.redirectUri("redirect_uri")
170174
.retry(0L)
171175
.secrets(
172176
WorkerResponse.Mcp.Secrets.builder()
@@ -244,6 +248,7 @@ internal class WorkerListPageResponseTest {
244248
.managed(true)
245249
.mcp(
246250
WorkerResponse.Mcp.builder()
251+
.externalId("external_id")
247252
.headers(
248253
WorkerResponse.Mcp.Headers.builder()
249254
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -269,6 +274,7 @@ internal class WorkerListPageResponseTest {
269274
.addSupportedScope("string")
270275
.build()
271276
)
277+
.redirectUri("redirect_uri")
272278
.retry(0L)
273279
.secrets(
274280
WorkerResponse.Mcp.Secrets.builder()

arcade-java-core/src/test/kotlin/dev/arcade/models/workers/WorkerResponseTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ internal class WorkerResponseTest {
4040
.managed(true)
4141
.mcp(
4242
WorkerResponse.Mcp.builder()
43+
.externalId("external_id")
4344
.headers(
4445
WorkerResponse.Mcp.Headers.builder()
4546
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -64,6 +65,7 @@ internal class WorkerResponseTest {
6465
.addSupportedScope("string")
6566
.build()
6667
)
68+
.redirectUri("redirect_uri")
6769
.retry(0L)
6870
.secrets(
6971
WorkerResponse.Mcp.Secrets.builder()
@@ -131,6 +133,7 @@ internal class WorkerResponseTest {
131133
assertThat(workerResponse.mcp())
132134
.contains(
133135
WorkerResponse.Mcp.builder()
136+
.externalId("external_id")
134137
.headers(
135138
WorkerResponse.Mcp.Headers.builder()
136139
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -153,6 +156,7 @@ internal class WorkerResponseTest {
153156
.addSupportedScope("string")
154157
.build()
155158
)
159+
.redirectUri("redirect_uri")
156160
.retry(0L)
157161
.secrets(
158162
WorkerResponse.Mcp.Secrets.builder()
@@ -223,6 +227,7 @@ internal class WorkerResponseTest {
223227
.managed(true)
224228
.mcp(
225229
WorkerResponse.Mcp.builder()
230+
.externalId("external_id")
226231
.headers(
227232
WorkerResponse.Mcp.Headers.builder()
228233
.putAdditionalProperty("foo", JsonValue.from("string"))
@@ -247,6 +252,7 @@ internal class WorkerResponseTest {
247252
.addSupportedScope("string")
248253
.build()
249254
)
255+
.redirectUri("redirect_uri")
250256
.retry(0L)
251257
.secrets(
252258
WorkerResponse.Mcp.Secrets.builder()

0 commit comments

Comments
 (0)