@@ -23,7 +23,11 @@ import java.util.Objects
2323import java.util.Optional
2424import kotlin.jvm.optionals.getOrNull
2525
26- /* * Create a new sandbox from a template. Optionally blocks until ready or timeout. */
26+ /* *
27+ * Create a new sandbox. The snapshot may be identified by `snapshot_id` (UUID) or by
28+ * `snapshot_name` (tenant-scoped unique name); exactly one of `template_name`, `snapshot_id`, or
29+ * `snapshot_name` must be set. Optionally blocks until ready or timeout.
30+ */
2731class BoxCreateParams
2832private constructor (
2933 private val body: Body ,
@@ -67,6 +71,12 @@ private constructor(
6771 */
6872 fun snapshotId (): Optional <String > = body.snapshotId()
6973
74+ /* *
75+ * @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if the
76+ * server responded with an unexpected value).
77+ */
78+ fun snapshotName (): Optional <String > = body.snapshotName()
79+
7080 /* *
7181 * required for Kata path
7282 *
@@ -141,6 +151,13 @@ private constructor(
141151 */
142152 fun _snapshotId (): JsonField <String > = body._snapshotId ()
143153
154+ /* *
155+ * Returns the raw JSON value of [snapshotName].
156+ *
157+ * Unlike [snapshotName], this method doesn't throw if the JSON field has an unexpected type.
158+ */
159+ fun _snapshotName (): JsonField <String > = body._snapshotName ()
160+
144161 /* *
145162 * Returns the raw JSON value of [templateName].
146163 *
@@ -292,6 +309,19 @@ private constructor(
292309 */
293310 fun snapshotId (snapshotId : JsonField <String >) = apply { body.snapshotId(snapshotId) }
294311
312+ fun snapshotName (snapshotName : String ) = apply { body.snapshotName(snapshotName) }
313+
314+ /* *
315+ * Sets [Builder.snapshotName] to an arbitrary JSON value.
316+ *
317+ * You should usually call [Builder.snapshotName] with a well-typed [String] value instead.
318+ * This method is primarily for setting the field to an undocumented or not yet supported
319+ * value.
320+ */
321+ fun snapshotName (snapshotName : JsonField <String >) = apply {
322+ body.snapshotName(snapshotName)
323+ }
324+
295325 /* * required for Kata path */
296326 fun templateName (templateName : String ) = apply { body.templateName(templateName) }
297327
@@ -490,6 +520,7 @@ private constructor(
490520 private val name: JsonField <String >,
491521 private val proxyConfig: JsonField <ProxyConfig >,
492522 private val snapshotId: JsonField <String >,
523+ private val snapshotName: JsonField <String >,
493524 private val templateName: JsonField <String >,
494525 private val timeout: JsonField <Long >,
495526 private val ttlSeconds: JsonField <Long >,
@@ -514,6 +545,9 @@ private constructor(
514545 @JsonProperty(" snapshot_id" )
515546 @ExcludeMissing
516547 snapshotId: JsonField <String > = JsonMissing .of(),
548+ @JsonProperty(" snapshot_name" )
549+ @ExcludeMissing
550+ snapshotName: JsonField <String > = JsonMissing .of(),
517551 @JsonProperty(" template_name" )
518552 @ExcludeMissing
519553 templateName: JsonField <String > = JsonMissing .of(),
@@ -532,6 +566,7 @@ private constructor(
532566 name,
533567 proxyConfig,
534568 snapshotId,
569+ snapshotName,
535570 templateName,
536571 timeout,
537572 ttlSeconds,
@@ -576,6 +611,12 @@ private constructor(
576611 */
577612 fun snapshotId (): Optional <String > = snapshotId.getOptional(" snapshot_id" )
578613
614+ /* *
615+ * @throws LangChainInvalidDataException if the JSON field has an unexpected type (e.g. if
616+ * the server responded with an unexpected value).
617+ */
618+ fun snapshotName (): Optional <String > = snapshotName.getOptional(" snapshot_name" )
619+
579620 /* *
580621 * required for Kata path
581622 *
@@ -660,6 +701,16 @@ private constructor(
660701 @ExcludeMissing
661702 fun _snapshotId (): JsonField <String > = snapshotId
662703
704+ /* *
705+ * Returns the raw JSON value of [snapshotName].
706+ *
707+ * Unlike [snapshotName], this method doesn't throw if the JSON field has an unexpected
708+ * type.
709+ */
710+ @JsonProperty(" snapshot_name" )
711+ @ExcludeMissing
712+ fun _snapshotName (): JsonField <String > = snapshotName
713+
663714 /* *
664715 * Returns the raw JSON value of [templateName].
665716 *
@@ -728,6 +779,7 @@ private constructor(
728779 private var name: JsonField <String > = JsonMissing .of()
729780 private var proxyConfig: JsonField <ProxyConfig > = JsonMissing .of()
730781 private var snapshotId: JsonField <String > = JsonMissing .of()
782+ private var snapshotName: JsonField <String > = JsonMissing .of()
731783 private var templateName: JsonField <String > = JsonMissing .of()
732784 private var timeout: JsonField <Long > = JsonMissing .of()
733785 private var ttlSeconds: JsonField <Long > = JsonMissing .of()
@@ -743,6 +795,7 @@ private constructor(
743795 name = body.name
744796 proxyConfig = body.proxyConfig
745797 snapshotId = body.snapshotId
798+ snapshotName = body.snapshotName
746799 templateName = body.templateName
747800 timeout = body.timeout
748801 ttlSeconds = body.ttlSeconds
@@ -824,6 +877,19 @@ private constructor(
824877 */
825878 fun snapshotId (snapshotId : JsonField <String >) = apply { this .snapshotId = snapshotId }
826879
880+ fun snapshotName (snapshotName : String ) = snapshotName(JsonField .of(snapshotName))
881+
882+ /* *
883+ * Sets [Builder.snapshotName] to an arbitrary JSON value.
884+ *
885+ * You should usually call [Builder.snapshotName] with a well-typed [String] value
886+ * instead. This method is primarily for setting the field to an undocumented or not yet
887+ * supported value.
888+ */
889+ fun snapshotName (snapshotName : JsonField <String >) = apply {
890+ this .snapshotName = snapshotName
891+ }
892+
827893 /* * required for Kata path */
828894 fun templateName (templateName : String ) = templateName(JsonField .of(templateName))
829895
@@ -916,6 +982,7 @@ private constructor(
916982 name,
917983 proxyConfig,
918984 snapshotId,
985+ snapshotName,
919986 templateName,
920987 timeout,
921988 ttlSeconds,
@@ -938,6 +1005,7 @@ private constructor(
9381005 name()
9391006 proxyConfig().ifPresent { it.validate() }
9401007 snapshotId()
1008+ snapshotName()
9411009 templateName()
9421010 timeout()
9431011 ttlSeconds()
@@ -968,6 +1036,7 @@ private constructor(
9681036 (if (name.asKnown().isPresent) 1 else 0 ) +
9691037 (proxyConfig.asKnown().getOrNull()?.validity() ? : 0 ) +
9701038 (if (snapshotId.asKnown().isPresent) 1 else 0 ) +
1039+ (if (snapshotName.asKnown().isPresent) 1 else 0 ) +
9711040 (if (templateName.asKnown().isPresent) 1 else 0 ) +
9721041 (if (timeout.asKnown().isPresent) 1 else 0 ) +
9731042 (if (ttlSeconds.asKnown().isPresent) 1 else 0 ) +
@@ -986,6 +1055,7 @@ private constructor(
9861055 name == other.name &&
9871056 proxyConfig == other.proxyConfig &&
9881057 snapshotId == other.snapshotId &&
1058+ snapshotName == other.snapshotName &&
9891059 templateName == other.templateName &&
9901060 timeout == other.timeout &&
9911061 ttlSeconds == other.ttlSeconds &&
@@ -1002,6 +1072,7 @@ private constructor(
10021072 name,
10031073 proxyConfig,
10041074 snapshotId,
1075+ snapshotName,
10051076 templateName,
10061077 timeout,
10071078 ttlSeconds,
@@ -1014,7 +1085,7 @@ private constructor(
10141085 override fun hashCode (): Int = hashCode
10151086
10161087 override fun toString () =
1017- " Body{fsCapacityBytes=$fsCapacityBytes , idleTtlSeconds=$idleTtlSeconds , memBytes=$memBytes , name=$name , proxyConfig=$proxyConfig , snapshotId=$snapshotId , templateName=$templateName , timeout=$timeout , ttlSeconds=$ttlSeconds , vcpus=$vcpus , waitForReady=$waitForReady , additionalProperties=$additionalProperties }"
1088+ " Body{fsCapacityBytes=$fsCapacityBytes , idleTtlSeconds=$idleTtlSeconds , memBytes=$memBytes , name=$name , proxyConfig=$proxyConfig , snapshotId=$snapshotId , snapshotName= $snapshotName , templateName=$templateName , timeout=$timeout , ttlSeconds=$ttlSeconds , vcpus=$vcpus , waitForReady=$waitForReady , additionalProperties=$additionalProperties }"
10181089 }
10191090
10201091 class ProxyConfig
0 commit comments