Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(fleet-sdk): generate cross-language UniFFI record builders (#6526)

r33drichards694c83967970
diff --git a/libs/fleet/Cargo.lock b/libs/fleet/Cargo.lock
index 3ece20285c..6fb5ffdbde 100644
--- a/libs/fleet/Cargo.lock
+++ b/libs/fleet/Cargo.lock
@@ -279,6 +279,7 @@ dependencies = [
"thiserror",
"tokio",
"uniffi",
+ "uniffi-builder-derive",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
@@ -308,6 +309,7 @@ dependencies = [
"tempfile",
"thiserror",
"uniffi",
+ "uniffi-builder-derive",
]
[[package]]
@@ -1897,6 +1899,15 @@ dependencies = [
"uniffi_pipeline",
]
+[[package]]
+name = "uniffi-builder-derive"
+version = "0.1.0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
[[package]]
name = "uniffi_bindgen"
version = "0.31.0"
diff --git a/libs/fleet/Cargo.toml b/libs/fleet/Cargo.toml
index 9d3dd8cdd2..302f195655 100644
--- a/libs/fleet/Cargo.toml
+++ b/libs/fleet/Cargo.toml
@@ -1,5 +1,5 @@
[workspace]
-members = ["sdk-schema", "sdk", "bindgen-cli"]
+members = ["sdk-schema", "sdk", "bindgen-cli", "uniffi-builder-derive"]
resolver = "2"
[workspace.package]
diff --git a/libs/fleet/scripts/generate-sdk-bindings.sh b/libs/fleet/scripts/generate-sdk-bindings.sh
index a8d799f258..60525066f5 100755
--- a/libs/fleet/scripts/generate-sdk-bindings.sh
+++ b/libs/fleet/scripts/generate-sdk-bindings.sh
@@ -120,6 +120,7 @@ ruby_method_names() {
source_file="$1"
method_prefix="$2"
case "$method_prefix" in
+ alloc) pattern='alloc_from_(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;
check_lower) pattern='check_lower_[A-Za-z0-9_]+' ;;
read) pattern='read(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;
write) pattern='write_(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;
@@ -131,6 +132,7 @@ ruby_defined_method_names() {
source_file="$1"
method_prefix="$2"
case "$method_prefix" in
+ alloc) pattern='alloc_from_(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;
check_lower) pattern='check_lower_[A-Za-z0-9_]+' ;;
read) pattern='read(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;
write) pattern='write_(Type|OptionalType|SequenceType|MapType)[A-Za-z0-9_]+' ;;
@@ -154,7 +156,7 @@ write_ruby_facade() {
sdk_file="$1"
schema_file="$2"
facade_file="$3"
- for method_prefix in check_lower read write; do
+ for method_prefix in alloc check_lower read write; do
references="$temporary_output/ruby-$method_prefix-references"
definitions="$temporary_output/ruby-$method_prefix-definitions"
schema_definitions="$temporary_output/ruby-schema-$method_prefix-definitions"
@@ -185,6 +187,7 @@ module FleetSdk
const_set(name, CyclopsSdkSchema.const_get(name)) unless const_defined?(name, false)
end
RUBY_FACADE_HEADER
+ write_ruby_method_array "SCHEMA_ALLOC_METHODS" "$temporary_output/ruby-alloc-external" "$facade_file"
write_ruby_method_array "SCHEMA_CHECK_LOWER_METHODS" "$temporary_output/ruby-check_lower-external" "$facade_file"
write_ruby_method_array "SCHEMA_READ_METHODS" "$temporary_output/ruby-read-external" "$facade_file"
write_ruby_method_array "SCHEMA_WRITE_METHODS" "$temporary_output/ruby-write-external" "$facade_file"
@@ -193,6 +196,20 @@ RUBY_FACADE_HEADER
schema_rust_buffer = CyclopsSdkSchema::RustBuffer
schema_stream = CyclopsSdkSchema.const_get(:RustBufferStream, false)
+ SCHEMA_ALLOC_METHODS.each do |method_name|
+ RustBuffer.define_singleton_method(method_name) do |value|
+ buffer = schema_rust_buffer.public_send(method_name, value)
+ begin
+ RustBuffer.allocWithBuilder do |builder|
+ builder.write(buffer.data.read_bytes(buffer.len))
+ builder.finalize
+ end
+ ensure
+ buffer.free
+ end
+ end
+ end
+
SCHEMA_CHECK_LOWER_METHODS.each do |method_name|
RustBuffer.define_singleton_method(method_name) do |value|
schema_rust_buffer.public_send(method_name.to_s.gsub("OsGym", "OSGym"), value)
@@ -221,7 +238,8 @@ RUBY_FACADE_HEADER
end
end
- private_constant :SCHEMA_CHECK_LOWER_METHODS, :SCHEMA_READ_METHODS, :SCHEMA_WRITE_METHODS
+ private_constant :SCHEMA_ALLOC_METHODS, :SCHEMA_CHECK_LOWER_METHODS,
+ :SCHEMA_READ_METHODS, :SCHEMA_WRITE_METHODS
end
RUBY_FACADE_FOOTER
}
@@ -231,9 +249,11 @@ write_python_facade() {
schema_file="$2"
facade_file="$3"
private_exports="$temporary_output/python-schema-private-exports"
+ converter_adapters="$temporary_output/python-schema-converter-adapters"
grep_matches_or_empty 'fleet_sdk\._[A-Za-z_][A-Za-z0-9_]*' "$sdk_file" \
| sed 's/^fleet_sdk\.//' | LC_ALL=C sort -u > "$private_exports"
+ : > "$converter_adapters"
cat > "$facade_file" <<'PYTHON_FACADE_HEADER'
from . import _schema as _schema_component
@@ -245,18 +265,33 @@ PYTHON_FACADE_HEADER
echo "error: generated Python SDK references missing schema symbol: $symbol" >&2
return 1
fi
- printf '%s = _schema_component.%s\n' "$symbol" "$symbol" >> "$facade_file"
+ case "$symbol" in
+ _UniffiFfiConverterType*)
+ cat >> "$converter_adapters" <<PYTHON_CONVERTER_ADAPTER
+class $symbol(_sdk_component._UniffiConverterRustBuffer):
+ check_lower = staticmethod(_schema_component.$symbol.check_lower)
+ read = staticmethod(_schema_component.$symbol.read)
+ write = staticmethod(_schema_component.$symbol.write)
+
+PYTHON_CONVERTER_ADAPTER
+ ;;
+ *) printf '%s = _schema_component.%s\n' "$symbol" "$symbol" >> "$facade_file" ;;
+ esac
done < "$private_exports"
- cat >> "$facade_file" <<'PYTHON_FACADE_FOOTER'
+ {
+ cat <<'PYTHON_SDK_IMPORT'
from . import _sdk as _sdk_component
from ._sdk import *
-
+PYTHON_SDK_IMPORT
+ cat "$converter_adapters"
+ cat <<'PYTHON_FACADE_FOOTER'
__all__ = [*_schema_component.__all__, *_sdk_component.__all__]
del _schema_component
del _sdk_component
PYTHON_FACADE_FOOTER
+ } >> "$facade_file"
}
normalize_generated_text() {
@@ -796,7 +831,7 @@ if future_runtime_anchor not in text:
raise SystemExit("expected Ruby error helper declaration not found")
text = text.replace(future_runtime_anchor, future_runtime, 1)
-buffer_pattern = r"(?m)^(\s*)result = FleetSdk\.rust_call_with_error\(([^,]+),:([a-z0-9_]+),(.*)\)$"
+buffer_pattern = r"(?m)^(\s*)result = FleetSdk\.rust_call_with_error\(([^,]+),:((?![a-z0-9_]*builder_build\b)[a-z0-9_]+),(.*)\)$"
def replace_buffer(match):
indent, error_module, function, arguments = match.groups()
arguments = arguments.rstrip().removesuffix(",")
@@ -809,6 +844,8 @@ def replace_buffer(match):
text, buffer_replacements = re.subn(buffer_pattern, replace_buffer, text)
if buffer_replacements != 21:
raise SystemExit(f"expected 21 Ruby Rust-buffer future wrappers, found {buffer_replacements}")
+if len(re.findall(r"result = FleetSdk\.rust_call_with_error\(SdkBuildError,:uniffi_[a-z0-9_]*builder_build,", text)) != 2:
+ raise SystemExit("expected two synchronous Ruby SDK builder build calls")
void_pattern = r"(?m)^(\s*)FleetSdk\.rust_call_with_error\(([^,]+),:([a-z0-9_]+),(.*)\)$"
def replace_void(match):
diff --git a/libs/fleet/scripts/test-generate-sdk-bindings.sh b/libs/fleet/scripts/test-generate-sdk-bindings.sh
index 2cdaa98b37..4fc9fb560a 100755
--- a/libs/fleet/scripts/test-generate-sdk-bindings.sh
+++ b/libs/fleet/scripts/test-generate-sdk-bindings.sh
@@ -321,12 +321,14 @@ async def smoke_create_pool():
),
transport,
)
- spec = fleet_sdk.OsGymSandboxWarmPoolSpec(
- replicas=1,
- sandbox_template_ref=fleet_sdk.SandboxTemplateRef(name="default"),
- autoscaling=None,
- )
- pool = await client.create_pool(fleet_sdk.CreatePoolRequest(namespace="default", spec=spec))
+ spec = fleet_sdk.OsGymSandboxWarmPoolSpecBuilder().replicas(1).sandbox_template_ref(
+ fleet_sdk.SandboxTemplateRefBuilder().name("default").build()
+ ).build()
+ request = fleet_sdk.CreatePoolRequestBuilder().namespace("default").spec(spec).build()
+ assert type(spec) is fleet_sdk.OsGymSandboxWarmPoolSpec
+ assert type(request) is fleet_sdk.CreatePoolRequest
+ assert spec.autoscaling is None
+ pool = await client.create_pool(request)
assert pool.metadata.name == "offline-pool"
assert any(request.url.endswith("/osgymsandboxwarmpools") for request in transport.requests)
@@ -336,11 +338,33 @@ rm "$runtime_copy"
runtime_copy=""
"$generator" --check
python_sdk_source="$bindings_dir/python/fleet_sdk/_sdk.py"
+python_schema_source="$bindings_dir/python/fleet_sdk/_schema.py"
kotlin_sdk_source="$bindings_dir/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt"
+kotlin_schema_source="$bindings_dir/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt"
swift_sdk_source="$bindings_dir/swift/CyclopsSdk.swift"
+swift_schema_source="$bindings_dir/swift/CyclopsSdkSchema.swift"
ruby_sdk_source="$bindings_dir/ruby/cyclops_sdk/sdk.rb"
+ruby_schema_source="$bindings_dir/ruby/cyclops_sdk/schema.rb"
node_sdk_source="$bindings_dir/ts-uniffi/fleet_sdk.ts"
+browser_sdk_source="$bindings_dir/ts-uniffi-browser/ts/fleet_sdk.ts"
go_sdk_source="$bindings_dir/go-uniffi/fleet_sdk/fleet_sdk.go"
+
+for separate_binding in "$node_sdk_source" "$browser_sdk_source" "$go_sdk_source"; do
+ if grep -Fq -- "VmTemplateBuilder" "$separate_binding" || grep -Fq -- "CreatePoolRequestBuilder" "$separate_binding"; then
+ fail "separately generated Go/TypeScript binding unexpectedly contains authoritative builders: $separate_binding"
+ fi
+done
+
+grep -Fq -- "class VmTemplateBuilder" "$python_schema_source" || fail "Python bindings omit VmTemplateBuilder"
+grep -Fq -- "class CreatePoolRequestBuilder" "$python_sdk_source" || fail "Python bindings omit CreatePoolRequestBuilder"
+grep -Fq -- "open class VmTemplateBuilder" "$kotlin_schema_source" || fail "Kotlin bindings omit VmTemplateBuilder"
+grep -Fq -- "open class CreatePoolRequestBuilder" "$kotlin_sdk_source" || fail "Kotlin bindings omit CreatePoolRequestBuilder"
+grep -Fq -- "open class VmTemplateBuilder" "$swift_schema_source" || fail "Swift bindings omit VmTemplateBuilder"
+grep -Fq -- "open class CreatePoolRequestBuilder" "$swift_sdk_source" || fail "Swift bindings omit CreatePoolRequestBuilder"
+grep -Fq -- "class VmTemplateBuilder" "$ruby_schema_source" || fail "Ruby bindings omit VmTemplateBuilder"
+grep -Fq -- "class CreatePoolRequestBuilder" "$ruby_sdk_source" || fail "Ruby bindings omit CreatePoolRequestBuilder"
+grep -Fq -- "alloc_from_TypeOSGymSandboxTemplateSpec" "$bindings_dir/ruby/cyclops_sdk.rb" || \
+ fail "Ruby facade omits cross-component record allocation adapter"
if grep -Fq -- "execute_authenticated" "$python_sdk_source"; then fail "Python bindings export execute_authenticated"; fi
if grep -Fq -- "executeAuthenticated" "$kotlin_sdk_source"; then fail "Kotlin bindings export executeAuthenticated"; fi
if grep -Fq -- "executeAuthenticated" "$swift_sdk_source"; then fail "Swift bindings export executeAuthenticated"; fi
diff --git a/libs/fleet/sdk-bindings/README.md b/libs/fleet/sdk-bindings/README.md
index 35d244e854..c9e347b8a0 100644
--- a/libs/fleet/sdk-bindings/README.md
+++ b/libs/fleet/sdk-bindings/README.md
@@ -1,10 +1,33 @@
# Cyclops UniFFI SDK bindings
-This directory contains the checked-in, generated source for the official
-Cyclops SDK bindings: **Python, Kotlin, Swift, and Ruby**. Rust is the native
-`cyclops-sdk` API and owns the canonical implementation. JavaScript/OpenAPI
-clients, arbitrary community-language wrappers, and native-library packaging
-are outside this binding surface.
+This directory contains the checked-in generated sources for several Cyclops
+SDK targets. Rust is the native `cyclops-sdk` API and owns the canonical
+implementation. The authoritative deterministic generation and drift pipeline
+in `generate-sdk-bindings.sh` owns **Python, Kotlin, Swift, and Ruby**.
+The OpenAPI JavaScript client and native-library packaging are outside that
+four-language binding surface; separate UniFFI snapshots are described below.
+
+### Separately generated targets
+
+`go-uniffi`, `ts-uniffi` (Node.js), and `ts-uniffi-browser` are checked-in
+compatibility snapshots produced by `uniffi-bindgen-go` and
+`uniffi-bindgen-react-native`, not outputs of `generate-sdk-bindings.sh`. They
+consume the same Rust cdylib, whose UniFFI metadata includes the builder
+objects, but their checked-in sources are not owned or drift-checked by this
+testbed. The Go and Node.js snapshots are not regenerated here. Browser/WASM
+packaging runs UBRN generation during its build, but no committed-source drift
+or builder contract verifies that generated surface. The checked-in separate
+snapshots therefore retain direct record constructors and do not currently
+advertise `UniffiBuilder` companions.
+
+This is a binding-pipeline adoption gap, not a Rust or UniFFI metadata
+limitation. Adding builders to the Go, Node.js, or browser/WASM public
+contracts requires separately regenerating where applicable and
+validating each third-party generator, cross-component converter layer,
+packaging path, checked-in scope, and runtime API. Until that work lands,
+"authoritative generated builder targets" in this document means only Python,
+Kotlin, Swift, and Ruby; do not infer builder availability for the separate
+snapshots or from browser build-time generation alone.
## Source of truth and compatibility
@@ -61,7 +84,7 @@ cargo run --locked --manifest-path "$REPO_ROOT/cyclops-cs/Cargo.toml" \
```
Generate or check all four UniFFI language roots with the pinned workspace
-wrapper around UniFFI `0.32.0`:
+wrapper around UniFFI `0.31.0`:
```sh
"$REPO_ROOT/cyclops-cs/scripts/generate-sdk-bindings.sh"
@@ -95,6 +118,8 @@ export CYCLOPS_SDK_NATIVE_TARGET_DIR="$REPO_ROOT/cyclops-cs/target/sdk-bindings-
Run the Python contract and deterministic lifecycle example:
```sh
+"$REPO_ROOT/cyclops-cs/scripts/run-python-sdk-binding.sh" \
+ "$REPO_ROOT/cyclops-cs/sdk-bindings/python/tests/test_builders.py" -v
"$REPO_ROOT/cyclops-cs/scripts/run-python-sdk-binding.sh" \
"$REPO_ROOT/cyclops-cs/sdk-bindings/python/tests/test_async_client.py" -v
"$REPO_ROOT/cyclops-cs/scripts/run-python-sdk-binding.sh" \
@@ -105,6 +130,7 @@ Run the Kotlin contract and example after staging the Linux cdylib:
```sh
export CYCLOPS_SDK_NATIVE_DIR="$(dirname "$CYCLOPS_SDK_NATIVE_TARGET_DIR/debug/libcyclops_sdk.so")"
+gradle -p "$REPO_ROOT/cyclops-cs/sdk-bindings/kotlin" builderContract
gradle -p "$REPO_ROOT/cyclops-cs/sdk-bindings/kotlin" contract
gradle -p "$REPO_ROOT/cyclops-cs/sdk-bindings/kotlin" example
```
@@ -112,6 +138,8 @@ gradle -p "$REPO_ROOT/cyclops-cs/sdk-bindings/kotlin" example
Run the Ruby contract and example:
```sh
+"$REPO_ROOT/cyclops-cs/scripts/run-ruby-sdk-binding.sh" \
+ "$REPO_ROOT/cyclops-cs/sdk-bindings/ruby/tests/test_builders.rb"
"$REPO_ROOT/cyclops-cs/scripts/run-ruby-sdk-binding.sh" \
"$REPO_ROOT/cyclops-cs/sdk-bindings/ruby/tests/test_async_client.rb"
"$REPO_ROOT/cyclops-cs/scripts/run-ruby-sdk-binding.sh" \
@@ -124,6 +152,8 @@ compiles `CyclopsSdk.swift` and `CyclopsSdkSchema.swift` together into one
an rpath to the host `libcyclops_sdk.dylib`.
```sh
+"$REPO_ROOT/cyclops-cs/scripts/run-swift-sdk-binding.sh" \
+ "$REPO_ROOT/cyclops-cs/sdk-bindings/swift/tests/TestBuilders.swift"
"$REPO_ROOT/cyclops-cs/scripts/run-swift-sdk-binding.sh" \
"$REPO_ROOT/cyclops-cs/sdk-bindings/swift/tests/TestAsyncClient.swift"
"$REPO_ROOT/cyclops-cs/scripts/run-swift-sdk-binding.sh" \
@@ -132,6 +162,57 @@ an rpath to the host `libcyclops_sdk.dylib`.
## Typed lifecycle shape
+### Generated record builders
+
+The seven sandbox-pool records `VmTemplate`, `SandboxService`,
+`OSGymSandboxTemplateSpec`, `CreateTemplateRequest`, `SandboxTemplateRef`,
+`OSGymSandboxWarmPoolSpec`, and `CreatePoolRequest` expose generated builders.
+Each setter returns a new immutable builder object; it does not mutate the
+receiver. Keep the returned value, either by chaining calls or assigning it.
+This `&self -> Arc<Self>` Rust receiver shape is portable across the four
+official UniFFI targets and avoids foreign-language interior mutability.
+
+Python:
+
+```python
+vm = (fleet_sdk.VmTemplateBuilder().container_disk_image(image)
+ .image_pull_secret(secret).cpu_cores(4).memory("8Gi")
+ .services([service]).build())
+```
+
+Kotlin:
+
+```kotlin
+val vm: VmTemplate = VmTemplateBuilder().containerDiskImage(image)
+ .imagePullSecret(secret).cpuCores(4u).memory("8Gi")
+ .services(listOf(service)).build()
+```
+
+Swift:
+
+```swift
+let vm: VmTemplate = try VmTemplateBuilder().containerDiskImage(value: image)
+ .imagePullSecret(value: secret).cpuCores(value: 4).memory(value: "8Gi")
+ .services(value: [service]).build()
+```
+
+Ruby:
+
+```ruby
+vm = FleetSdk::VmTemplateBuilder.new.container_disk_image(image)
+ .image_pull_secret(secret).cpu_cores(4).memory('8Gi')
+ .services([service]).build
+```
+
+Optional setters may be omitted; their record fields remain `None`, `null`, or
+`nil` as appropriate. `build()` returns the exact existing record type and
+reports an omitted required field through stable `SchemaBuildError` or
+`SdkBuildError` variants (generated as `SchemaBuildException` and
+`SdkBuildException` in Kotlin). Existing direct record constructors remain
+available and unchanged. At the syntax-only derive boundary, optional record
+fields must be spelled `Option<T>`, `std::option::Option<T>`, or
+`core::option::Option<T>`; type aliases are not inferred.
+
Use the generated constructors and schema records rather than ad-hoc JSON.
The exact optional fields and language naming are generated, so consult the
checked-in language source for the complete constructor signatures. The Python
diff --git a/libs/fleet/sdk-bindings/go-uniffi/README.md b/libs/fleet/sdk-bindings/go-uniffi/README.md
index 6d51670209..b2a723f9bc 100644
--- a/libs/fleet/sdk-bindings/go-uniffi/README.md
+++ b/libs/fleet/sdk-bindings/go-uniffi/README.md
@@ -1,6 +1,10 @@
# Cyclops Go UniFFI bindings
-Generated with `uniffi-bindgen-go v0.7.1+v0.31.0`. Build consumers with the
-Cyclops Rust cdylib available to cgo, for example:
+Generated with `uniffi-bindgen-go v0.7.1+v0.31.0`. This checked-in snapshot is
+outside `scripts/generate-sdk-bindings.sh`; it currently exposes direct record
+constructors, not the newer `UniffiBuilder` objects present in Rust metadata.
+Regenerating and validating this separate pipeline is required before builders
+can be advertised for Go. Build consumers with the Cyclops Rust cdylib
+available to cgo, for example:
`CGO_LDFLAGS='-L/path/to -lcyclops_sdk' LD_LIBRARY_PATH=/path/to go test ./...`
diff --git a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt
index 2e114d72ab..991e0fb155 100644
--- a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt
+++ b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/fleet_sdk.kt
@@ -752,6 +752,20 @@ internal object IntegrityCheckingUniffiLib {
): Short
external fun uniffi_cyclops_sdk_checksum_method_httpclient_execute(
): Short
+ external fun uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_build(
+ ): Short
+ external fun uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_namespace(
+ ): Short
+ external fun uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_spec(
+ ): Short
+ external fun uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_build(
+ ): Short
+ external fun uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_name(
+ ): Short
+ external fun uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_namespace(
+ ): Short
+ external fun uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_spec(
+ ): Short
external fun uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect(
): Short
external fun uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token(
@@ -766,6 +780,10 @@ internal object IntegrityCheckingUniffiLib {
): Short
external fun uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_native_http_client(
): Short
+ external fun uniffi_cyclops_sdk_checksum_constructor_createpoolrequestbuilder_new(
+ ): Short
+ external fun uniffi_cyclops_sdk_checksum_constructor_createtemplaterequestbuilder_new(
+ ): Short
external fun uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new(
): Short
external fun ffi_cyclops_sdk_uniffi_contract_version(
@@ -869,6 +887,32 @@ external fun uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient(`vtable`: Uni
): Unit
external fun uniffi_cyclops_sdk_fn_method_httpclient_execute(`ptr`: Long,`request`: RustBuffer.ByValue,
): Long
+external fun uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new(uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec(`ptr`: Long,`value`: RustBufferOSGymSandboxWarmPoolSpec.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new(uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec(`ptr`: Long,`value`: RustBufferOSGymSandboxTemplateSpec.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
external fun uniffi_cyclops_sdk_fn_clone_cyclopscredentials(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
): Long
external fun uniffi_cyclops_sdk_fn_free_cyclopscredentials(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
@@ -1069,6 +1113,27 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_cyclops_sdk_checksum_method_httpclient_execute() != 38803.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
+ if (lib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_build() != 60558.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_namespace() != 18934.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_spec() != 7566.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_build() != 46749.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_name() != 38970.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_namespace() != 38181.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_spec() != 29902.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
if (lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() != 54404.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
@@ -1090,6 +1155,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_native_http_client() != 49301.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
+ if (lib.uniffi_cyclops_sdk_checksum_constructor_createpoolrequestbuilder_new() != 33658.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_checksum_constructor_createtemplaterequestbuilder_new() != 6787.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
if (lib.uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new() != 25746.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
@@ -1534,47 +1605,672 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
}
}
- override fun lower(value: String): RustBuffer.ByValue {
- val byteBuf = toUtf8(value)
- // Ideally we'd pass these bytes to `ffi_bytebuffer_from_bytes`, but doing so would require us
- // to copy them into a JNA `Memory`. So we might as well directly copy them into a `RustBuffer`.
- val rbuf = RustBuffer.alloc(byteBuf.limit().toULong())
- rbuf.asByteBuffer()!!.put(byteBuf)
- return rbuf
+ override fun lower(value: String): RustBuffer.ByValue {
+ val byteBuf = toUtf8(value)
+ // Ideally we'd pass these bytes to `ffi_bytebuffer_from_bytes`, but doing so would require us
+ // to copy them into a JNA `Memory`. So we might as well directly copy them into a `RustBuffer`.
+ val rbuf = RustBuffer.alloc(byteBuf.limit().toULong())
+ rbuf.asByteBuffer()!!.put(byteBuf)
+ return rbuf
+ }
+
+ // We aren't sure exactly how many bytes our string will be once it's UTF-8
+ // encoded. Allocate 3 bytes per UTF-16 code unit which will always be
+ // enough.
+ override fun allocationSize(value: String): ULong {
+ val sizeForLength = 4UL
+ val sizeForString = value.length.toULong() * 3UL
+ return sizeForLength + sizeForString
+ }
+
+ override fun write(value: String, buf: ByteBuffer) {
+ val byteBuf = toUtf8(value)
+ buf.putInt(byteBuf.limit())
+ buf.put(byteBuf)
+ }
+}
+
+/**
+ * @suppress
+ */
+public object FfiConverterByteArray: FfiConverterRustBuffer<ByteArray> {
+ override fun read(buf: ByteBuffer): ByteArray {
+ val len = buf.getInt()
+ val byteArr = ByteArray(len)
+ buf.get(byteArr)
+ return byteArr
+ }
+ override fun allocationSize(value: ByteArray): ULong {
+ return 4UL + value.size.toULong()
+ }
+ override fun write(value: ByteArray, buf: ByteBuffer) {
+ buf.putInt(value.size)
+ buf.put(value)
+ }
+}
+
+
+// This template implements a class for working with a Rust struct via a handle
+// to the live Rust struct on the other side of the FFI.
+//
+// There's some subtlety here, because we have to be careful not to operate on a Rust
+// struct after it has been dropped, and because we must expose a public API for freeing
+// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are:
+//
+// * Each instance holds an opaque handle to the underlying Rust struct.
+// Method calls need to read this handle from the object's state and pass it in to
+// the Rust FFI.
+//
+// * When an instance is no longer needed, its handle should be passed to a
+// special destructor function provided by the Rust FFI, which will drop the
+// underlying Rust struct.
+//
+// * Given an instance, calling code is expected to call the special
+// `destroy` method in order to free it after use, either by calling it explicitly
+// or by using a higher-level helper like the `use` method. Failing to do so risks
+// leaking the underlying Rust struct.
+//
+// * We can't assume that calling code will do the right thing, and must be prepared
+// to handle Kotlin method calls executing concurrently with or even after a call to
+// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`.
+//
+// * We must never allow Rust code to operate on the underlying Rust struct after
+// the destructor has been called, and must never call the destructor more than once.
+// Doing so may trigger memory unsafety.
+//
+// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner`
+// is implemented to call the destructor when the Kotlin object becomes unreachable.
+// This is done in a background thread. This is not a panacea, and client code should be aware that
+// 1. the thread may starve if some there are objects that have poorly performing
+// `drop` methods or do significant work in their `drop` methods.
+// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`,
+// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html).
+//
+// If we try to implement this with mutual exclusion on access to the handle, there is the
+// possibility of a race between a method call and a concurrent call to `destroy`:
+//
+// * Thread A starts a method call, reads the value of the handle, but is interrupted
+// before it can pass the handle over the FFI to Rust.
+// * Thread B calls `destroy` and frees the underlying Rust struct.
+// * Thread A resumes, passing the already-read handle value to Rust and triggering
+// a use-after-free.
+//
+// One possible solution would be to use a `ReadWriteLock`, with each method call taking
+// a read lock (and thus allowed to run concurrently) and the special `destroy` method
+// taking a write lock (and thus blocking on live method calls). However, we aim not to
+// generate methods with any hidden blocking semantics, and a `destroy` method that might
+// block if called incorrectly seems to meet that bar.
+//
+// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track
+// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy`
+// has been called. These are updated according to the following rules:
+//
+// * The initial value of the counter is 1, indicating a live object with no in-flight calls.
+// The initial value for the flag is false.
+//
+// * At the start of each method call, we atomically check the counter.
+// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted.
+// If it is nonzero them we atomically increment it by 1 and proceed with the method call.
+//
+// * At the end of each method call, we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// * When `destroy` is called, we atomically flip the flag from false to true.
+// If the flag was already true we silently fail.
+// Otherwise we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc<T>` works,
+// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`.
+//
+// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been
+// called *and* all in-flight method calls have completed, avoiding violating any of the expectations
+// of the underlying Rust code.
+//
+// This makes a cleaner a better alternative to _not_ calling `destroy()` as
+// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop`
+// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner
+// thread may be starved, and the app will leak memory.
+//
+// In this case, `destroy`ing manually may be a better solution.
+//
+// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects
+// with Rust peers are reclaimed:
+//
+// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen:
+// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then:
+// 3. The memory is reclaimed when the process terminates.
+//
+// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219
+//
+
+
+public interface AccessTokenProvider {
+
+ suspend fun `getAccessToken`(`forceRefresh`: kotlin.Boolean): kotlin.String
+
+ companion object
+}
+
+open class AccessTokenProviderImpl: Disposable, AutoCloseable, AccessTokenProvider
+{
+
+ @Suppress("UNUSED_PARAMETER")
+ /**
+ * @suppress
+ */
+ constructor(withHandle: UniffiWithHandle, handle: Long) {
+ this.handle = handle
+ this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(handle))
+ }
+
+ /**
+ * @suppress
+ *
+ * This constructor can be used to instantiate a fake object. Only used for tests. Any
+ * attempt to actually use an object constructed this way will fail as there is no
+ * connected Rust object.
+ */
+ @Suppress("UNUSED_PARAMETER")
+ constructor(noHandle: NoHandle) {
+ this.handle = 0
+ this.cleanable = null
+ }
+
+ protected val handle: Long
+ protected val cleanable: UniffiCleaner.Cleanable?
+
+ private val wasDestroyed = AtomicBoolean(false)
+ private val callCounter = AtomicLong(1)
+
+ override fun destroy() {
+ // Only allow a single call to this method.
+ // TODO: maybe we should log a warning if called more than once?
+ if (this.wasDestroyed.compareAndSet(false, true)) {
+ // This decrement always matches the initial count of 1 given at creation time.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ @Synchronized
+ override fun close() {
+ this.destroy()
+ }
+
+ internal inline fun <R> callWithHandle(block: (handle: Long) -> R): R {
+ // Check and increment the call counter, to keep the object alive.
+ // This needs a compare-and-set retry loop in case of concurrent updates.
+ do {
+ val c = this.callCounter.get()
+ if (c == 0L) {
+ throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed")
+ }
+ if (c == Long.MAX_VALUE) {
+ throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow")
+ }
+ } while (! this.callCounter.compareAndSet(c, c + 1L))
+ // Now we can safely do the method call without the handle being freed concurrently.
+ try {
+ return block(this.uniffiCloneHandle())
+ } finally {
+ // This decrement always matches the increment we performed above.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ // Use a static inner class instead of a closure so as not to accidentally
+ // capture `this` as part of the cleanable's action.
+ private class UniffiCleanAction(private val handle: Long) : Runnable {
+ override fun run() {
+ if (handle == 0.toLong()) {
+ // Fake object created with `NoHandle`, don't try to free.
+ return;
+ }
+ uniffiRustCall { status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_free_accesstokenprovider(handle, status)
+ }
+ }
+ }
+
+ /**
+ * @suppress
+ */
+ fun uniffiCloneHandle(): Long {
+ if (handle == 0.toLong()) {
+ throw InternalException("uniffiCloneHandle() called on NoHandle object");
+ }
+ return uniffiRustCall() { status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_clone_accesstokenprovider(handle, status)
+ }
+ }
+
+
+ @Throws(AccessTokenProviderException::class)
+ @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
+ override suspend fun `getAccessToken`(`forceRefresh`: kotlin.Boolean) : kotlin.String {
+ return uniffiRustCallAsync(
+ callWithHandle { uniffiHandle ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(
+ uniffiHandle,
+ FfiConverterBoolean.lower(`forceRefresh`),
+ )
+ },
+ { future, callback, continuation -> UniffiLib.ffi_cyclops_sdk_rust_future_poll_rust_buffer(future, callback, continuation) },
+ { future, continuation -> UniffiLib.ffi_cyclops_sdk_rust_future_complete_rust_buffer(future, continuation) },
+ { future -> UniffiLib.ffi_cyclops_sdk_rust_future_free_rust_buffer(future) },
+ // lift function
+ { FfiConverterString.lift(it) },
+ // Error FFI converter
+ AccessTokenProviderException.ErrorHandler,
+ )
+ }
+
+
+
+
+
+
+
+
+ /**
+ * @suppress
+ */
+ companion object
+
+}
+
+
+
+// Put the implementation in an object so we don't pollute the top-level namespace
+internal object uniffiCallbackInterfaceAccessTokenProvider {
+ internal object `getAccessToken`: UniffiCallbackInterfaceAccessTokenProviderMethod0 {
+ override fun callback(`uniffiHandle`: Long,`forceRefresh`: Byte,`uniffiFutureCallback`: UniffiForeignFutureCompleteRustBuffer,`uniffiCallbackData`: Long,`uniffiOutDroppedCallback`: UniffiForeignFutureDroppedCallbackStruct,) {
+ val uniffiObj = FfiConverterTypeAccessTokenProvider.handleMap.get(uniffiHandle)
+ val makeCall = suspend { ->
+ uniffiObj.`getAccessToken`(
+ FfiConverterBoolean.lift(`forceRefresh`),
+ )
+ }
+ val uniffiHandleSuccess = { returnValue: kotlin.String ->
+ val uniffiResult = UniffiForeignFutureResultRustBuffer.UniffiByValue(
+ FfiConverterString.lower(returnValue),
+ UniffiRustCallStatus.ByValue()
+ )
+ uniffiResult.write()
+ uniffiFutureCallback.callback(uniffiCallbackData, uniffiResult)
+ }
+ val uniffiHandleError = { callStatus: UniffiRustCallStatus.ByValue ->
+ uniffiFutureCallback.callback(
+ uniffiCallbackData,
+ UniffiForeignFutureResultRustBuffer.UniffiByValue(
+ RustBuffer.ByValue(),
+ callStatus,
+ ),
+ )
+ }
+ uniffiTraitInterfaceCallAsyncWithError(
+ makeCall,
+ uniffiHandleSuccess,
+ uniffiHandleError,
+ { e: AccessTokenProviderException -> FfiConverterTypeAccessTokenProviderError.lower(e) },
+ uniffiOutDroppedCallback
+ )
+ }
+ }
+
+ internal object uniffiFree: UniffiCallbackInterfaceFree {
+ override fun callback(handle: Long) {
+ FfiConverterTypeAccessTokenProvider.handleMap.remove(handle)
+ }
+ }
+
+ internal object uniffiClone: UniffiCallbackInterfaceClone {
+ override fun callback(handle: Long): Long {
+ return FfiConverterTypeAccessTokenProvider.handleMap.clone(handle)
+ }
+ }
+
+ internal var vtable = UniffiVTableCallbackInterfaceAccessTokenProvider.UniffiByValue(
+ uniffiFree,
+ uniffiClone,
+ `getAccessToken`,
+ )
+
+ // Registers the foreign callback with the Rust side.
+ // This method is generated for each callback interface.
+ internal fun register(lib: UniffiLib) {
+ lib.uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(vtable)
+ }
+}
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypeAccessTokenProvider: FfiConverter<AccessTokenProvider, Long> {
+ internal val handleMap = UniffiHandleMap<AccessTokenProvider>()
+
+ override fun lower(value: AccessTokenProvider): Long {
+ if (value is AccessTokenProviderImpl) {
+ // Rust-implemented object. Clone the handle and return it
+ return value.uniffiCloneHandle()
+ } else {
+ // Kotlin object, generate a new vtable handle and return that.
+ return handleMap.insert(value)
+ }
+ }
+
+ override fun lift(value: Long): AccessTokenProvider {
+ if ((value and 1.toLong()) == 0.toLong()) {
+ // Rust-generated handle, construct a new class that uses the handle to implement the
+ // interface
+ return AccessTokenProviderImpl(UniffiWithHandle, value)
+ } else {
+ // Kotlin-generated handle, get the object from the handle map
+ return handleMap.remove(value)
+ }
+ }
+
+ override fun read(buf: ByteBuffer): AccessTokenProvider {
+ return lift(buf.getLong())
+ }
+
+ override fun allocationSize(value: AccessTokenProvider) = 8UL
+
+ override fun write(value: AccessTokenProvider, buf: ByteBuffer) {
+ buf.putLong(lower(value))
+ }
+}
+
+
+// This template implements a class for working with a Rust struct via a handle
+// to the live Rust struct on the other side of the FFI.
+//
+// There's some subtlety here, because we have to be careful not to operate on a Rust
+// struct after it has been dropped, and because we must expose a public API for freeing
+// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are:
+//
+// * Each instance holds an opaque handle to the underlying Rust struct.
+// Method calls need to read this handle from the object's state and pass it in to
+// the Rust FFI.
+//
+// * When an instance is no longer needed, its handle should be passed to a
+// special destructor function provided by the Rust FFI, which will drop the
+// underlying Rust struct.
+//
+// * Given an instance, calling code is expected to call the special
+// `destroy` method in order to free it after use, either by calling it explicitly
+// or by using a higher-level helper like the `use` method. Failing to do so risks
+// leaking the underlying Rust struct.
+//
+// * We can't assume that calling code will do the right thing, and must be prepared
+// to handle Kotlin method calls executing concurrently with or even after a call to
+// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`.
+//
+// * We must never allow Rust code to operate on the underlying Rust struct after
+// the destructor has been called, and must never call the destructor more than once.
+// Doing so may trigger memory unsafety.
+//
+// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner`
+// is implemented to call the destructor when the Kotlin object becomes unreachable.
+// This is done in a background thread. This is not a panacea, and client code should be aware that
+// 1. the thread may starve if some there are objects that have poorly performing
+// `drop` methods or do significant work in their `drop` methods.
+// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`,
+// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html).
+//
+// If we try to implement this with mutual exclusion on access to the handle, there is the
+// possibility of a race between a method call and a concurrent call to `destroy`:
+//
+// * Thread A starts a method call, reads the value of the handle, but is interrupted
+// before it can pass the handle over the FFI to Rust.
+// * Thread B calls `destroy` and frees the underlying Rust struct.
+// * Thread A resumes, passing the already-read handle value to Rust and triggering
+// a use-after-free.
+//
+// One possible solution would be to use a `ReadWriteLock`, with each method call taking
+// a read lock (and thus allowed to run concurrently) and the special `destroy` method
+// taking a write lock (and thus blocking on live method calls). However, we aim not to
+// generate methods with any hidden blocking semantics, and a `destroy` method that might
+// block if called incorrectly seems to meet that bar.
+//
+// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track
+// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy`
+// has been called. These are updated according to the following rules:
+//
+// * The initial value of the counter is 1, indicating a live object with no in-flight calls.
+// The initial value for the flag is false.
+//
+// * At the start of each method call, we atomically check the counter.
+// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted.
+// If it is nonzero them we atomically increment it by 1 and proceed with the method call.
+//
+// * At the end of each method call, we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// * When `destroy` is called, we atomically flip the flag from false to true.
+// If the flag was already true we silently fail.
+// Otherwise we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc<T>` works,
+// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`.
+//
+// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been
+// called *and* all in-flight method calls have completed, avoiding violating any of the expectations
+// of the underlying Rust code.
+//
+// This makes a cleaner a better alternative to _not_ calling `destroy()` as
+// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop`
+// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner
+// thread may be starved, and the app will leak memory.
+//
+// In this case, `destroy`ing manually may be a better solution.
+//
+// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects
+// with Rust peers are reclaimed:
+//
+// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen:
+// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then:
+// 3. The memory is reclaimed when the process terminates.
+//
+// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219
+//
+
+
+public interface CreatePoolRequestBuilderInterface {
+
+ fun `build`(): CreatePoolRequest
+
+ fun `namespace`(`value`: kotlin.String): CreatePoolRequestBuilder
+
+ fun `spec`(`value`: OsGymSandboxWarmPoolSpec): CreatePoolRequestBuilder
+
+ companion object
+}
+
+open class CreatePoolRequestBuilder: Disposable, AutoCloseable, CreatePoolRequestBuilderInterface
+{
+
+ @Suppress("UNUSED_PARAMETER")
+ /**
+ * @suppress
+ */
+ constructor(withHandle: UniffiWithHandle, handle: Long) {
+ this.handle = handle
+ this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(handle))
+ }
+
+ /**
+ * @suppress
+ *
+ * This constructor can be used to instantiate a fake object. Only used for tests. Any
+ * attempt to actually use an object constructed this way will fail as there is no
+ * connected Rust object.
+ */
+ @Suppress("UNUSED_PARAMETER")
+ constructor(noHandle: NoHandle) {
+ this.handle = 0
+ this.cleanable = null
+ }
+ constructor() :
+ this(UniffiWithHandle,
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new(
+
+ _status)
+}
+ )
+
+ protected val handle: Long
+ protected val cleanable: UniffiCleaner.Cleanable?
+
+ private val wasDestroyed = AtomicBoolean(false)
+ private val callCounter = AtomicLong(1)
+
+ override fun destroy() {
+ // Only allow a single call to this method.
+ // TODO: maybe we should log a warning if called more than once?
+ if (this.wasDestroyed.compareAndSet(false, true)) {
+ // This decrement always matches the initial count of 1 given at creation time.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ @Synchronized
+ override fun close() {
+ this.destroy()
+ }
+
+ internal inline fun <R> callWithHandle(block: (handle: Long) -> R): R {
+ // Check and increment the call counter, to keep the object alive.
+ // This needs a compare-and-set retry loop in case of concurrent updates.
+ do {
+ val c = this.callCounter.get()
+ if (c == 0L) {
+ throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed")
+ }
+ if (c == Long.MAX_VALUE) {
+ throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow")
+ }
+ } while (! this.callCounter.compareAndSet(c, c + 1L))
+ // Now we can safely do the method call without the handle being freed concurrently.
+ try {
+ return block(this.uniffiCloneHandle())
+ } finally {
+ // This decrement always matches the increment we performed above.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ // Use a static inner class instead of a closure so as not to accidentally
+ // capture `this` as part of the cleanable's action.
+ private class UniffiCleanAction(private val handle: Long) : Runnable {
+ override fun run() {
+ if (handle == 0.toLong()) {
+ // Fake object created with `NoHandle`, don't try to free.
+ return;
+ }
+ uniffiRustCall { status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder(handle, status)
+ }
+ }
+ }
+
+ /**
+ * @suppress
+ */
+ fun uniffiCloneHandle(): Long {
+ if (handle == 0.toLong()) {
+ throw InternalException("uniffiCloneHandle() called on NoHandle object");
+ }
+ return uniffiRustCall() { status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder(handle, status)
+ }
+ }
+
+
+ @Throws(SdkBuildException::class)override fun `build`(): CreatePoolRequest {
+ return FfiConverterTypeCreatePoolRequest.lift(
+ callWithHandle {
+ uniffiRustCallWithError(SdkBuildException) { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build(
+ it,
+ _status)
+}
+ }
+ )
}
- // We aren't sure exactly how many bytes our string will be once it's UTF-8
- // encoded. Allocate 3 bytes per UTF-16 code unit which will always be
- // enough.
- override fun allocationSize(value: String): ULong {
- val sizeForLength = 4UL
- val sizeForString = value.length.toULong() * 3UL
- return sizeForLength + sizeForString
+
+ override fun `namespace`(`value`: kotlin.String): CreatePoolRequestBuilder {
+ return FfiConverterTypeCreatePoolRequestBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace(
+ it,
+ FfiConverterString.lower(`value`),_status)
+}
+ }
+ )
}
- override fun write(value: String, buf: ByteBuffer) {
- val byteBuf = toUtf8(value)
- buf.putInt(byteBuf.limit())
- buf.put(byteBuf)
+
+ override fun `spec`(`value`: OsGymSandboxWarmPoolSpec): CreatePoolRequestBuilder {
+ return FfiConverterTypeCreatePoolRequestBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec(
+ it,
+ FfiConverterTypeOSGymSandboxWarmPoolSpec.lower(`value`),_status)
+}
+ }
+ )
}
+
+
+
+
+
+
+
+
+
+ /**
+ * @suppress
+ */
+ companion object
+
}
+
/**
* @suppress
*/
-public object FfiConverterByteArray: FfiConverterRustBuffer<ByteArray> {
- override fun read(buf: ByteBuffer): ByteArray {
- val len = buf.getInt()
- val byteArr = ByteArray(len)
- buf.get(byteArr)
- return byteArr
+public object FfiConverterTypeCreatePoolRequestBuilder: FfiConverter<CreatePoolRequestBuilder, Long> {
+ override fun lower(value: CreatePoolRequestBuilder): Long {
+ return value.uniffiCloneHandle()
}
- override fun allocationSize(value: ByteArray): ULong {
- return 4UL + value.size.toULong()
+
+ override fun lift(value: Long): CreatePoolRequestBuilder {
+ return CreatePoolRequestBuilder(UniffiWithHandle, value)
}
- override fun write(value: ByteArray, buf: ByteBuffer) {
- buf.putInt(value.size)
- buf.put(value)
+
+ override fun read(buf: ByteBuffer): CreatePoolRequestBuilder {
+ return lift(buf.getLong())
+ }
+
+ override fun allocationSize(value: CreatePoolRequestBuilder) = 8UL
+
+ override fun write(value: CreatePoolRequestBuilder, buf: ByteBuffer) {
+ buf.putLong(lower(value))
}
}
@@ -1674,14 +2370,20 @@ public object FfiConverterByteArray: FfiConverterRustBuffer<ByteArray> {
//
-public interface AccessTokenProvider {
+public interface CreateTemplateRequestBuilderInterface {
- suspend fun `getAccessToken`(`forceRefresh`: kotlin.Boolean): kotlin.String
+ fun `build`(): CreateTemplateRequest
+
+ fun `name`(`value`: kotlin.String): CreateTemplateRequestBuilder
+
+ fun `namespace`(`value`: kotlin.String): CreateTemplateRequestBuilder
+
+ fun `spec`(`value`: OsGymSandboxTemplateSpec): CreateTemplateRequestBuilder
companion object
}
-open class AccessTokenProviderImpl: Disposable, AutoCloseable, AccessTokenProvider
+open class CreateTemplateRequestBuilder: Disposable, AutoCloseable, CreateTemplateRequestBuilderInterface
{
@Suppress("UNUSED_PARAMETER")
@@ -1705,6 +2407,14 @@ open class AccessTokenProviderImpl: Disposable, AutoCloseable, AccessTokenProvid
this.handle = 0
this.cleanable = null
}
+ constructor() :
+ this(UniffiWithHandle,
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new(
+
+ _status)
+}
+ )
protected val handle: Long
protected val cleanable: UniffiCleaner.Cleanable?
@@ -1760,7 +2470,7 @@ open class AccessTokenProviderImpl: Disposable, AutoCloseable, AccessTokenProvid
return;
}
uniffiRustCall { status ->
- UniffiLib.uniffi_cyclops_sdk_fn_free_accesstokenprovider(handle, status)
+ UniffiLib.uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder(handle, status)
}
}
}
@@ -1773,143 +2483,97 @@ open class AccessTokenProviderImpl: Disposable, AutoCloseable, AccessTokenProvid
throw InternalException("uniffiCloneHandle() called on NoHandle object");
}
return uniffiRustCall() { status ->
- UniffiLib.uniffi_cyclops_sdk_fn_clone_accesstokenprovider(handle, status)
+ UniffiLib.uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder(handle, status)
}
}
- @Throws(AccessTokenProviderException::class)
- @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE")
- override suspend fun `getAccessToken`(`forceRefresh`: kotlin.Boolean) : kotlin.String {
- return uniffiRustCallAsync(
- callWithHandle { uniffiHandle ->
- UniffiLib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token(
- uniffiHandle,
- FfiConverterBoolean.lower(`forceRefresh`),
- )
- },
- { future, callback, continuation -> UniffiLib.ffi_cyclops_sdk_rust_future_poll_rust_buffer(future, callback, continuation) },
- { future, continuation -> UniffiLib.ffi_cyclops_sdk_rust_future_complete_rust_buffer(future, continuation) },
- { future -> UniffiLib.ffi_cyclops_sdk_rust_future_free_rust_buffer(future) },
- // lift function
- { FfiConverterString.lift(it) },
- // Error FFI converter
- AccessTokenProviderException.ErrorHandler,
+ @Throws(SdkBuildException::class)override fun `build`(): CreateTemplateRequest {
+ return FfiConverterTypeCreateTemplateRequest.lift(
+ callWithHandle {
+ uniffiRustCallWithError(SdkBuildException) { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build(
+ it,
+ _status)
+}
+ }
)
}
+ override fun `name`(`value`: kotlin.String): CreateTemplateRequestBuilder {
+ return FfiConverterTypeCreateTemplateRequestBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name(
+ it,
+ FfiConverterString.lower(`value`),_status)
+}
+ }
+ )
+ }
+ override fun `namespace`(`value`: kotlin.String): CreateTemplateRequestBuilder {
+ return FfiConverterTypeCreateTemplateRequestBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace(
+ it,
+ FfiConverterString.lower(`value`),_status)
+}
+ }
+ )
+ }
+ override fun `spec`(`value`: OsGymSandboxTemplateSpec): CreateTemplateRequestBuilder {
+ return FfiConverterTypeCreateTemplateRequestBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec(
+ it,
+ FfiConverterTypeOSGymSandboxTemplateSpec.lower(`value`),_status)
+}
+ }
+ )
+ }
- /**
- * @suppress
- */
- companion object
-}
-// Put the implementation in an object so we don't pollute the top-level namespace
-internal object uniffiCallbackInterfaceAccessTokenProvider {
- internal object `getAccessToken`: UniffiCallbackInterfaceAccessTokenProviderMethod0 {
- override fun callback(`uniffiHandle`: Long,`forceRefresh`: Byte,`uniffiFutureCallback`: UniffiForeignFutureCompleteRustBuffer,`uniffiCallbackData`: Long,`uniffiOutDroppedCallback`: UniffiForeignFutureDroppedCallbackStruct,) {
- val uniffiObj = FfiConverterTypeAccessTokenProvider.handleMap.get(uniffiHandle)
- val makeCall = suspend { ->
- uniffiObj.`getAccessToken`(
- FfiConverterBoolean.lift(`forceRefresh`),
- )
- }
- val uniffiHandleSuccess = { returnValue: kotlin.String ->
- val uniffiResult = UniffiForeignFutureResultRustBuffer.UniffiByValue(
- FfiConverterString.lower(returnValue),
- UniffiRustCallStatus.ByValue()
- )
- uniffiResult.write()
- uniffiFutureCallback.callback(uniffiCallbackData, uniffiResult)
- }
- val uniffiHandleError = { callStatus: UniffiRustCallStatus.ByValue ->
- uniffiFutureCallback.callback(
- uniffiCallbackData,
- UniffiForeignFutureResultRustBuffer.UniffiByValue(
- RustBuffer.ByValue(),
- callStatus,
- ),
- )
- }
- uniffiTraitInterfaceCallAsyncWithError(
- makeCall,
- uniffiHandleSuccess,
- uniffiHandleError,
- { e: AccessTokenProviderException -> FfiConverterTypeAccessTokenProviderError.lower(e) },
- uniffiOutDroppedCallback
- )
- }
- }
- internal object uniffiFree: UniffiCallbackInterfaceFree {
- override fun callback(handle: Long) {
- FfiConverterTypeAccessTokenProvider.handleMap.remove(handle)
- }
- }
- internal object uniffiClone: UniffiCallbackInterfaceClone {
- override fun callback(handle: Long): Long {
- return FfiConverterTypeAccessTokenProvider.handleMap.clone(handle)
- }
- }
- internal var vtable = UniffiVTableCallbackInterfaceAccessTokenProvider.UniffiByValue(
- uniffiFree,
- uniffiClone,
- `getAccessToken`,
- )
+ /**
+ * @suppress
+ */
+ companion object
- // Registers the foreign callback with the Rust side.
- // This method is generated for each callback interface.
- internal fun register(lib: UniffiLib) {
- lib.uniffi_cyclops_sdk_fn_init_callback_vtable_accesstokenprovider(vtable)
- }
}
+
/**
* @suppress
*/
-public object FfiConverterTypeAccessTokenProvider: FfiConverter<AccessTokenProvider, Long> {
- internal val handleMap = UniffiHandleMap<AccessTokenProvider>()
-
- override fun lower(value: AccessTokenProvider): Long {
- if (value is AccessTokenProviderImpl) {
- // Rust-implemented object. Clone the handle and return it
- return value.uniffiCloneHandle()
- } else {
- // Kotlin object, generate a new vtable handle and return that.
- return handleMap.insert(value)
- }
+public object FfiConverterTypeCreateTemplateRequestBuilder: FfiConverter<CreateTemplateRequestBuilder, Long> {
+ override fun lower(value: CreateTemplateRequestBuilder): Long {
+ return value.uniffiCloneHandle()
}
- override fun lift(value: Long): AccessTokenProvider {
- if ((value and 1.toLong()) == 0.toLong()) {
- // Rust-generated handle, construct a new class that uses the handle to implement the
- // interface
- return AccessTokenProviderImpl(UniffiWithHandle, value)
- } else {
- // Kotlin-generated handle, get the object from the handle map
- return handleMap.remove(value)
- }
+ override fun lift(value: Long): CreateTemplateRequestBuilder {
+ return CreateTemplateRequestBuilder(UniffiWithHandle, value)
}
- override fun read(buf: ByteBuffer): AccessTokenProvider {
+ override fun read(buf: ByteBuffer): CreateTemplateRequestBuilder {
return lift(buf.getLong())
}
- override fun allocationSize(value: AccessTokenProvider) = 8UL
+ override fun allocationSize(value: CreateTemplateRequestBuilder) = 8UL
- override fun write(value: AccessTokenProvider, buf: ByteBuffer) {
+ override fun write(value: CreateTemplateRequestBuilder, buf: ByteBuffer) {
buf.putLong(lower(value))
}
}
@@ -4325,6 +4989,73 @@ public object FfiConverterTypeHttpError : FfiConverterRustBuffer<HttpException>
+sealed class SdkBuildException: kotlin.Exception() {
+
+ class MissingRequiredField(
+
+ val `recordType`: kotlin.String,
+
+ val `field`: kotlin.String
+ ) : SdkBuildException() {
+ override val message
+ get() = "recordType=${ `recordType` }, field=${ `field` }"
+ }
+
+
+
+
+
+ companion object ErrorHandler : UniffiRustCallStatusErrorHandler<SdkBuildException> {
+ override fun lift(error_buf: RustBuffer.ByValue): SdkBuildException = FfiConverterTypeSdkBuildError.lift(error_buf)
+ }
+
+
+}
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypeSdkBuildError : FfiConverterRustBuffer<SdkBuildException> {
+ override fun read(buf: ByteBuffer): SdkBuildException {
+
+
+ return when(buf.getInt()) {
+ 1 -> SdkBuildException.MissingRequiredField(
+ FfiConverterString.read(buf),
+ FfiConverterString.read(buf),
+ )
+ else -> throw RuntimeException("invalid error enum value, something is very wrong!!")
+ }
+ }
+
+ override fun allocationSize(value: SdkBuildException): ULong {
+ return when(value) {
+ is SdkBuildException.MissingRequiredField -> (
+ // Add the size for the Int that specifies the variant plus the size needed for all fields
+ 4UL
+ + FfiConverterString.allocationSize(value.`recordType`)
+ + FfiConverterString.allocationSize(value.`field`)
+ )
+ }
+ }
+
+ override fun write(value: SdkBuildException, buf: ByteBuffer) {
+ when(value) {
+ is SdkBuildException.MissingRequiredField -> {
+ buf.putInt(1)
+ FfiConverterString.write(value.`recordType`, buf)
+ FfiConverterString.write(value.`field`, buf)
+ Unit
+ }
+ }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
+ }
+
+}
+
+
+
+
+
sealed class SdkException: kotlin.Exception() {
class Configuration(
diff --git a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt
index 1e663be1de..1f2d68e873 100644
--- a/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt
+++ b/libs/fleet/sdk-bindings/kotlin/ai/cua/cyclops/sdk/schema/cyclops_sdk_schema.kt
@@ -636,10 +636,74 @@ internal object IntegrityCheckingUniffiLib {
uniffiCheckContractApiVersion(this)
uniffiCheckApiChecksums(this)
}
+ external fun uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_build(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_name(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_protocol(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_target_port(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_build(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_name(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_build(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_command(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_container_disk_image(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_cpu_cores(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_firmware(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_policy(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_secret(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_memory(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_node_selector(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_oidc(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_probes(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime_class_name(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_services(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_tolerations(
+ ): Short
external fun uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json(
): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_build(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_constructor_sandboxservicebuilder_new(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_constructor_sandboxtemplaterefbuilder_new(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_constructor_vmtemplatebuilder_new(
+ ): Short
external fun uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json(
): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxtemplatespecbuilder_new(
+ ): Short
+ external fun uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new(
+ ): Short
external fun ffi_cyclops_sdk_schema_uniffi_contract_version(
): Int
@@ -658,118 +722,202 @@ internal object UniffiLib {
Native.register(UniffiLib::class.java, findLibraryName(componentName = "cyclops_sdk_schema"))
}
- external fun uniffi_cyclops_sdk_schema_fn_clone_preservedjson(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_schema_fn_free_preservedjson(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
- external fun uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_schema_rustbuffer_alloc(`size`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_schema_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_schema_rustbuffer_free(`buf`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_schema_rust_future_poll_u8(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_u8(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_u8(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_u8(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Byte
- external fun ffi_cyclops_sdk_schema_rust_future_poll_i8(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_i8(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_i8(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_i8(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Byte
- external fun ffi_cyclops_sdk_schema_rust_future_poll_u16(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_u16(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_u16(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_u16(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Short
- external fun ffi_cyclops_sdk_schema_rust_future_poll_i16(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_i16(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_i16(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_i16(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Short
- external fun ffi_cyclops_sdk_schema_rust_future_poll_u32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_u32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_u32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_u32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Int
- external fun ffi_cyclops_sdk_schema_rust_future_poll_i32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_i32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_i32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_i32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Int
- external fun ffi_cyclops_sdk_schema_rust_future_poll_u64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_u64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_u64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_u64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun ffi_cyclops_sdk_schema_rust_future_poll_i64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_i64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_i64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_i64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Long
- external fun ffi_cyclops_sdk_schema_rust_future_poll_f32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_f32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_f32(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_f32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Float
- external fun ffi_cyclops_sdk_schema_rust_future_poll_f64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_f64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_f64(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_f64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Double
- external fun ffi_cyclops_sdk_schema_rust_future_poll_rust_buffer(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_rust_buffer(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_rust_buffer(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_rust_buffer(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): RustBuffer.ByValue
- external fun ffi_cyclops_sdk_schema_rust_future_poll_void(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_cancel_void(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_free_void(`handle`: Long,
- ): Unit
- external fun ffi_cyclops_sdk_schema_rust_future_complete_void(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
- ): Unit
+ external fun uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new(uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port(`ptr`: Long,`value`: Short,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new(uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new(uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores(`ptr`: Long,`value`: Int,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes(`ptr`: Long,`value`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_clone_preservedjson(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_free_preservedjson(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new(uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new(uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(`ptr`: Long,`value`: Int,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(`ptr`: Long,`value`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun ffi_cyclops_sdk_schema_rustbuffer_alloc(`size`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun ffi_cyclops_sdk_schema_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun ffi_cyclops_sdk_schema_rustbuffer_free(`buf`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
+): Unit
+external fun ffi_cyclops_sdk_schema_rustbuffer_reserve(`buf`: RustBuffer.ByValue,`additional`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun ffi_cyclops_sdk_schema_rust_future_poll_u8(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_u8(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_u8(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_u8(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Byte
+external fun ffi_cyclops_sdk_schema_rust_future_poll_i8(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_i8(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_i8(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_i8(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Byte
+external fun ffi_cyclops_sdk_schema_rust_future_poll_u16(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_u16(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_u16(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_u16(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Short
+external fun ffi_cyclops_sdk_schema_rust_future_poll_i16(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_i16(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_i16(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_i16(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Short
+external fun ffi_cyclops_sdk_schema_rust_future_poll_u32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_u32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_u32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_u32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Int
+external fun ffi_cyclops_sdk_schema_rust_future_poll_i32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_i32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_i32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_i32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Int
+external fun ffi_cyclops_sdk_schema_rust_future_poll_u64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_u64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_u64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_u64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun ffi_cyclops_sdk_schema_rust_future_poll_i64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_i64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_i64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_i64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Long
+external fun ffi_cyclops_sdk_schema_rust_future_poll_f32(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_f32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_f32(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_f32(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Float
+external fun ffi_cyclops_sdk_schema_rust_future_poll_f64(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_f64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_f64(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_f64(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Double
+external fun ffi_cyclops_sdk_schema_rust_future_poll_rust_buffer(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_rust_buffer(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_rust_buffer(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_rust_buffer(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): RustBuffer.ByValue
+external fun ffi_cyclops_sdk_schema_rust_future_poll_void(`handle`: Long,`callback`: UniffiRustFutureContinuationCallback,`callbackData`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_cancel_void(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_free_void(`handle`: Long,
+): Unit
+external fun ffi_cyclops_sdk_schema_rust_future_complete_void(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
+): Unit
}
@@ -785,12 +933,108 @@ private fun uniffiCheckContractApiVersion(lib: IntegrityCheckingUniffiLib) {
}
@Suppress("UNUSED_PARAMETER")
private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_build() != 62919.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_name() != 62417.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_protocol() != 10309.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_target_port() != 61462.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_build() != 46569.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_name() != 1803.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_build() != 17867.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_command() != 20371.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_container_disk_image() != 49021.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_cpu_cores() != 25645.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_firmware() != 33926.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_policy() != 41828.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_secret() != 40154.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_memory() != 55615.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_node_selector() != 45280.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_oidc() != 27280.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_probes() != 40623.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime() != 63375.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime_class_name() != 25466.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_services() != 14113.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_tolerations() != 1632.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
if (lib.uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json() != 8252.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_build() != 53928.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template() != 6610.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling() != 44912.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build() != 5682.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas() != 50438.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref() != 7198.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_constructor_sandboxservicebuilder_new() != 21082.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_constructor_sandboxtemplaterefbuilder_new() != 4748.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_constructor_vmtemplatebuilder_new() != 27302.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
if (lib.uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json() != 24064.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
+ if (lib.uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxtemplatespecbuilder_new() != 22071.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
+ if (lib.uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new() != 26063.toShort()) {
+ throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ }
}
/**
@@ -1034,43 +1278,1459 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
}
}
- override fun read(buf: ByteBuffer): String {
- val len = buf.getInt()
- val byteArr = ByteArray(len)
- buf.get(byteArr)
- return byteArr.toString(Charsets.UTF_8)
- }
+ override fun read(buf: ByteBuffer): String {
+ val len = buf.getInt()
+ val byteArr = ByteArray(len)
+ buf.get(byteArr)
+ return byteArr.toString(Charsets.UTF_8)
+ }
+
+ fun toUtf8(value: String): ByteBuffer {
+ // Make sure we don't have invalid UTF-16, check for lone surrogates.
+ return Charsets.UTF_8.newEncoder().run {
+ onMalformedInput(CodingErrorAction.REPORT)
+ encode(CharBuffer.wrap(value))
+ }
+ }
+
+ override fun lower(value: String): RustBuffer.ByValue {
+ val byteBuf = toUtf8(value)
+ // Ideally we'd pass these bytes to `ffi_bytebuffer_from_bytes`, but doing so would require us
+ // to copy them into a JNA `Memory`. So we might as well directly copy them into a `RustBuffer`.
+ val rbuf = RustBuffer.alloc(byteBuf.limit().toULong())
+ rbuf.asByteBuffer()!!.put(byteBuf)
+ return rbuf
+ }
+
+ // We aren't sure exactly how many bytes our string will be once it's UTF-8
+ // encoded. Allocate 3 bytes per UTF-16 code unit which will always be
+ // enough.
+ override fun allocationSize(value: String): ULong {
+ val sizeForLength = 4UL
+ val sizeForString = value.length.toULong() * 3UL
+ return sizeForLength + sizeForString
+ }
+
+ override fun write(value: String, buf: ByteBuffer) {
+ val byteBuf = toUtf8(value)
+ buf.putInt(byteBuf.limit())
+ buf.put(byteBuf)
+ }
+}
+
+
+// This template implements a class for working with a Rust struct via a handle
+// to the live Rust struct on the other side of the FFI.
+//
+// There's some subtlety here, because we have to be careful not to operate on a Rust
+// struct after it has been dropped, and because we must expose a public API for freeing
+// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are:
+//
+// * Each instance holds an opaque handle to the underlying Rust struct.
+// Method calls need to read this handle from the object's state and pass it in to
+// the Rust FFI.
+//
+// * When an instance is no longer needed, its handle should be passed to a
+// special destructor function provided by the Rust FFI, which will drop the
+// underlying Rust struct.
+//
+// * Given an instance, calling code is expected to call the special
+// `destroy` method in order to free it after use, either by calling it explicitly
+// or by using a higher-level helper like the `use` method. Failing to do so risks
+// leaking the underlying Rust struct.
+//
+// * We can't assume that calling code will do the right thing, and must be prepared
+// to handle Kotlin method calls executing concurrently with or even after a call to
+// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`.
+//
+// * We must never allow Rust code to operate on the underlying Rust struct after
+// the destructor has been called, and must never call the destructor more than once.
+// Doing so may trigger memory unsafety.
+//
+// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner`
+// is implemented to call the destructor when the Kotlin object becomes unreachable.
+// This is done in a background thread. This is not a panacea, and client code should be aware that
+// 1. the thread may starve if some there are objects that have poorly performing
+// `drop` methods or do significant work in their `drop` methods.
+// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`,
+// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html).
+//
+// If we try to implement this with mutual exclusion on access to the handle, there is the
+// possibility of a race between a method call and a concurrent call to `destroy`:
+//
+// * Thread A starts a method call, reads the value of the handle, but is interrupted
+// before it can pass the handle over the FFI to Rust.
+// * Thread B calls `destroy` and frees the underlying Rust struct.
+// * Thread A resumes, passing the already-read handle value to Rust and triggering
+// a use-after-free.
+//
+// One possible solution would be to use a `ReadWriteLock`, with each method call taking
+// a read lock (and thus allowed to run concurrently) and the special `destroy` method
+// taking a write lock (and thus blocking on live method calls). However, we aim not to
+// generate methods with any hidden blocking semantics, and a `destroy` method that might
+// block if called incorrectly seems to meet that bar.
+//
+// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track
+// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy`
+// has been called. These are updated according to the following rules:
+//
+// * The initial value of the counter is 1, indicating a live object with no in-flight calls.
+// The initial value for the flag is false.
+//
+// * At the start of each method call, we atomically check the counter.
+// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted.
+// If it is nonzero them we atomically increment it by 1 and proceed with the method call.
+//
+// * At the end of each method call, we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// * When `destroy` is called, we atomically flip the flag from false to true.
+// If the flag was already true we silently fail.
+// Otherwise we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc<T>` works,
+// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`.
+//
+// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been
+// called *and* all in-flight method calls have completed, avoiding violating any of the expectations
+// of the underlying Rust code.
+//
+// This makes a cleaner a better alternative to _not_ calling `destroy()` as
+// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop`
+// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner
+// thread may be starved, and the app will leak memory.
+//
+// In this case, `destroy`ing manually may be a better solution.
+//
+// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects
+// with Rust peers are reclaimed:
+//
+// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen:
+// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then:
+// 3. The memory is reclaimed when the process terminates.
+//
+// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219
+//
+
+
+public interface OsGymSandboxTemplateSpecBuilderInterface {
+
+ fun `build`(): OsGymSandboxTemplateSpec
+
+ fun `vmTemplate`(`value`: VmTemplate): OsGymSandboxTemplateSpecBuilder
+
+ companion object
+}
+
+open class OsGymSandboxTemplateSpecBuilder: Disposable, AutoCloseable, OsGymSandboxTemplateSpecBuilderInterface
+{
+
+ @Suppress("UNUSED_PARAMETER")
+ /**
+ * @suppress
+ */
+ constructor(withHandle: UniffiWithHandle, handle: Long) {
+ this.handle = handle
+ this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(handle))
+ }
+
+ /**
+ * @suppress
+ *
+ * This constructor can be used to instantiate a fake object. Only used for tests. Any
+ * attempt to actually use an object constructed this way will fail as there is no
+ * connected Rust object.
+ */
+ @Suppress("UNUSED_PARAMETER")
+ constructor(noHandle: NoHandle) {
+ this.handle = 0
+ this.cleanable = null
+ }
+ constructor() :
+ this(UniffiWithHandle,
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new(
+
+ _status)
+}
+ )
+
+ protected val handle: Long
+ protected val cleanable: UniffiCleaner.Cleanable?
+
+ private val wasDestroyed = AtomicBoolean(false)
+ private val callCounter = AtomicLong(1)
+
+ override fun destroy() {
+ // Only allow a single call to this method.
+ // TODO: maybe we should log a warning if called more than once?
+ if (this.wasDestroyed.compareAndSet(false, true)) {
+ // This decrement always matches the initial count of 1 given at creation time.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ @Synchronized
+ override fun close() {
+ this.destroy()
+ }
+
+ internal inline fun <R> callWithHandle(block: (handle: Long) -> R): R {
+ // Check and increment the call counter, to keep the object alive.
+ // This needs a compare-and-set retry loop in case of concurrent updates.
+ do {
+ val c = this.callCounter.get()
+ if (c == 0L) {
+ throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed")
+ }
+ if (c == Long.MAX_VALUE) {
+ throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow")
+ }
+ } while (! this.callCounter.compareAndSet(c, c + 1L))
+ // Now we can safely do the method call without the handle being freed concurrently.
+ try {
+ return block(this.uniffiCloneHandle())
+ } finally {
+ // This decrement always matches the increment we performed above.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ // Use a static inner class instead of a closure so as not to accidentally
+ // capture `this` as part of the cleanable's action.
+ private class UniffiCleanAction(private val handle: Long) : Runnable {
+ override fun run() {
+ if (handle == 0.toLong()) {
+ // Fake object created with `NoHandle`, don't try to free.
+ return;
+ }
+ uniffiRustCall { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder(handle, status)
+ }
+ }
+ }
+
+ /**
+ * @suppress
+ */
+ fun uniffiCloneHandle(): Long {
+ if (handle == 0.toLong()) {
+ throw InternalException("uniffiCloneHandle() called on NoHandle object");
+ }
+ return uniffiRustCall() { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder(handle, status)
+ }
+ }
+
+
+ @Throws(SchemaBuildException::class)override fun `build`(): OsGymSandboxTemplateSpec {
+ return FfiConverterTypeOSGymSandboxTemplateSpec.lift(
+ callWithHandle {
+ uniffiRustCallWithError(SchemaBuildException) { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build(
+ it,
+ _status)
+}
+ }
+ )
+ }
+
+
+ override fun `vmTemplate`(`value`: VmTemplate): OsGymSandboxTemplateSpecBuilder {
+ return FfiConverterTypeOSGymSandboxTemplateSpecBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template(
+ it,
+ FfiConverterTypeVmTemplate.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+
+
+
+
+
+
+
+ /**
+ * @suppress
+ */
+ companion object
+
+}
+
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypeOSGymSandboxTemplateSpecBuilder: FfiConverter<OsGymSandboxTemplateSpecBuilder, Long> {
+ override fun lower(value: OsGymSandboxTemplateSpecBuilder): Long {
+ return value.uniffiCloneHandle()
+ }
+
+ override fun lift(value: Long): OsGymSandboxTemplateSpecBuilder {
+ return OsGymSandboxTemplateSpecBuilder(UniffiWithHandle, value)
+ }
+
+ override fun read(buf: ByteBuffer): OsGymSandboxTemplateSpecBuilder {
+ return lift(buf.getLong())
+ }
+
+ override fun allocationSize(value: OsGymSandboxTemplateSpecBuilder) = 8UL
+
+ override fun write(value: OsGymSandboxTemplateSpecBuilder, buf: ByteBuffer) {
+ buf.putLong(lower(value))
+ }
+}
+
+
+// This template implements a class for working with a Rust struct via a handle
+// to the live Rust struct on the other side of the FFI.
+//
+// There's some subtlety here, because we have to be careful not to operate on a Rust
+// struct after it has been dropped, and because we must expose a public API for freeing
+// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are:
+//
+// * Each instance holds an opaque handle to the underlying Rust struct.
+// Method calls need to read this handle from the object's state and pass it in to
+// the Rust FFI.
+//
+// * When an instance is no longer needed, its handle should be passed to a
+// special destructor function provided by the Rust FFI, which will drop the
+// underlying Rust struct.
+//
+// * Given an instance, calling code is expected to call the special
+// `destroy` method in order to free it after use, either by calling it explicitly
+// or by using a higher-level helper like the `use` method. Failing to do so risks
+// leaking the underlying Rust struct.
+//
+// * We can't assume that calling code will do the right thing, and must be prepared
+// to handle Kotlin method calls executing concurrently with or even after a call to
+// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`.
+//
+// * We must never allow Rust code to operate on the underlying Rust struct after
+// the destructor has been called, and must never call the destructor more than once.
+// Doing so may trigger memory unsafety.
+//
+// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner`
+// is implemented to call the destructor when the Kotlin object becomes unreachable.
+// This is done in a background thread. This is not a panacea, and client code should be aware that
+// 1. the thread may starve if some there are objects that have poorly performing
+// `drop` methods or do significant work in their `drop` methods.
+// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`,
+// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html).
+//
+// If we try to implement this with mutual exclusion on access to the handle, there is the
+// possibility of a race between a method call and a concurrent call to `destroy`:
+//
+// * Thread A starts a method call, reads the value of the handle, but is interrupted
+// before it can pass the handle over the FFI to Rust.
+// * Thread B calls `destroy` and frees the underlying Rust struct.
+// * Thread A resumes, passing the already-read handle value to Rust and triggering
+// a use-after-free.
+//
+// One possible solution would be to use a `ReadWriteLock`, with each method call taking
+// a read lock (and thus allowed to run concurrently) and the special `destroy` method
+// taking a write lock (and thus blocking on live method calls). However, we aim not to
+// generate methods with any hidden blocking semantics, and a `destroy` method that might
+// block if called incorrectly seems to meet that bar.
+//
+// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track
+// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy`
+// has been called. These are updated according to the following rules:
+//
+// * The initial value of the counter is 1, indicating a live object with no in-flight calls.
+// The initial value for the flag is false.
+//
+// * At the start of each method call, we atomically check the counter.
+// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted.
+// If it is nonzero them we atomically increment it by 1 and proceed with the method call.
+//
+// * At the end of each method call, we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// * When `destroy` is called, we atomically flip the flag from false to true.
+// If the flag was already true we silently fail.
+// Otherwise we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc<T>` works,
+// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`.
+//
+// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been
+// called *and* all in-flight method calls have completed, avoiding violating any of the expectations
+// of the underlying Rust code.
+//
+// This makes a cleaner a better alternative to _not_ calling `destroy()` as
+// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop`
+// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner
+// thread may be starved, and the app will leak memory.
+//
+// In this case, `destroy`ing manually may be a better solution.
+//
+// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects
+// with Rust peers are reclaimed:
+//
+// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen:
+// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then:
+// 3. The memory is reclaimed when the process terminates.
+//
+// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219
+//
+
+
+public interface OsGymSandboxWarmPoolSpecBuilderInterface {
+
+ fun `autoscaling`(`value`: WarmPoolAutoscaling): OsGymSandboxWarmPoolSpecBuilder
+
+ fun `build`(): OsGymSandboxWarmPoolSpec
+
+ fun `replicas`(`value`: kotlin.UInt): OsGymSandboxWarmPoolSpecBuilder
+
+ fun `sandboxTemplateRef`(`value`: SandboxTemplateRef): OsGymSandboxWarmPoolSpecBuilder
+
+ companion object
+}
+
+open class OsGymSandboxWarmPoolSpecBuilder: Disposable, AutoCloseable, OsGymSandboxWarmPoolSpecBuilderInterface
+{
+
+ @Suppress("UNUSED_PARAMETER")
+ /**
+ * @suppress
+ */
+ constructor(withHandle: UniffiWithHandle, handle: Long) {
+ this.handle = handle
+ this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(handle))
+ }
+
+ /**
+ * @suppress
+ *
+ * This constructor can be used to instantiate a fake object. Only used for tests. Any
+ * attempt to actually use an object constructed this way will fail as there is no
+ * connected Rust object.
+ */
+ @Suppress("UNUSED_PARAMETER")
+ constructor(noHandle: NoHandle) {
+ this.handle = 0
+ this.cleanable = null
+ }
+ constructor() :
+ this(UniffiWithHandle,
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new(
+
+ _status)
+}
+ )
+
+ protected val handle: Long
+ protected val cleanable: UniffiCleaner.Cleanable?
+
+ private val wasDestroyed = AtomicBoolean(false)
+ private val callCounter = AtomicLong(1)
+
+ override fun destroy() {
+ // Only allow a single call to this method.
+ // TODO: maybe we should log a warning if called more than once?
+ if (this.wasDestroyed.compareAndSet(false, true)) {
+ // This decrement always matches the initial count of 1 given at creation time.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ @Synchronized
+ override fun close() {
+ this.destroy()
+ }
+
+ internal inline fun <R> callWithHandle(block: (handle: Long) -> R): R {
+ // Check and increment the call counter, to keep the object alive.
+ // This needs a compare-and-set retry loop in case of concurrent updates.
+ do {
+ val c = this.callCounter.get()
+ if (c == 0L) {
+ throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed")
+ }
+ if (c == Long.MAX_VALUE) {
+ throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow")
+ }
+ } while (! this.callCounter.compareAndSet(c, c + 1L))
+ // Now we can safely do the method call without the handle being freed concurrently.
+ try {
+ return block(this.uniffiCloneHandle())
+ } finally {
+ // This decrement always matches the increment we performed above.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ // Use a static inner class instead of a closure so as not to accidentally
+ // capture `this` as part of the cleanable's action.
+ private class UniffiCleanAction(private val handle: Long) : Runnable {
+ override fun run() {
+ if (handle == 0.toLong()) {
+ // Fake object created with `NoHandle`, don't try to free.
+ return;
+ }
+ uniffiRustCall { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder(handle, status)
+ }
+ }
+ }
+
+ /**
+ * @suppress
+ */
+ fun uniffiCloneHandle(): Long {
+ if (handle == 0.toLong()) {
+ throw InternalException("uniffiCloneHandle() called on NoHandle object");
+ }
+ return uniffiRustCall() { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder(handle, status)
+ }
+ }
+
+ override fun `autoscaling`(`value`: WarmPoolAutoscaling): OsGymSandboxWarmPoolSpecBuilder {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling(
+ it,
+ FfiConverterTypeWarmPoolAutoscaling.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+
+ @Throws(SchemaBuildException::class)override fun `build`(): OsGymSandboxWarmPoolSpec {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpec.lift(
+ callWithHandle {
+ uniffiRustCallWithError(SchemaBuildException) { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build(
+ it,
+ _status)
+}
+ }
+ )
+ }
+
+
+ override fun `replicas`(`value`: kotlin.UInt): OsGymSandboxWarmPoolSpecBuilder {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(
+ it,
+ FfiConverterUInt.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `sandboxTemplateRef`(`value`: SandboxTemplateRef): OsGymSandboxWarmPoolSpecBuilder {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(
+ it,
+ FfiConverterTypeSandboxTemplateRef.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+
+
+
+
+
+
+
+ /**
+ * @suppress
+ */
+ companion object
+
+}
+
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder: FfiConverter<OsGymSandboxWarmPoolSpecBuilder, Long> {
+ override fun lower(value: OsGymSandboxWarmPoolSpecBuilder): Long {
+ return value.uniffiCloneHandle()
+ }
+
+ override fun lift(value: Long): OsGymSandboxWarmPoolSpecBuilder {
+ return OsGymSandboxWarmPoolSpecBuilder(UniffiWithHandle, value)
+ }
+
+ override fun read(buf: ByteBuffer): OsGymSandboxWarmPoolSpecBuilder {
+ return lift(buf.getLong())
+ }
+
+ override fun allocationSize(value: OsGymSandboxWarmPoolSpecBuilder) = 8UL
+
+ override fun write(value: OsGymSandboxWarmPoolSpecBuilder, buf: ByteBuffer) {
+ buf.putLong(lower(value))
+ }
+}
+
+
+// This template implements a class for working with a Rust struct via a handle
+// to the live Rust struct on the other side of the FFI.
+//
+// There's some subtlety here, because we have to be careful not to operate on a Rust
+// struct after it has been dropped, and because we must expose a public API for freeing
+// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are:
+//
+// * Each instance holds an opaque handle to the underlying Rust struct.
+// Method calls need to read this handle from the object's state and pass it in to
+// the Rust FFI.
+//
+// * When an instance is no longer needed, its handle should be passed to a
+// special destructor function provided by the Rust FFI, which will drop the
+// underlying Rust struct.
+//
+// * Given an instance, calling code is expected to call the special
+// `destroy` method in order to free it after use, either by calling it explicitly
+// or by using a higher-level helper like the `use` method. Failing to do so risks
+// leaking the underlying Rust struct.
+//
+// * We can't assume that calling code will do the right thing, and must be prepared
+// to handle Kotlin method calls executing concurrently with or even after a call to
+// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`.
+//
+// * We must never allow Rust code to operate on the underlying Rust struct after
+// the destructor has been called, and must never call the destructor more than once.
+// Doing so may trigger memory unsafety.
+//
+// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner`
+// is implemented to call the destructor when the Kotlin object becomes unreachable.
+// This is done in a background thread. This is not a panacea, and client code should be aware that
+// 1. the thread may starve if some there are objects that have poorly performing
+// `drop` methods or do significant work in their `drop` methods.
+// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`,
+// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html).
+//
+// If we try to implement this with mutual exclusion on access to the handle, there is the
+// possibility of a race between a method call and a concurrent call to `destroy`:
+//
+// * Thread A starts a method call, reads the value of the handle, but is interrupted
+// before it can pass the handle over the FFI to Rust.
+// * Thread B calls `destroy` and frees the underlying Rust struct.
+// * Thread A resumes, passing the already-read handle value to Rust and triggering
+// a use-after-free.
+//
+// One possible solution would be to use a `ReadWriteLock`, with each method call taking
+// a read lock (and thus allowed to run concurrently) and the special `destroy` method
+// taking a write lock (and thus blocking on live method calls). However, we aim not to
+// generate methods with any hidden blocking semantics, and a `destroy` method that might
+// block if called incorrectly seems to meet that bar.
+//
+// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track
+// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy`
+// has been called. These are updated according to the following rules:
+//
+// * The initial value of the counter is 1, indicating a live object with no in-flight calls.
+// The initial value for the flag is false.
+//
+// * At the start of each method call, we atomically check the counter.
+// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted.
+// If it is nonzero them we atomically increment it by 1 and proceed with the method call.
+//
+// * At the end of each method call, we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// * When `destroy` is called, we atomically flip the flag from false to true.
+// If the flag was already true we silently fail.
+// Otherwise we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc<T>` works,
+// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`.
+//
+// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been
+// called *and* all in-flight method calls have completed, avoiding violating any of the expectations
+// of the underlying Rust code.
+//
+// This makes a cleaner a better alternative to _not_ calling `destroy()` as
+// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop`
+// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner
+// thread may be starved, and the app will leak memory.
+//
+// In this case, `destroy`ing manually may be a better solution.
+//
+// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects
+// with Rust peers are reclaimed:
+//
+// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen:
+// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then:
+// 3. The memory is reclaimed when the process terminates.
+//
+// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219
+//
+
+
+public interface PreservedJsonInterface {
+
+ fun `toJson`(): kotlin.String
+
+ companion object
+}
+
+open class PreservedJson: Disposable, AutoCloseable, PreservedJsonInterface
+{
+
+ @Suppress("UNUSED_PARAMETER")
+ /**
+ * @suppress
+ */
+ constructor(withHandle: UniffiWithHandle, handle: Long) {
+ this.handle = handle
+ this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(handle))
+ }
+
+ /**
+ * @suppress
+ *
+ * This constructor can be used to instantiate a fake object. Only used for tests. Any
+ * attempt to actually use an object constructed this way will fail as there is no
+ * connected Rust object.
+ */
+ @Suppress("UNUSED_PARAMETER")
+ constructor(noHandle: NoHandle) {
+ this.handle = 0
+ this.cleanable = null
+ }
+
+ protected val handle: Long
+ protected val cleanable: UniffiCleaner.Cleanable?
+
+ private val wasDestroyed = AtomicBoolean(false)
+ private val callCounter = AtomicLong(1)
+
+ override fun destroy() {
+ // Only allow a single call to this method.
+ // TODO: maybe we should log a warning if called more than once?
+ if (this.wasDestroyed.compareAndSet(false, true)) {
+ // This decrement always matches the initial count of 1 given at creation time.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ @Synchronized
+ override fun close() {
+ this.destroy()
+ }
+
+ internal inline fun <R> callWithHandle(block: (handle: Long) -> R): R {
+ // Check and increment the call counter, to keep the object alive.
+ // This needs a compare-and-set retry loop in case of concurrent updates.
+ do {
+ val c = this.callCounter.get()
+ if (c == 0L) {
+ throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed")
+ }
+ if (c == Long.MAX_VALUE) {
+ throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow")
+ }
+ } while (! this.callCounter.compareAndSet(c, c + 1L))
+ // Now we can safely do the method call without the handle being freed concurrently.
+ try {
+ return block(this.uniffiCloneHandle())
+ } finally {
+ // This decrement always matches the increment we performed above.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ // Use a static inner class instead of a closure so as not to accidentally
+ // capture `this` as part of the cleanable's action.
+ private class UniffiCleanAction(private val handle: Long) : Runnable {
+ override fun run() {
+ if (handle == 0.toLong()) {
+ // Fake object created with `NoHandle`, don't try to free.
+ return;
+ }
+ uniffiRustCall { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_free_preservedjson(handle, status)
+ }
+ }
+ }
+
+ /**
+ * @suppress
+ */
+ fun uniffiCloneHandle(): Long {
+ if (handle == 0.toLong()) {
+ throw InternalException("uniffiCloneHandle() called on NoHandle object");
+ }
+ return uniffiRustCall() { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_preservedjson(handle, status)
+ }
+ }
+
+ override fun `toJson`(): kotlin.String {
+ return FfiConverterString.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(
+ it,
+ _status)
+}
+ }
+ )
+ }
+
+
+
+
+
+
+
+
+ companion object {
+
+ @Throws(JsonValueException::class) fun `fromJson`(`value`: kotlin.String): PreservedJson {
+ return FfiConverterTypePreservedJson.lift(
+ uniffiRustCallWithError(JsonValueException) { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(
+
+ FfiConverterString.lower(`value`),_status)
+}
+ )
+ }
+
+
+
+ }
+
+}
+
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypePreservedJson: FfiConverter<PreservedJson, Long> {
+ override fun lower(value: PreservedJson): Long {
+ return value.uniffiCloneHandle()
+ }
+
+ override fun lift(value: Long): PreservedJson {
+ return PreservedJson(UniffiWithHandle, value)
+ }
+
+ override fun read(buf: ByteBuffer): PreservedJson {
+ return lift(buf.getLong())
+ }
+
+ override fun allocationSize(value: PreservedJson) = 8UL
+
+ override fun write(value: PreservedJson, buf: ByteBuffer) {
+ buf.putLong(lower(value))
+ }
+}
+
+
+// This template implements a class for working with a Rust struct via a handle
+// to the live Rust struct on the other side of the FFI.
+//
+// There's some subtlety here, because we have to be careful not to operate on a Rust
+// struct after it has been dropped, and because we must expose a public API for freeing
+// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are:
+//
+// * Each instance holds an opaque handle to the underlying Rust struct.
+// Method calls need to read this handle from the object's state and pass it in to
+// the Rust FFI.
+//
+// * When an instance is no longer needed, its handle should be passed to a
+// special destructor function provided by the Rust FFI, which will drop the
+// underlying Rust struct.
+//
+// * Given an instance, calling code is expected to call the special
+// `destroy` method in order to free it after use, either by calling it explicitly
+// or by using a higher-level helper like the `use` method. Failing to do so risks
+// leaking the underlying Rust struct.
+//
+// * We can't assume that calling code will do the right thing, and must be prepared
+// to handle Kotlin method calls executing concurrently with or even after a call to
+// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`.
+//
+// * We must never allow Rust code to operate on the underlying Rust struct after
+// the destructor has been called, and must never call the destructor more than once.
+// Doing so may trigger memory unsafety.
+//
+// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner`
+// is implemented to call the destructor when the Kotlin object becomes unreachable.
+// This is done in a background thread. This is not a panacea, and client code should be aware that
+// 1. the thread may starve if some there are objects that have poorly performing
+// `drop` methods or do significant work in their `drop` methods.
+// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`,
+// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html).
+//
+// If we try to implement this with mutual exclusion on access to the handle, there is the
+// possibility of a race between a method call and a concurrent call to `destroy`:
+//
+// * Thread A starts a method call, reads the value of the handle, but is interrupted
+// before it can pass the handle over the FFI to Rust.
+// * Thread B calls `destroy` and frees the underlying Rust struct.
+// * Thread A resumes, passing the already-read handle value to Rust and triggering
+// a use-after-free.
+//
+// One possible solution would be to use a `ReadWriteLock`, with each method call taking
+// a read lock (and thus allowed to run concurrently) and the special `destroy` method
+// taking a write lock (and thus blocking on live method calls). However, we aim not to
+// generate methods with any hidden blocking semantics, and a `destroy` method that might
+// block if called incorrectly seems to meet that bar.
+//
+// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track
+// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy`
+// has been called. These are updated according to the following rules:
+//
+// * The initial value of the counter is 1, indicating a live object with no in-flight calls.
+// The initial value for the flag is false.
+//
+// * At the start of each method call, we atomically check the counter.
+// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted.
+// If it is nonzero them we atomically increment it by 1 and proceed with the method call.
+//
+// * At the end of each method call, we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// * When `destroy` is called, we atomically flip the flag from false to true.
+// If the flag was already true we silently fail.
+// Otherwise we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc<T>` works,
+// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`.
+//
+// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been
+// called *and* all in-flight method calls have completed, avoiding violating any of the expectations
+// of the underlying Rust code.
+//
+// This makes a cleaner a better alternative to _not_ calling `destroy()` as
+// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop`
+// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner
+// thread may be starved, and the app will leak memory.
+//
+// In this case, `destroy`ing manually may be a better solution.
+//
+// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects
+// with Rust peers are reclaimed:
+//
+// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen:
+// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then:
+// 3. The memory is reclaimed when the process terminates.
+//
+// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219
+//
+
+
+public interface SandboxServiceBuilderInterface {
+
+ fun `build`(): SandboxService
+
+ fun `name`(`value`: kotlin.String): SandboxServiceBuilder
+
+ fun `protocol`(`value`: ServiceProtocol): SandboxServiceBuilder
+
+ fun `targetPort`(`value`: kotlin.UShort): SandboxServiceBuilder
+
+ companion object
+}
+
+open class SandboxServiceBuilder: Disposable, AutoCloseable, SandboxServiceBuilderInterface
+{
+
+ @Suppress("UNUSED_PARAMETER")
+ /**
+ * @suppress
+ */
+ constructor(withHandle: UniffiWithHandle, handle: Long) {
+ this.handle = handle
+ this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(handle))
+ }
+
+ /**
+ * @suppress
+ *
+ * This constructor can be used to instantiate a fake object. Only used for tests. Any
+ * attempt to actually use an object constructed this way will fail as there is no
+ * connected Rust object.
+ */
+ @Suppress("UNUSED_PARAMETER")
+ constructor(noHandle: NoHandle) {
+ this.handle = 0
+ this.cleanable = null
+ }
+ constructor() :
+ this(UniffiWithHandle,
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new(
+
+ _status)
+}
+ )
+
+ protected val handle: Long
+ protected val cleanable: UniffiCleaner.Cleanable?
+
+ private val wasDestroyed = AtomicBoolean(false)
+ private val callCounter = AtomicLong(1)
+
+ override fun destroy() {
+ // Only allow a single call to this method.
+ // TODO: maybe we should log a warning if called more than once?
+ if (this.wasDestroyed.compareAndSet(false, true)) {
+ // This decrement always matches the initial count of 1 given at creation time.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ @Synchronized
+ override fun close() {
+ this.destroy()
+ }
+
+ internal inline fun <R> callWithHandle(block: (handle: Long) -> R): R {
+ // Check and increment the call counter, to keep the object alive.
+ // This needs a compare-and-set retry loop in case of concurrent updates.
+ do {
+ val c = this.callCounter.get()
+ if (c == 0L) {
+ throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed")
+ }
+ if (c == Long.MAX_VALUE) {
+ throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow")
+ }
+ } while (! this.callCounter.compareAndSet(c, c + 1L))
+ // Now we can safely do the method call without the handle being freed concurrently.
+ try {
+ return block(this.uniffiCloneHandle())
+ } finally {
+ // This decrement always matches the increment we performed above.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ // Use a static inner class instead of a closure so as not to accidentally
+ // capture `this` as part of the cleanable's action.
+ private class UniffiCleanAction(private val handle: Long) : Runnable {
+ override fun run() {
+ if (handle == 0.toLong()) {
+ // Fake object created with `NoHandle`, don't try to free.
+ return;
+ }
+ uniffiRustCall { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder(handle, status)
+ }
+ }
+ }
+
+ /**
+ * @suppress
+ */
+ fun uniffiCloneHandle(): Long {
+ if (handle == 0.toLong()) {
+ throw InternalException("uniffiCloneHandle() called on NoHandle object");
+ }
+ return uniffiRustCall() { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder(handle, status)
+ }
+ }
+
+
+ @Throws(SchemaBuildException::class)override fun `build`(): SandboxService {
+ return FfiConverterTypeSandboxService.lift(
+ callWithHandle {
+ uniffiRustCallWithError(SchemaBuildException) { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build(
+ it,
+ _status)
+}
+ }
+ )
+ }
+
+
+ override fun `name`(`value`: kotlin.String): SandboxServiceBuilder {
+ return FfiConverterTypeSandboxServiceBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name(
+ it,
+ FfiConverterString.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `protocol`(`value`: ServiceProtocol): SandboxServiceBuilder {
+ return FfiConverterTypeSandboxServiceBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol(
+ it,
+ FfiConverterTypeServiceProtocol.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `targetPort`(`value`: kotlin.UShort): SandboxServiceBuilder {
+ return FfiConverterTypeSandboxServiceBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port(
+ it,
+ FfiConverterUShort.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+
+
+
+
+
+
+
+ /**
+ * @suppress
+ */
+ companion object
+
+}
+
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypeSandboxServiceBuilder: FfiConverter<SandboxServiceBuilder, Long> {
+ override fun lower(value: SandboxServiceBuilder): Long {
+ return value.uniffiCloneHandle()
+ }
+
+ override fun lift(value: Long): SandboxServiceBuilder {
+ return SandboxServiceBuilder(UniffiWithHandle, value)
+ }
+
+ override fun read(buf: ByteBuffer): SandboxServiceBuilder {
+ return lift(buf.getLong())
+ }
+
+ override fun allocationSize(value: SandboxServiceBuilder) = 8UL
+
+ override fun write(value: SandboxServiceBuilder, buf: ByteBuffer) {
+ buf.putLong(lower(value))
+ }
+}
+
+
+// This template implements a class for working with a Rust struct via a handle
+// to the live Rust struct on the other side of the FFI.
+//
+// There's some subtlety here, because we have to be careful not to operate on a Rust
+// struct after it has been dropped, and because we must expose a public API for freeing
+// theq Kotlin wrapper object in lieu of reliable finalizers. The core requirements are:
+//
+// * Each instance holds an opaque handle to the underlying Rust struct.
+// Method calls need to read this handle from the object's state and pass it in to
+// the Rust FFI.
+//
+// * When an instance is no longer needed, its handle should be passed to a
+// special destructor function provided by the Rust FFI, which will drop the
+// underlying Rust struct.
+//
+// * Given an instance, calling code is expected to call the special
+// `destroy` method in order to free it after use, either by calling it explicitly
+// or by using a higher-level helper like the `use` method. Failing to do so risks
+// leaking the underlying Rust struct.
+//
+// * We can't assume that calling code will do the right thing, and must be prepared
+// to handle Kotlin method calls executing concurrently with or even after a call to
+// `destroy`, and to handle multiple (possibly concurrent!) calls to `destroy`.
+//
+// * We must never allow Rust code to operate on the underlying Rust struct after
+// the destructor has been called, and must never call the destructor more than once.
+// Doing so may trigger memory unsafety.
+//
+// * To mitigate many of the risks of leaking memory and use-after-free unsafety, a `Cleaner`
+// is implemented to call the destructor when the Kotlin object becomes unreachable.
+// This is done in a background thread. This is not a panacea, and client code should be aware that
+// 1. the thread may starve if some there are objects that have poorly performing
+// `drop` methods or do significant work in their `drop` methods.
+// 2. the thread is shared across the whole library. This can be tuned by using `android_cleaner = true`,
+// or `android = true` in the [`kotlin` section of the `uniffi.toml` file](https://mozilla.github.io/uniffi-rs/kotlin/configuration.html).
+//
+// If we try to implement this with mutual exclusion on access to the handle, there is the
+// possibility of a race between a method call and a concurrent call to `destroy`:
+//
+// * Thread A starts a method call, reads the value of the handle, but is interrupted
+// before it can pass the handle over the FFI to Rust.
+// * Thread B calls `destroy` and frees the underlying Rust struct.
+// * Thread A resumes, passing the already-read handle value to Rust and triggering
+// a use-after-free.
+//
+// One possible solution would be to use a `ReadWriteLock`, with each method call taking
+// a read lock (and thus allowed to run concurrently) and the special `destroy` method
+// taking a write lock (and thus blocking on live method calls). However, we aim not to
+// generate methods with any hidden blocking semantics, and a `destroy` method that might
+// block if called incorrectly seems to meet that bar.
+//
+// So, we achieve our goals by giving each instance an associated `AtomicLong` counter to track
+// the number of in-flight method calls, and an `AtomicBoolean` flag to indicate whether `destroy`
+// has been called. These are updated according to the following rules:
+//
+// * The initial value of the counter is 1, indicating a live object with no in-flight calls.
+// The initial value for the flag is false.
+//
+// * At the start of each method call, we atomically check the counter.
+// If it is 0 then the underlying Rust struct has already been destroyed and the call is aborted.
+// If it is nonzero them we atomically increment it by 1 and proceed with the method call.
+//
+// * At the end of each method call, we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// * When `destroy` is called, we atomically flip the flag from false to true.
+// If the flag was already true we silently fail.
+// Otherwise we atomically decrement and check the counter.
+// If it has reached zero then we destroy the underlying Rust struct.
+//
+// Astute readers may observe that this all sounds very similar to the way that Rust's `Arc<T>` works,
+// and indeed it is, with the addition of a flag to guard against multiple calls to `destroy`.
+//
+// The overall effect is that the underlying Rust struct is destroyed only when `destroy` has been
+// called *and* all in-flight method calls have completed, avoiding violating any of the expectations
+// of the underlying Rust code.
+//
+// This makes a cleaner a better alternative to _not_ calling `destroy()` as
+// and when the object is finished with, but the abstraction is not perfect: if the Rust object's `drop`
+// method is slow, and/or there are many objects to cleanup, and it's on a low end Android device, then the cleaner
+// thread may be starved, and the app will leak memory.
+//
+// In this case, `destroy`ing manually may be a better solution.
+//
+// The cleaner can live side by side with the manual calling of `destroy`. In the order of responsiveness, uniffi objects
+// with Rust peers are reclaimed:
+//
+// 1. By calling the `destroy` method of the object, which calls `rustObject.free()`. If that doesn't happen:
+// 2. When the object becomes unreachable, AND the Cleaner thread gets to call `rustObject.free()`. If the thread is starved then:
+// 3. The memory is reclaimed when the process terminates.
+//
+// [1] https://stackoverflow.com/questions/24376768/can-java-finalize-an-object-when-it-is-still-in-scope/24380219
+//
+
+
+public interface SandboxTemplateRefBuilderInterface {
+
+ fun `build`(): SandboxTemplateRef
+
+ fun `name`(`value`: kotlin.String): SandboxTemplateRefBuilder
+
+ companion object
+}
+
+open class SandboxTemplateRefBuilder: Disposable, AutoCloseable, SandboxTemplateRefBuilderInterface
+{
+
+ @Suppress("UNUSED_PARAMETER")
+ /**
+ * @suppress
+ */
+ constructor(withHandle: UniffiWithHandle, handle: Long) {
+ this.handle = handle
+ this.cleanable = UniffiLib.CLEANER.register(this, UniffiCleanAction(handle))
+ }
+
+ /**
+ * @suppress
+ *
+ * This constructor can be used to instantiate a fake object. Only used for tests. Any
+ * attempt to actually use an object constructed this way will fail as there is no
+ * connected Rust object.
+ */
+ @Suppress("UNUSED_PARAMETER")
+ constructor(noHandle: NoHandle) {
+ this.handle = 0
+ this.cleanable = null
+ }
+ constructor() :
+ this(UniffiWithHandle,
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new(
+
+ _status)
+}
+ )
+
+ protected val handle: Long
+ protected val cleanable: UniffiCleaner.Cleanable?
+
+ private val wasDestroyed = AtomicBoolean(false)
+ private val callCounter = AtomicLong(1)
+
+ override fun destroy() {
+ // Only allow a single call to this method.
+ // TODO: maybe we should log a warning if called more than once?
+ if (this.wasDestroyed.compareAndSet(false, true)) {
+ // This decrement always matches the initial count of 1 given at creation time.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ @Synchronized
+ override fun close() {
+ this.destroy()
+ }
+
+ internal inline fun <R> callWithHandle(block: (handle: Long) -> R): R {
+ // Check and increment the call counter, to keep the object alive.
+ // This needs a compare-and-set retry loop in case of concurrent updates.
+ do {
+ val c = this.callCounter.get()
+ if (c == 0L) {
+ throw IllegalStateException("${this.javaClass.simpleName} object has already been destroyed")
+ }
+ if (c == Long.MAX_VALUE) {
+ throw IllegalStateException("${this.javaClass.simpleName} call counter would overflow")
+ }
+ } while (! this.callCounter.compareAndSet(c, c + 1L))
+ // Now we can safely do the method call without the handle being freed concurrently.
+ try {
+ return block(this.uniffiCloneHandle())
+ } finally {
+ // This decrement always matches the increment we performed above.
+ if (this.callCounter.decrementAndGet() == 0L) {
+ cleanable?.clean()
+ }
+ }
+ }
+
+ // Use a static inner class instead of a closure so as not to accidentally
+ // capture `this` as part of the cleanable's action.
+ private class UniffiCleanAction(private val handle: Long) : Runnable {
+ override fun run() {
+ if (handle == 0.toLong()) {
+ // Fake object created with `NoHandle`, don't try to free.
+ return;
+ }
+ uniffiRustCall { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder(handle, status)
+ }
+ }
+ }
+
+ /**
+ * @suppress
+ */
+ fun uniffiCloneHandle(): Long {
+ if (handle == 0.toLong()) {
+ throw InternalException("uniffiCloneHandle() called on NoHandle object");
+ }
+ return uniffiRustCall() { status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder(handle, status)
+ }
+ }
+
+
+ @Throws(SchemaBuildException::class)override fun `build`(): SandboxTemplateRef {
+ return FfiConverterTypeSandboxTemplateRef.lift(
+ callWithHandle {
+ uniffiRustCallWithError(SchemaBuildException) { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build(
+ it,
+ _status)
+}
+ }
+ )
+ }
+
+
+ override fun `name`(`value`: kotlin.String): SandboxTemplateRefBuilder {
+ return FfiConverterTypeSandboxTemplateRefBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name(
+ it,
+ FfiConverterString.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+
+
+
+
+
+
+
+ /**
+ * @suppress
+ */
+ companion object
+
+}
- fun toUtf8(value: String): ByteBuffer {
- // Make sure we don't have invalid UTF-16, check for lone surrogates.
- return Charsets.UTF_8.newEncoder().run {
- onMalformedInput(CodingErrorAction.REPORT)
- encode(CharBuffer.wrap(value))
- }
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypeSandboxTemplateRefBuilder: FfiConverter<SandboxTemplateRefBuilder, Long> {
+ override fun lower(value: SandboxTemplateRefBuilder): Long {
+ return value.uniffiCloneHandle()
}
- override fun lower(value: String): RustBuffer.ByValue {
- val byteBuf = toUtf8(value)
- // Ideally we'd pass these bytes to `ffi_bytebuffer_from_bytes`, but doing so would require us
- // to copy them into a JNA `Memory`. So we might as well directly copy them into a `RustBuffer`.
- val rbuf = RustBuffer.alloc(byteBuf.limit().toULong())
- rbuf.asByteBuffer()!!.put(byteBuf)
- return rbuf
+ override fun lift(value: Long): SandboxTemplateRefBuilder {
+ return SandboxTemplateRefBuilder(UniffiWithHandle, value)
}
- // We aren't sure exactly how many bytes our string will be once it's UTF-8
- // encoded. Allocate 3 bytes per UTF-16 code unit which will always be
- // enough.
- override fun allocationSize(value: String): ULong {
- val sizeForLength = 4UL
- val sizeForString = value.length.toULong() * 3UL
- return sizeForLength + sizeForString
+ override fun read(buf: ByteBuffer): SandboxTemplateRefBuilder {
+ return lift(buf.getLong())
}
- override fun write(value: String, buf: ByteBuffer) {
- val byteBuf = toUtf8(value)
- buf.putInt(byteBuf.limit())
- buf.put(byteBuf)
+ override fun allocationSize(value: SandboxTemplateRefBuilder) = 8UL
+
+ override fun write(value: SandboxTemplateRefBuilder, buf: ByteBuffer) {
+ buf.putLong(lower(value))
}
}
@@ -1170,14 +2830,42 @@ public object FfiConverterString: FfiConverter<String, RustBuffer.ByValue> {
//
-public interface PreservedJsonInterface {
+public interface VmTemplateBuilderInterface {
- fun `toJson`(): kotlin.String
+ fun `build`(): VmTemplate
+
+ fun `command`(`value`: List<kotlin.String>): VmTemplateBuilder
+
+ fun `containerDiskImage`(`value`: kotlin.String): VmTemplateBuilder
+
+ fun `cpuCores`(`value`: kotlin.UInt): VmTemplateBuilder
+
+ fun `firmware`(`value`: Firmware): VmTemplateBuilder
+
+ fun `imagePullPolicy`(`value`: ImagePullPolicy): VmTemplateBuilder
+
+ fun `imagePullSecret`(`value`: kotlin.String): VmTemplateBuilder
+
+ fun `memory`(`value`: kotlin.String): VmTemplateBuilder
+
+ fun `nodeSelector`(`value`: Map<kotlin.String, kotlin.String>): VmTemplateBuilder
+
+ fun `oidc`(`value`: OidcConfig): VmTemplateBuilder
+
+ fun `probes`(`value`: PreservedJson): VmTemplateBuilder
+
+ fun `runtime`(`value`: RuntimeKind): VmTemplateBuilder
+
+ fun `runtimeClassName`(`value`: kotlin.String): VmTemplateBuilder
+
+ fun `services`(`value`: List<SandboxService>): VmTemplateBuilder
+
+ fun `tolerations`(`value`: List<PreservedJson>): VmTemplateBuilder
companion object
}
-open class PreservedJson: Disposable, AutoCloseable, PreservedJsonInterface
+open class VmTemplateBuilder: Disposable, AutoCloseable, VmTemplateBuilderInterface
{
@Suppress("UNUSED_PARAMETER")
@@ -1201,6 +2889,14 @@ open class PreservedJson: Disposable, AutoCloseable, PreservedJsonInterface
this.handle = 0
this.cleanable = null
}
+ constructor() :
+ this(UniffiWithHandle,
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new(
+
+ _status)
+}
+ )
protected val handle: Long
protected val cleanable: UniffiCleaner.Cleanable?
@@ -1256,7 +2952,7 @@ open class PreservedJson: Disposable, AutoCloseable, PreservedJsonInterface
return;
}
uniffiRustCall { status ->
- UniffiLib.uniffi_cyclops_sdk_schema_fn_free_preservedjson(handle, status)
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder(handle, status)
}
}
}
@@ -1269,15 +2965,16 @@ open class PreservedJson: Disposable, AutoCloseable, PreservedJsonInterface
throw InternalException("uniffiCloneHandle() called on NoHandle object");
}
return uniffiRustCall() { status ->
- UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_preservedjson(handle, status)
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder(handle, status)
}
}
- override fun `toJson`(): kotlin.String {
- return FfiConverterString.lift(
+
+ @Throws(SchemaBuildException::class)override fun `build`(): VmTemplate {
+ return FfiConverterTypeVmTemplate.lift(
callWithHandle {
- uniffiRustCall() { _status ->
- UniffiLib.uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(
+ uniffiRustCallWithError(SchemaBuildException) { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build(
it,
_status)
}
@@ -1286,50 +2983,222 @@ open class PreservedJson: Disposable, AutoCloseable, PreservedJsonInterface
}
+ override fun `command`(`value`: List<kotlin.String>): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command(
+ it,
+ FfiConverterSequenceString.lower(`value`),_status)
+}
+ }
+ )
+ }
+ override fun `containerDiskImage`(`value`: kotlin.String): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image(
+ it,
+ FfiConverterString.lower(`value`),_status)
+}
+ }
+ )
+ }
+ override fun `cpuCores`(`value`: kotlin.UInt): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores(
+ it,
+ FfiConverterUInt.lower(`value`),_status)
+}
+ }
+ )
+ }
- companion object {
+ override fun `firmware`(`value`: Firmware): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware(
+ it,
+ FfiConverterTypeFirmware.lower(`value`),_status)
+}
+ }
+ )
+ }
- @Throws(JsonValueException::class) fun `fromJson`(`value`: kotlin.String): PreservedJson {
- return FfiConverterTypePreservedJson.lift(
- uniffiRustCallWithError(JsonValueException) { _status ->
- UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(
+ override fun `imagePullPolicy`(`value`: ImagePullPolicy): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy(
+ it,
+ FfiConverterTypeImagePullPolicy.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `imagePullSecret`(`value`: kotlin.String): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret(
+ it,
+ FfiConverterString.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `memory`(`value`: kotlin.String): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory(
+ it,
+ FfiConverterString.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `nodeSelector`(`value`: Map<kotlin.String, kotlin.String>): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector(
+ it,
+ FfiConverterMapStringString.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `oidc`(`value`: OidcConfig): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc(
+ it,
+ FfiConverterTypeOidcConfig.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `probes`(`value`: PreservedJson): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes(
+ it,
+ FfiConverterTypePreservedJson.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `runtime`(`value`: RuntimeKind): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime(
+ it,
+ FfiConverterTypeRuntimeKind.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+
+ override fun `runtimeClassName`(`value`: kotlin.String): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name(
+ it,
FfiConverterString.lower(`value`),_status)
}
+ }
)
}
+ override fun `services`(`value`: List<SandboxService>): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services(
+ it,
+ FfiConverterSequenceTypeSandboxService.lower(`value`),_status)
+}
+ }
+ )
+ }
+
+ override fun `tolerations`(`value`: List<PreservedJson>): VmTemplateBuilder {
+ return FfiConverterTypeVmTemplateBuilder.lift(
+ callWithHandle {
+ uniffiRustCall() { _status ->
+ UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations(
+ it,
+ FfiConverterSequenceTypePreservedJson.lower(`value`),_status)
+}
+ }
+ )
}
+
+
+
+
+
+
+
+
+ /**
+ * @suppress
+ */
+ companion object
+
}
/**
* @suppress
*/
-public object FfiConverterTypePreservedJson: FfiConverter<PreservedJson, Long> {
- override fun lower(value: PreservedJson): Long {
+public object FfiConverterTypeVmTemplateBuilder: FfiConverter<VmTemplateBuilder, Long> {
+ override fun lower(value: VmTemplateBuilder): Long {
return value.uniffiCloneHandle()
}
- override fun lift(value: Long): PreservedJson {
- return PreservedJson(UniffiWithHandle, value)
+ override fun lift(value: Long): VmTemplateBuilder {
+ return VmTemplateBuilder(UniffiWithHandle, value)
}
- override fun read(buf: ByteBuffer): PreservedJson {
+ override fun read(buf: ByteBuffer): VmTemplateBuilder {
return lift(buf.getLong())
}
- override fun allocationSize(value: PreservedJson) = 8UL
+ override fun allocationSize(value: VmTemplateBuilder) = 8UL
- override fun write(value: PreservedJson, buf: ByteBuffer) {
+ override fun write(value: VmTemplateBuilder, buf: ByteBuffer) {
buf.putLong(lower(value))
}
}
@@ -2255,6 +4124,73 @@ public object FfiConverterTypeRuntimeKind: FfiConverterRustBuffer<RuntimeKind> {
+
+sealed class SchemaBuildException: kotlin.Exception() {
+
+ class MissingRequiredField(
+
+ val `recordType`: kotlin.String,
+
+ val `field`: kotlin.String
+ ) : SchemaBuildException() {
+ override val message
+ get() = "recordType=${ `recordType` }, field=${ `field` }"
+ }
+
+
+
+
+
+ companion object ErrorHandler : UniffiRustCallStatusErrorHandler<SchemaBuildException> {
+ override fun lift(error_buf: RustBuffer.ByValue): SchemaBuildException = FfiConverterTypeSchemaBuildError.lift(error_buf)
+ }
+
+
+}
+
+/**
+ * @suppress
+ */
+public object FfiConverterTypeSchemaBuildError : FfiConverterRustBuffer<SchemaBuildException> {
+ override fun read(buf: ByteBuffer): SchemaBuildException {
+
+
+ return when(buf.getInt()) {
+ 1 -> SchemaBuildException.MissingRequiredField(
+ FfiConverterString.read(buf),
+ FfiConverterString.read(buf),
+ )
+ else -> throw RuntimeException("invalid error enum value, something is very wrong!!")
+ }
+ }
+
+ override fun allocationSize(value: SchemaBuildException): ULong {
+ return when(value) {
+ is SchemaBuildException.MissingRequiredField -> (
+ // Add the size for the Int that specifies the variant plus the size needed for all fields
+ 4UL
+ + FfiConverterString.allocationSize(value.`recordType`)
+ + FfiConverterString.allocationSize(value.`field`)
+ )
+ }
+ }
+
+ override fun write(value: SchemaBuildException, buf: ByteBuffer) {
+ when(value) {
+ is SchemaBuildException.MissingRequiredField -> {
+ buf.putInt(1)
+ FfiConverterString.write(value.`recordType`, buf)
+ FfiConverterString.write(value.`field`, buf)
+ Unit
+ }
+ }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
+ }
+
+}
+
+
+
+
enum class ServiceProtocol {
TCP,
diff --git a/libs/fleet/sdk-bindings/kotlin/build.gradle.kts b/libs/fleet/sdk-bindings/kotlin/build.gradle.kts
index c36f8a98cd..e699c6ca1f 100644
--- a/libs/fleet/sdk-bindings/kotlin/build.gradle.kts
+++ b/libs/fleet/sdk-bindings/kotlin/build.gradle.kts
@@ -22,6 +22,11 @@ tasks.register<JavaExec>("contract") {
mainClass.set("TestAsyncClientKt")
jvmArgs("-Djna.library.path=" + System.getenv("CYCLOPS_SDK_NATIVE_DIR"))
}
+tasks.register<JavaExec>("builderContract") {
+ classpath = sourceSets.test.get().runtimeClasspath
+ mainClass.set("TestBuildersKt")
+ jvmArgs("-Djna.library.path=" + System.getenv("CYCLOPS_SDK_NATIVE_DIR"))
+}
tasks.register<JavaExec>("example") {
dependsOn(example.classesTaskName)
classpath = example.runtimeClasspath
diff --git a/libs/fleet/sdk-bindings/kotlin/tests/TestBuilders.kt b/libs/fleet/sdk-bindings/kotlin/tests/TestBuilders.kt
new file mode 100644
index 0000000000..576a8555c7
--- /dev/null
+++ b/libs/fleet/sdk-bindings/kotlin/tests/TestBuilders.kt
@@ -0,0 +1,55 @@
+import ai.cua.cyclops.sdk.CreatePoolRequestBuilder
+import ai.cua.cyclops.sdk.CreateTemplateRequest
+import ai.cua.cyclops.sdk.CreateTemplateRequestBuilder
+import ai.cua.cyclops.sdk.SdkBuildException
+import ai.cua.cyclops.sdk.schema.OsGymSandboxTemplateSpec
+import ai.cua.cyclops.sdk.schema.OsGymSandboxTemplateSpecBuilder
+import ai.cua.cyclops.sdk.schema.SandboxService
+import ai.cua.cyclops.sdk.schema.SandboxServiceBuilder
+import ai.cua.cyclops.sdk.schema.SandboxTemplateRef
+import ai.cua.cyclops.sdk.schema.SchemaBuildException
+import ai.cua.cyclops.sdk.schema.VmTemplate
+import ai.cua.cyclops.sdk.schema.VmTemplateBuilder
+
+fun main() {
+ val service: SandboxService = SandboxServiceBuilder()
+ .name("mcp")
+ .targetPort(3000u)
+ .build()
+ val vm: VmTemplate = VmTemplateBuilder()
+ .containerDiskImage("registry.example/vm:latest")
+ .imagePullSecret("registry-secret")
+ .cpuCores(4u)
+ .memory("8Gi")
+ .services(listOf(service))
+ .build()
+ val templateSpec: OsGymSandboxTemplateSpec = OsGymSandboxTemplateSpecBuilder()
+ .vmTemplate(vm)
+ .build()
+ val request: CreateTemplateRequest = CreateTemplateRequestBuilder()
+ .namespace("default")
+ .name("desktop")
+ .spec(templateSpec)
+ .build()
+
+ check(service.protocol == null)
+ check(vm.command == null)
+ check(vm.imagePullSecret == "registry-secret")
+ check(vm.cpuCores == 4u)
+ check(vm.memory == "8Gi")
+ check(request.spec.vmTemplate.containerDiskImage == "registry.example/vm:latest")
+
+ val schemaError = runCatching { VmTemplateBuilder().build() }.exceptionOrNull()
+ check(schemaError is SchemaBuildException.MissingRequiredField)
+ check(schemaError.recordType == "VmTemplate")
+ check(schemaError.field == "container_disk_image")
+
+ val sdkError = runCatching { CreatePoolRequestBuilder().build() }.exceptionOrNull()
+ check(sdkError is SdkBuildException.MissingRequiredField)
+ check(sdkError.recordType == "CreatePoolRequest")
+ check(sdkError.field == "namespace")
+
+ val legacy = SandboxTemplateRef(name = "legacy")
+ check(legacy::class == SandboxTemplateRef::class)
+ check(legacy.name == "legacy")
+}
diff --git a/libs/fleet/sdk-bindings/python/fleet_sdk/__init__.py b/libs/fleet/sdk-bindings/python/fleet_sdk/__init__.py
index c70a1cb69c..02a57bbf03 100644
--- a/libs/fleet/sdk-bindings/python/fleet_sdk/__init__.py
+++ b/libs/fleet/sdk-bindings/python/fleet_sdk/__init__.py
@@ -1,13 +1,32 @@
from . import _schema as _schema_component
from ._schema import *
-_UniffiFfiConverterTypeClaimSpec = _schema_component._UniffiFfiConverterTypeClaimSpec
-_UniffiFfiConverterTypeOSGymSandboxClaimStatus = _schema_component._UniffiFfiConverterTypeOSGymSandboxClaimStatus
-_UniffiFfiConverterTypeOSGymSandboxTemplateSpec = _schema_component._UniffiFfiConverterTypeOSGymSandboxTemplateSpec
-_UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec = _schema_component._UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec
-_UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus = _schema_component._UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus
from . import _sdk as _sdk_component
from ._sdk import *
+class _UniffiFfiConverterTypeClaimSpec(_sdk_component._UniffiConverterRustBuffer):
+ check_lower = staticmethod(_schema_component._UniffiFfiConverterTypeClaimSpec.check_lower)
+ read = staticmethod(_schema_component._UniffiFfiConverterTypeClaimSpec.read)
+ write = staticmethod(_schema_component._UniffiFfiConverterTypeClaimSpec.write)
+
+class _UniffiFfiConverterTypeOSGymSandboxClaimStatus(_sdk_component._UniffiConverterRustBuffer):
+ check_lower = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxClaimStatus.check_lower)
+ read = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxClaimStatus.read)
+ write = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxClaimStatus.write)
+
+class _UniffiFfiConverterTypeOSGymSandboxTemplateSpec(_sdk_component._UniffiConverterRustBuffer):
+ check_lower = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxTemplateSpec.check_lower)
+ read = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxTemplateSpec.read)
+ write = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxTemplateSpec.write)
+
+class _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec(_sdk_component._UniffiConverterRustBuffer):
+ check_lower = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec.check_lower)
+ read = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec.read)
+ write = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec.write)
+
+class _UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus(_sdk_component._UniffiConverterRustBuffer):
+ check_lower = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus.check_lower)
+ read = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus.read)
+ write = staticmethod(_schema_component._UniffiFfiConverterTypeOSGymSandboxWarmPoolStatus.write)
__all__ = [*_schema_component.__all__, *_sdk_component.__all__]
diff --git a/libs/fleet/sdk-bindings/python/fleet_sdk/_schema.py b/libs/fleet/sdk-bindings/python/fleet_sdk/_schema.py
index 3b51d12ac0..bb461d2bff 100644
--- a/libs/fleet/sdk-bindings/python/fleet_sdk/_schema.py
+++ b/libs/fleet/sdk-bindings/python/fleet_sdk/_schema.py
@@ -478,10 +478,74 @@ def _uniffi_check_contract_api_version(lib):
raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project")
def _uniffi_check_api_checksums(lib):
+ if lib.uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxtemplatespecbuilder_new() != 22071:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_build() != 53928:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template() != 6610:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new() != 26063:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling() != 44912:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build() != 5682:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas() != 50438:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref() != 7198:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json() != 24064:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json() != 8252:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_constructor_sandboxservicebuilder_new() != 21082:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_build() != 62919:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_name() != 62417:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_protocol() != 10309:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_target_port() != 61462:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_constructor_sandboxtemplaterefbuilder_new() != 4748:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_build() != 46569:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_name() != 1803:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_constructor_vmtemplatebuilder_new() != 27302:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_build() != 17867:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_command() != 20371:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_container_disk_image() != 49021:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_cpu_cores() != 25645:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_firmware() != 33926:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_policy() != 41828:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_secret() != 40154:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_memory() != 55615:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_node_selector() != 45280:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_oidc() != 27280:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_probes() != 40623:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime() != 63375:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime_class_name() != 25466:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_services() != 14113:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_tolerations() != 1632:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
# A ctypes library to expose the extern-C FFI definitions.
# This is an implementation detail which will be called internally by the public API.
@@ -745,6 +809,26 @@ _UniffiLib.ffi_cyclops_sdk_schema_rust_future_free_void.argtypes = (
ctypes.c_uint64,
)
_UniffiLib.ffi_cyclops_sdk_schema_rust_future_free_void.restype = None
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder.restype = None
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder.restype = None
_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_preservedjson.argtypes = (
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
@@ -755,6 +839,78 @@ _UniffiLib.uniffi_cyclops_sdk_schema_fn_free_preservedjson.argtypes = (
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_preservedjson.restype = None
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder.restype = None
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder.restype = None
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder.restype = None
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new.argtypes = (
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new.argtypes = (
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas.argtypes = (
+ ctypes.c_uint64,
+ ctypes.c_uint32,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref.restype = ctypes.c_uint64
_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json.argtypes = (
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
@@ -765,15 +921,246 @@ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json.argtypes =
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new.argtypes = (
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port.argtypes = (
+ ctypes.c_uint64,
+ ctypes.c_uint16,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new.argtypes = (
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new.argtypes = (
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores.argtypes = (
+ ctypes.c_uint64,
+ ctypes.c_uint32,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes.argtypes = (
+ ctypes.c_uint64,
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations.restype = ctypes.c_uint64
_UniffiLib.ffi_cyclops_sdk_schema_uniffi_contract_version.argtypes = (
)
_UniffiLib.ffi_cyclops_sdk_schema_uniffi_contract_version.restype = ctypes.c_uint32
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxtemplatespecbuilder_new.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxtemplatespecbuilder_new.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_build.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_build.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref.restype = ctypes.c_uint16
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json.restype = ctypes.c_uint16
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_sandboxservicebuilder_new.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_sandboxservicebuilder_new.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_build.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_build.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_name.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_name.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_protocol.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_protocol.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_target_port.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_target_port.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_sandboxtemplaterefbuilder_new.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_sandboxtemplaterefbuilder_new.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_build.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_build.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_name.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_name.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_vmtemplatebuilder_new.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_constructor_vmtemplatebuilder_new.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_build.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_build.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_command.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_command.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_container_disk_image.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_container_disk_image.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_cpu_cores.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_cpu_cores.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_firmware.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_firmware.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_policy.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_policy.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_secret.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_secret.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_memory.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_memory.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_node_selector.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_node_selector.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_oidc.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_oidc.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_probes.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_probes.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime_class_name.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime_class_name.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_services.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_services.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_tolerations.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_tolerations.restype = ctypes.c_uint16
_uniffi_check_contract_api_version(_UniffiLib)
# _uniffi_check_api_checksums(_UniffiLib)
@@ -2440,6 +2827,838 @@ class _UniffiFfiConverterTypeJsonValueError(_UniffiConverterRustBuffer):
buf.write_i32(1)
_UniffiFfiConverterString.write(value.reason, buf)
+
+
+# SchemaBuildError
+# We want to define each variant as a nested class that's also a subclass,
+# which is tricky in Python. To accomplish this we're going to create each
+# class separately, then manually add the child classes to the base class's
+# __dict__. All of this happens in dummy class to avoid polluting the module
+# namespace.
+class SchemaBuildError(Exception):
+ pass
+
+_UniffiTempSchemaBuildError = SchemaBuildError
+
+class SchemaBuildError: # type: ignore
+
+ class MissingRequiredField(_UniffiTempSchemaBuildError):
+
+ def __init__(self, record_type, field):
+ super().__init__(", ".join([
+ "record_type={!r}".format(record_type),
+ "field={!r}".format(field),
+ ]))
+ self.record_type = record_type
+ self.field = field
+
+ def __repr__(self):
+ return "SchemaBuildError.MissingRequiredField({})".format(str(self))
+ _UniffiTempSchemaBuildError.MissingRequiredField = MissingRequiredField # type: ignore
+
+SchemaBuildError = _UniffiTempSchemaBuildError # type: ignore
+del _UniffiTempSchemaBuildError
+
+
+class _UniffiFfiConverterTypeSchemaBuildError(_UniffiConverterRustBuffer):
+ @staticmethod
+ def read(buf):
+ variant = buf.read_i32()
+ if variant == 1:
+ return SchemaBuildError.MissingRequiredField(
+ _UniffiFfiConverterString.read(buf),
+ _UniffiFfiConverterString.read(buf),
+ )
+ raise InternalError("Raw enum value doesn't match any cases")
+
+ @staticmethod
+ def check_lower(value):
+ if isinstance(value, SchemaBuildError.MissingRequiredField):
+ _UniffiFfiConverterString.check_lower(value.record_type)
+ _UniffiFfiConverterString.check_lower(value.field)
+ return
+
+ @staticmethod
+ def write(value, buf):
+ if isinstance(value, SchemaBuildError.MissingRequiredField):
+ buf.write_i32(1)
+ _UniffiFfiConverterString.write(value.record_type, buf)
+ _UniffiFfiConverterString.write(value.field, buf)
+
+
+class OsGymSandboxTemplateSpecBuilderProtocol(typing.Protocol):
+
+ def build(self, ) -> OsGymSandboxTemplateSpec:
+ raise NotImplementedError
+ def vm_template(self, value: VmTemplate) -> OsGymSandboxTemplateSpecBuilder:
+ raise NotImplementedError
+
+class OsGymSandboxTemplateSpecBuilder(OsGymSandboxTemplateSpecBuilderProtocol):
+
+ _handle: ctypes.c_uint64
+ def __init__(self, ):
+ _uniffi_lowered_args = (
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxTemplateSpecBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new,
+ *_uniffi_lowered_args,
+ )
+ self._handle = _uniffi_ffi_result
+
+ def __del__(self):
+ # In case of partial initialization of instances.
+ handle = getattr(self, "_handle", None)
+ if handle is not None:
+ _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder, handle)
+
+ def _uniffi_clone_handle(self):
+ return _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder, self._handle)
+
+ # Used by alternative constructors or any methods which return this type.
+ @classmethod
+ def _uniffi_make_instance(cls, handle):
+ # Lightly yucky way to bypass the usual __init__ logic
+ # and just create a new instance with the required handle.
+ inst = cls.__new__(cls)
+ inst._handle = handle
+ return inst
+ def build(self, ) -> OsGymSandboxTemplateSpec:
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxTemplateSpec.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeSchemaBuildError
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def vm_template(self, value: VmTemplate) -> OsGymSandboxTemplateSpecBuilder:
+
+ _UniffiFfiConverterTypeVmTemplate.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeVmTemplate.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxTemplateSpecBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+
+
+
+
+
+class _UniffiFfiConverterTypeOSGymSandboxTemplateSpecBuilder:
+ @staticmethod
+ def lift(value: int) -> OsGymSandboxTemplateSpecBuilder:
+ return OsGymSandboxTemplateSpecBuilder._uniffi_make_instance(value)
+
+ @staticmethod
+ def check_lower(value: OsGymSandboxTemplateSpecBuilder):
+ if not isinstance(value, OsGymSandboxTemplateSpecBuilder):
+ raise TypeError("Expected OsGymSandboxTemplateSpecBuilder instance, {} found".format(type(value).__name__))
+
+ @staticmethod
+ def lower(value: OsGymSandboxTemplateSpecBuilder) -> ctypes.c_uint64:
+ return value._uniffi_clone_handle()
+
+ @classmethod
+ def read(cls, buf: _UniffiRustBuffer) -> OsGymSandboxTemplateSpecBuilder:
+ ptr = buf.read_u64()
+ if ptr == 0:
+ raise InternalError("Raw handle value was null")
+ return cls.lift(ptr)
+
+ @classmethod
+ def write(cls, value: OsGymSandboxTemplateSpecBuilder, buf: _UniffiRustBuffer):
+ buf.write_u64(cls.lower(value))
+
+
+class OsGymSandboxWarmPoolSpecBuilderProtocol(typing.Protocol):
+
+ def autoscaling(self, value: WarmPoolAutoscaling) -> OsGymSandboxWarmPoolSpecBuilder:
+ raise NotImplementedError
+ def build(self, ) -> OsGymSandboxWarmPoolSpec:
+ raise NotImplementedError
+ def replicas(self, value: int) -> OsGymSandboxWarmPoolSpecBuilder:
+ raise NotImplementedError
+ def sandbox_template_ref(self, value: SandboxTemplateRef) -> OsGymSandboxWarmPoolSpecBuilder:
+ raise NotImplementedError
+
+class OsGymSandboxWarmPoolSpecBuilder(OsGymSandboxWarmPoolSpecBuilderProtocol):
+
+ _handle: ctypes.c_uint64
+ def __init__(self, ):
+ _uniffi_lowered_args = (
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new,
+ *_uniffi_lowered_args,
+ )
+ self._handle = _uniffi_ffi_result
+
+ def __del__(self):
+ # In case of partial initialization of instances.
+ handle = getattr(self, "_handle", None)
+ if handle is not None:
+ _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder, handle)
+
+ def _uniffi_clone_handle(self):
+ return _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder, self._handle)
+
+ # Used by alternative constructors or any methods which return this type.
+ @classmethod
+ def _uniffi_make_instance(cls, handle):
+ # Lightly yucky way to bypass the usual __init__ logic
+ # and just create a new instance with the required handle.
+ inst = cls.__new__(cls)
+ inst._handle = handle
+ return inst
+ def autoscaling(self, value: WarmPoolAutoscaling) -> OsGymSandboxWarmPoolSpecBuilder:
+
+ _UniffiFfiConverterTypeWarmPoolAutoscaling.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeWarmPoolAutoscaling.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def build(self, ) -> OsGymSandboxWarmPoolSpec:
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeSchemaBuildError
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def replicas(self, value: int) -> OsGymSandboxWarmPoolSpecBuilder:
+
+ _UniffiFfiConverterUInt32.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterUInt32.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def sandbox_template_ref(self, value: SandboxTemplateRef) -> OsGymSandboxWarmPoolSpecBuilder:
+
+ _UniffiFfiConverterTypeSandboxTemplateRef.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeSandboxTemplateRef.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+
+
+
+
+
+class _UniffiFfiConverterTypeOSGymSandboxWarmPoolSpecBuilder:
+ @staticmethod
+ def lift(value: int) -> OsGymSandboxWarmPoolSpecBuilder:
+ return OsGymSandboxWarmPoolSpecBuilder._uniffi_make_instance(value)
+
+ @staticmethod
+ def check_lower(value: OsGymSandboxWarmPoolSpecBuilder):
+ if not isinstance(value, OsGymSandboxWarmPoolSpecBuilder):
+ raise TypeError("Expected OsGymSandboxWarmPoolSpecBuilder instance, {} found".format(type(value).__name__))
+
+ @staticmethod
+ def lower(value: OsGymSandboxWarmPoolSpecBuilder) -> ctypes.c_uint64:
+ return value._uniffi_clone_handle()
+
+ @classmethod
+ def read(cls, buf: _UniffiRustBuffer) -> OsGymSandboxWarmPoolSpecBuilder:
+ ptr = buf.read_u64()
+ if ptr == 0:
+ raise InternalError("Raw handle value was null")
+ return cls.lift(ptr)
+
+ @classmethod
+ def write(cls, value: OsGymSandboxWarmPoolSpecBuilder, buf: _UniffiRustBuffer):
+ buf.write_u64(cls.lower(value))
+
+
+class SandboxServiceBuilderProtocol(typing.Protocol):
+
+ def build(self, ) -> SandboxService:
+ raise NotImplementedError
+ def name(self, value: str) -> SandboxServiceBuilder:
+ raise NotImplementedError
+ def protocol(self, value: ServiceProtocol) -> SandboxServiceBuilder:
+ raise NotImplementedError
+ def target_port(self, value: int) -> SandboxServiceBuilder:
+ raise NotImplementedError
+
+class SandboxServiceBuilder(SandboxServiceBuilderProtocol):
+
+ _handle: ctypes.c_uint64
+ def __init__(self, ):
+ _uniffi_lowered_args = (
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSandboxServiceBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new,
+ *_uniffi_lowered_args,
+ )
+ self._handle = _uniffi_ffi_result
+
+ def __del__(self):
+ # In case of partial initialization of instances.
+ handle = getattr(self, "_handle", None)
+ if handle is not None:
+ _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder, handle)
+
+ def _uniffi_clone_handle(self):
+ return _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder, self._handle)
+
+ # Used by alternative constructors or any methods which return this type.
+ @classmethod
+ def _uniffi_make_instance(cls, handle):
+ # Lightly yucky way to bypass the usual __init__ logic
+ # and just create a new instance with the required handle.
+ inst = cls.__new__(cls)
+ inst._handle = handle
+ return inst
+ def build(self, ) -> SandboxService:
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSandboxService.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeSchemaBuildError
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def name(self, value: str) -> SandboxServiceBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSandboxServiceBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def protocol(self, value: ServiceProtocol) -> SandboxServiceBuilder:
+
+ _UniffiFfiConverterTypeServiceProtocol.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeServiceProtocol.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSandboxServiceBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def target_port(self, value: int) -> SandboxServiceBuilder:
+
+ _UniffiFfiConverterUInt16.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterUInt16.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSandboxServiceBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+
+
+
+
+
+class _UniffiFfiConverterTypeSandboxServiceBuilder:
+ @staticmethod
+ def lift(value: int) -> SandboxServiceBuilder:
+ return SandboxServiceBuilder._uniffi_make_instance(value)
+
+ @staticmethod
+ def check_lower(value: SandboxServiceBuilder):
+ if not isinstance(value, SandboxServiceBuilder):
+ raise TypeError("Expected SandboxServiceBuilder instance, {} found".format(type(value).__name__))
+
+ @staticmethod
+ def lower(value: SandboxServiceBuilder) -> ctypes.c_uint64:
+ return value._uniffi_clone_handle()
+
+ @classmethod
+ def read(cls, buf: _UniffiRustBuffer) -> SandboxServiceBuilder:
+ ptr = buf.read_u64()
+ if ptr == 0:
+ raise InternalError("Raw handle value was null")
+ return cls.lift(ptr)
+
+ @classmethod
+ def write(cls, value: SandboxServiceBuilder, buf: _UniffiRustBuffer):
+ buf.write_u64(cls.lower(value))
+
+
+class SandboxTemplateRefBuilderProtocol(typing.Protocol):
+
+ def build(self, ) -> SandboxTemplateRef:
+ raise NotImplementedError
+ def name(self, value: str) -> SandboxTemplateRefBuilder:
+ raise NotImplementedError
+
+class SandboxTemplateRefBuilder(SandboxTemplateRefBuilderProtocol):
+
+ _handle: ctypes.c_uint64
+ def __init__(self, ):
+ _uniffi_lowered_args = (
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSandboxTemplateRefBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new,
+ *_uniffi_lowered_args,
+ )
+ self._handle = _uniffi_ffi_result
+
+ def __del__(self):
+ # In case of partial initialization of instances.
+ handle = getattr(self, "_handle", None)
+ if handle is not None:
+ _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder, handle)
+
+ def _uniffi_clone_handle(self):
+ return _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder, self._handle)
+
+ # Used by alternative constructors or any methods which return this type.
+ @classmethod
+ def _uniffi_make_instance(cls, handle):
+ # Lightly yucky way to bypass the usual __init__ logic
+ # and just create a new instance with the required handle.
+ inst = cls.__new__(cls)
+ inst._handle = handle
+ return inst
+ def build(self, ) -> SandboxTemplateRef:
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSandboxTemplateRef.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeSchemaBuildError
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def name(self, value: str) -> SandboxTemplateRefBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeSandboxTemplateRefBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+
+
+
+
+
+class _UniffiFfiConverterTypeSandboxTemplateRefBuilder:
+ @staticmethod
+ def lift(value: int) -> SandboxTemplateRefBuilder:
+ return SandboxTemplateRefBuilder._uniffi_make_instance(value)
+
+ @staticmethod
+ def check_lower(value: SandboxTemplateRefBuilder):
+ if not isinstance(value, SandboxTemplateRefBuilder):
+ raise TypeError("Expected SandboxTemplateRefBuilder instance, {} found".format(type(value).__name__))
+
+ @staticmethod
+ def lower(value: SandboxTemplateRefBuilder) -> ctypes.c_uint64:
+ return value._uniffi_clone_handle()
+
+ @classmethod
+ def read(cls, buf: _UniffiRustBuffer) -> SandboxTemplateRefBuilder:
+ ptr = buf.read_u64()
+ if ptr == 0:
+ raise InternalError("Raw handle value was null")
+ return cls.lift(ptr)
+
+ @classmethod
+ def write(cls, value: SandboxTemplateRefBuilder, buf: _UniffiRustBuffer):
+ buf.write_u64(cls.lower(value))
+
+
+class VmTemplateBuilderProtocol(typing.Protocol):
+
+ def build(self, ) -> VmTemplate:
+ raise NotImplementedError
+ def command(self, value: typing.List[str]) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def container_disk_image(self, value: str) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def cpu_cores(self, value: int) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def firmware(self, value: Firmware) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def image_pull_policy(self, value: ImagePullPolicy) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def image_pull_secret(self, value: str) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def memory(self, value: str) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def node_selector(self, value: dict[str, str]) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def oidc(self, value: OidcConfig) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def probes(self, value: PreservedJson) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def runtime(self, value: RuntimeKind) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def runtime_class_name(self, value: str) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def services(self, value: typing.List[SandboxService]) -> VmTemplateBuilder:
+ raise NotImplementedError
+ def tolerations(self, value: typing.List[PreservedJson]) -> VmTemplateBuilder:
+ raise NotImplementedError
+
+class VmTemplateBuilder(VmTemplateBuilderProtocol):
+
+ _handle: ctypes.c_uint64
+ def __init__(self, ):
+ _uniffi_lowered_args = (
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new,
+ *_uniffi_lowered_args,
+ )
+ self._handle = _uniffi_ffi_result
+
+ def __del__(self):
+ # In case of partial initialization of instances.
+ handle = getattr(self, "_handle", None)
+ if handle is not None:
+ _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder, handle)
+
+ def _uniffi_clone_handle(self):
+ return _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder, self._handle)
+
+ # Used by alternative constructors or any methods which return this type.
+ @classmethod
+ def _uniffi_make_instance(cls, handle):
+ # Lightly yucky way to bypass the usual __init__ logic
+ # and just create a new instance with the required handle.
+ inst = cls.__new__(cls)
+ inst._handle = handle
+ return inst
+ def build(self, ) -> VmTemplate:
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplate.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeSchemaBuildError
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def command(self, value: typing.List[str]) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterSequenceString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterSequenceString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def container_disk_image(self, value: str) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def cpu_cores(self, value: int) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterUInt32.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterUInt32.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def firmware(self, value: Firmware) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterTypeFirmware.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeFirmware.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def image_pull_policy(self, value: ImagePullPolicy) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterTypeImagePullPolicy.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeImagePullPolicy.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def image_pull_secret(self, value: str) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def memory(self, value: str) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def node_selector(self, value: dict[str, str]) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterMapStringString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterMapStringString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def oidc(self, value: OidcConfig) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterTypeOidcConfig.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeOidcConfig.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def probes(self, value: PreservedJson) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterTypePreservedJson.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypePreservedJson.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def runtime(self, value: RuntimeKind) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterTypeRuntimeKind.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterTypeRuntimeKind.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def runtime_class_name(self, value: str) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def services(self, value: typing.List[SandboxService]) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterSequenceTypeSandboxService.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterSequenceTypeSandboxService.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def tolerations(self, value: typing.List[PreservedJson]) -> VmTemplateBuilder:
+
+ _UniffiFfiConverterSequenceTypePreservedJson.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterSequenceTypePreservedJson.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeVmTemplateBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+
+
+
+
+
+class _UniffiFfiConverterTypeVmTemplateBuilder:
+ @staticmethod
+ def lift(value: int) -> VmTemplateBuilder:
+ return VmTemplateBuilder._uniffi_make_instance(value)
+
+ @staticmethod
+ def check_lower(value: VmTemplateBuilder):
+ if not isinstance(value, VmTemplateBuilder):
+ raise TypeError("Expected VmTemplateBuilder instance, {} found".format(type(value).__name__))
+
+ @staticmethod
+ def lower(value: VmTemplateBuilder) -> ctypes.c_uint64:
+ return value._uniffi_clone_handle()
+
+ @classmethod
+ def read(cls, buf: _UniffiRustBuffer) -> VmTemplateBuilder:
+ ptr = buf.read_u64()
+ if ptr == 0:
+ raise InternalError("Raw handle value was null")
+ return cls.lift(ptr)
+
+ @classmethod
+ def write(cls, value: VmTemplateBuilder, buf: _UniffiRustBuffer):
+ buf.write_u64(cls.lower(value))
+
class _UniffiFfiConverterUInt8(_UniffiConverterPrimitiveInt):
CLASS_NAME = "u8"
VALUE_MIN = 0
@@ -2460,6 +3679,7 @@ __all__ = [
"Firmware",
"ServiceProtocol",
"JsonValueError",
+ "SchemaBuildError",
"ClaimLifecycle",
"SandboxTemplateRef",
"ClaimSpec",
@@ -2477,4 +3697,14 @@ __all__ = [
"OsGymSandboxWarmPoolStatus",
"PreservedJson",
"PreservedJsonProtocol",
+ "OsGymSandboxTemplateSpecBuilder",
+ "OsGymSandboxTemplateSpecBuilderProtocol",
+ "OsGymSandboxWarmPoolSpecBuilder",
+ "OsGymSandboxWarmPoolSpecBuilderProtocol",
+ "SandboxServiceBuilder",
+ "SandboxServiceBuilderProtocol",
+ "SandboxTemplateRefBuilder",
+ "SandboxTemplateRefBuilderProtocol",
+ "VmTemplateBuilder",
+ "VmTemplateBuilderProtocol",
]
diff --git a/libs/fleet/sdk-bindings/python/fleet_sdk/_sdk.py b/libs/fleet/sdk-bindings/python/fleet_sdk/_sdk.py
index 4fce16d3ef..48009c6f35 100644
--- a/libs/fleet/sdk-bindings/python/fleet_sdk/_sdk.py
+++ b/libs/fleet/sdk-bindings/python/fleet_sdk/_sdk.py
@@ -482,6 +482,24 @@ def _uniffi_check_contract_api_version(lib):
def _uniffi_check_api_checksums(lib):
if lib.uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token() != 1180:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_constructor_createpoolrequestbuilder_new() != 33658:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_build() != 60558:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_namespace() != 18934:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_spec() != 7566:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_constructor_createtemplaterequestbuilder_new() != 6787:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_build() != 46749:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_name() != 38970:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_namespace() != 38181:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
+ if lib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_spec() != 29902:
+ raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() != 54404:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_browser_with_access_token() != 55589:
@@ -819,6 +837,26 @@ _UniffiLib.uniffi_cyclops_sdk_fn_free_accesstokenprovider.argtypes = (
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_cyclops_sdk_fn_free_accesstokenprovider.restype = None
+_UniffiLib.uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder.restype = None
+_UniffiLib.uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder.restype = None
_UniffiLib.uniffi_cyclops_sdk_fn_clone_cyclopsclient.argtypes = (
ctypes.c_uint64,
ctypes.POINTER(_UniffiRustCallStatus),
@@ -893,6 +931,54 @@ _UniffiLib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token.arg
ctypes.c_int8,
)
_UniffiLib.uniffi_cyclops_sdk_fn_method_accesstokenprovider_get_access_token.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new.argtypes = (
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new.argtypes = (
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build.argtypes = (
+ ctypes.c_uint64,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build.restype = _UniffiRustBuffer
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace.restype = ctypes.c_uint64
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec.argtypes = (
+ ctypes.c_uint64,
+ _UniffiRustBuffer,
+ ctypes.POINTER(_UniffiRustCallStatus),
+)
+_UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec.restype = ctypes.c_uint64
_UniffiLib.uniffi_cyclops_sdk_fn_constructor_cyclopsclient_connect.argtypes = (
_UniffiRustBuffer,
ctypes.c_uint64,
@@ -1071,6 +1157,33 @@ _UniffiLib.ffi_cyclops_sdk_uniffi_contract_version.restype = ctypes.c_uint32
_UniffiLib.uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_createpoolrequestbuilder_new.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_createpoolrequestbuilder_new.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_build.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_build.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_namespace.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_namespace.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_spec.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_spec.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_createtemplaterequestbuilder_new.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_createtemplaterequestbuilder_new.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_build.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_build.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_name.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_name.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_namespace.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_namespace.restype = ctypes.c_uint16
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_spec.argtypes = (
+)
+_UniffiLib.uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_spec.restype = ctypes.c_uint16
_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect.argtypes = (
)
_UniffiLib.uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect.restype = ctypes.c_uint16
@@ -2629,6 +2742,64 @@ class _UniffiFfiConverterTypeHttpError(_UniffiConverterRustBuffer):
+# SdkBuildError
+# We want to define each variant as a nested class that's also a subclass,
+# which is tricky in Python. To accomplish this we're going to create each
+# class separately, then manually add the child classes to the base class's
+# __dict__. All of this happens in dummy class to avoid polluting the module
+# namespace.
+class SdkBuildError(Exception):
+ pass
+
+_UniffiTempSdkBuildError = SdkBuildError
+
+class SdkBuildError: # type: ignore
+
+ class MissingRequiredField(_UniffiTempSdkBuildError):
+
+ def __init__(self, record_type, field):
+ super().__init__(", ".join([
+ "record_type={!r}".format(record_type),
+ "field={!r}".format(field),
+ ]))
+ self.record_type = record_type
+ self.field = field
+
+ def __repr__(self):
+ return "SdkBuildError.MissingRequiredField({})".format(str(self))
+ _UniffiTempSdkBuildError.MissingRequiredField = MissingRequiredField # type: ignore
+
+SdkBuildError = _UniffiTempSdkBuildError # type: ignore
+del _UniffiTempSdkBuildError
+
+
+class _UniffiFfiConverterTypeSdkBuildError(_UniffiConverterRustBuffer):
+ @staticmethod
+ def read(buf):
+ variant = buf.read_i32()
+ if variant == 1:
+ return SdkBuildError.MissingRequiredField(
+ _UniffiFfiConverterString.read(buf),
+ _UniffiFfiConverterString.read(buf),
+ )
+ raise InternalError("Raw enum value doesn't match any cases")
+
+ @staticmethod
+ def check_lower(value):
+ if isinstance(value, SdkBuildError.MissingRequiredField):
+ _UniffiFfiConverterString.check_lower(value.record_type)
+ _UniffiFfiConverterString.check_lower(value.field)
+ return
+
+ @staticmethod
+ def write(value, buf):
+ if isinstance(value, SdkBuildError.MissingRequiredField):
+ buf.write_i32(1)
+ _UniffiFfiConverterString.write(value.record_type, buf)
+ _UniffiFfiConverterString.write(value.field, buf)
+
+
+
# SdkError
# We want to define each variant as a nested class that's also a subclass,
# which is tricky in Python. To accomplish this we're going to create each
@@ -3064,6 +3235,251 @@ class _UniffiFfiConverterTypeAccessTokenProvider:
def write(cls, value: AccessTokenProvider, buf: _UniffiRustBuffer):
buf.write_u64(cls.lower(value))
+
+class CreatePoolRequestBuilderProtocol(typing.Protocol):
+
+ def build(self, ) -> CreatePoolRequest:
+ raise NotImplementedError
+ def namespace(self, value: str) -> CreatePoolRequestBuilder:
+ raise NotImplementedError
+ def spec(self, value: fleet_sdk.OsGymSandboxWarmPoolSpec) -> CreatePoolRequestBuilder:
+ raise NotImplementedError
+
+class CreatePoolRequestBuilder(CreatePoolRequestBuilderProtocol):
+
+ _handle: ctypes.c_uint64
+ def __init__(self, ):
+ _uniffi_lowered_args = (
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreatePoolRequestBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new,
+ *_uniffi_lowered_args,
+ )
+ self._handle = _uniffi_ffi_result
+
+ def __del__(self):
+ # In case of partial initialization of instances.
+ handle = getattr(self, "_handle", None)
+ if handle is not None:
+ _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder, handle)
+
+ def _uniffi_clone_handle(self):
+ return _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder, self._handle)
+
+ # Used by alternative constructors or any methods which return this type.
+ @classmethod
+ def _uniffi_make_instance(cls, handle):
+ # Lightly yucky way to bypass the usual __init__ logic
+ # and just create a new instance with the required handle.
+ inst = cls.__new__(cls)
+ inst._handle = handle
+ return inst
+ def build(self, ) -> CreatePoolRequest:
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreatePoolRequest.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeSdkBuildError
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def namespace(self, value: str) -> CreatePoolRequestBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreatePoolRequestBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def spec(self, value: fleet_sdk.OsGymSandboxWarmPoolSpec) -> CreatePoolRequestBuilder:
+
+ fleet_sdk._UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ fleet_sdk._UniffiFfiConverterTypeOSGymSandboxWarmPoolSpec.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreatePoolRequestBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+
+
+
+
+
+class _UniffiFfiConverterTypeCreatePoolRequestBuilder:
+ @staticmethod
+ def lift(value: int) -> CreatePoolRequestBuilder:
+ return CreatePoolRequestBuilder._uniffi_make_instance(value)
+
+ @staticmethod
+ def check_lower(value: CreatePoolRequestBuilder):
+ if not isinstance(value, CreatePoolRequestBuilder):
+ raise TypeError("Expected CreatePoolRequestBuilder instance, {} found".format(type(value).__name__))
+
+ @staticmethod
+ def lower(value: CreatePoolRequestBuilder) -> ctypes.c_uint64:
+ return value._uniffi_clone_handle()
+
+ @classmethod
+ def read(cls, buf: _UniffiRustBuffer) -> CreatePoolRequestBuilder:
+ ptr = buf.read_u64()
+ if ptr == 0:
+ raise InternalError("Raw handle value was null")
+ return cls.lift(ptr)
+
+ @classmethod
+ def write(cls, value: CreatePoolRequestBuilder, buf: _UniffiRustBuffer):
+ buf.write_u64(cls.lower(value))
+
+
+class CreateTemplateRequestBuilderProtocol(typing.Protocol):
+
+ def build(self, ) -> CreateTemplateRequest:
+ raise NotImplementedError
+ def name(self, value: str) -> CreateTemplateRequestBuilder:
+ raise NotImplementedError
+ def namespace(self, value: str) -> CreateTemplateRequestBuilder:
+ raise NotImplementedError
+ def spec(self, value: fleet_sdk.OsGymSandboxTemplateSpec) -> CreateTemplateRequestBuilder:
+ raise NotImplementedError
+
+class CreateTemplateRequestBuilder(CreateTemplateRequestBuilderProtocol):
+
+ _handle: ctypes.c_uint64
+ def __init__(self, ):
+ _uniffi_lowered_args = (
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreateTemplateRequestBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new,
+ *_uniffi_lowered_args,
+ )
+ self._handle = _uniffi_ffi_result
+
+ def __del__(self):
+ # In case of partial initialization of instances.
+ handle = getattr(self, "_handle", None)
+ if handle is not None:
+ _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder, handle)
+
+ def _uniffi_clone_handle(self):
+ return _uniffi_rust_call(_UniffiLib.uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder, self._handle)
+
+ # Used by alternative constructors or any methods which return this type.
+ @classmethod
+ def _uniffi_make_instance(cls, handle):
+ # Lightly yucky way to bypass the usual __init__ logic
+ # and just create a new instance with the required handle.
+ inst = cls.__new__(cls)
+ inst._handle = handle
+ return inst
+ def build(self, ) -> CreateTemplateRequest:
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreateTemplateRequest.lift
+ _uniffi_error_converter = _UniffiFfiConverterTypeSdkBuildError
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def name(self, value: str) -> CreateTemplateRequestBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreateTemplateRequestBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def namespace(self, value: str) -> CreateTemplateRequestBuilder:
+
+ _UniffiFfiConverterString.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ _UniffiFfiConverterString.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreateTemplateRequestBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+ def spec(self, value: fleet_sdk.OsGymSandboxTemplateSpec) -> CreateTemplateRequestBuilder:
+
+ fleet_sdk._UniffiFfiConverterTypeOSGymSandboxTemplateSpec.check_lower(value)
+ _uniffi_lowered_args = (
+ self._uniffi_clone_handle(),
+ fleet_sdk._UniffiFfiConverterTypeOSGymSandboxTemplateSpec.lower(value),
+ )
+ _uniffi_lift_return = _UniffiFfiConverterTypeCreateTemplateRequestBuilder.lift
+ _uniffi_error_converter = None
+ _uniffi_ffi_result = _uniffi_rust_call_with_error(
+ _uniffi_error_converter,
+ _UniffiLib.uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec,
+ *_uniffi_lowered_args,
+ )
+ return _uniffi_lift_return(_uniffi_ffi_result)
+
+
+
+
+
+class _UniffiFfiConverterTypeCreateTemplateRequestBuilder:
+ @staticmethod
+ def lift(value: int) -> CreateTemplateRequestBuilder:
+ return CreateTemplateRequestBuilder._uniffi_make_instance(value)
+
+ @staticmethod
+ def check_lower(value: CreateTemplateRequestBuilder):
+ if not isinstance(value, CreateTemplateRequestBuilder):
+ raise TypeError("Expected CreateTemplateRequestBuilder instance, {} found".format(type(value).__name__))
+
+ @staticmethod
+ def lower(value: CreateTemplateRequestBuilder) -> ctypes.c_uint64:
+ return value._uniffi_clone_handle()
+
+ @classmethod
+ def read(cls, buf: _UniffiRustBuffer) -> CreateTemplateRequestBuilder:
+ ptr = buf.read_u64()
+ if ptr == 0:
+ raise InternalError("Raw handle value was null")
+ return cls.lift(ptr)
+
+ @classmethod
+ def write(cls, value: CreateTemplateRequestBuilder, buf: _UniffiRustBuffer):
+ buf.write_u64(cls.lower(value))
+
class _UniffiFfiConverterSequenceTypeClaim(_UniffiConverterRustBuffer):
@classmethod
def check_lower(cls, value):
@@ -3995,6 +4411,7 @@ __all__ = [
"InternalError",
"AccessTokenProviderError",
"HttpError",
+ "SdkBuildError",
"SdkError",
"ResourceMetadata",
"Claim",
@@ -4017,6 +4434,10 @@ __all__ = [
"CyclopsCredentialsProtocol",
"AccessTokenProviderImpl",
"AccessTokenProvider",
+ "CreatePoolRequestBuilder",
+ "CreatePoolRequestBuilderProtocol",
+ "CreateTemplateRequestBuilder",
+ "CreateTemplateRequestBuilderProtocol",
"CyclopsClient",
"CyclopsClientProtocol",
"HttpClientImpl",
diff --git a/libs/fleet/sdk-bindings/python/tests/test_builders.py b/libs/fleet/sdk-bindings/python/tests/test_builders.py
new file mode 100644
index 0000000000..f24e0c028b
--- /dev/null
+++ b/libs/fleet/sdk-bindings/python/tests/test_builders.py
@@ -0,0 +1,65 @@
+import unittest
+
+import fleet_sdk
+
+
+class GeneratedBuilderTest(unittest.TestCase):
+ def test_generated_builders_cover_fluent_nested_records_and_omission(self):
+ service = fleet_sdk.SandboxServiceBuilder().name("mcp").target_port(3000).build()
+ vm = (
+ fleet_sdk.VmTemplateBuilder()
+ .container_disk_image("registry.example/vm:latest")
+ .image_pull_secret("registry-secret")
+ .cpu_cores(4)
+ .memory("8Gi")
+ .services([service])
+ .build()
+ )
+ template_spec = fleet_sdk.OsGymSandboxTemplateSpecBuilder().vm_template(vm).build()
+ request = (
+ fleet_sdk.CreateTemplateRequestBuilder()
+ .namespace("default")
+ .name("desktop")
+ .spec(template_spec)
+ .build()
+ )
+
+ self.assertIs(type(service), fleet_sdk.SandboxService)
+ self.assertIs(type(vm), fleet_sdk.VmTemplate)
+ self.assertIs(type(template_spec), fleet_sdk.OsGymSandboxTemplateSpec)
+ self.assertIs(type(request), fleet_sdk.CreateTemplateRequest)
+ self.assertIsNone(service.protocol)
+ self.assertIsNone(vm.command)
+ self.assertEqual(vm.image_pull_secret, "registry-secret")
+ self.assertEqual(vm.cpu_cores, 4)
+ self.assertEqual(vm.memory, "8Gi")
+
+ def test_builder_setters_preserve_prior_versions(self):
+ base = fleet_sdk.VmTemplateBuilder()
+ first = base.container_disk_image("registry.example/first:latest")
+ second = base.container_disk_image("registry.example/second:latest")
+
+ with self.assertRaises(fleet_sdk.SchemaBuildError.MissingRequiredField):
+ base.build()
+ self.assertEqual(first.build().container_disk_image, "registry.example/first:latest")
+ self.assertEqual(second.build().container_disk_image, "registry.example/second:latest")
+
+ def test_generated_builders_return_stable_required_field_errors(self):
+ with self.assertRaises(fleet_sdk.SchemaBuildError.MissingRequiredField) as error:
+ fleet_sdk.VmTemplateBuilder().build()
+ self.assertEqual(error.exception.record_type, "VmTemplate")
+ self.assertEqual(error.exception.field, "container_disk_image")
+
+ with self.assertRaises(fleet_sdk.SdkBuildError.MissingRequiredField) as error:
+ fleet_sdk.CreatePoolRequestBuilder().build()
+ self.assertEqual(error.exception.record_type, "CreatePoolRequest")
+ self.assertEqual(error.exception.field, "namespace")
+
+ def test_legacy_record_constructor_remains_available(self):
+ reference = fleet_sdk.SandboxTemplateRef(name="legacy")
+ self.assertIs(type(reference), fleet_sdk.SandboxTemplateRef)
+ self.assertEqual(reference.name, "legacy")
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/libs/fleet/sdk-bindings/ruby/cyclops_sdk.rb b/libs/fleet/sdk-bindings/ruby/cyclops_sdk.rb
index 6f318f324c..57e59be796 100644
--- a/libs/fleet/sdk-bindings/ruby/cyclops_sdk.rb
+++ b/libs/fleet/sdk-bindings/ruby/cyclops_sdk.rb
@@ -5,6 +5,10 @@ module FleetSdk
CyclopsSdkSchema.constants(false).each do |name|
const_set(name, CyclopsSdkSchema.const_get(name)) unless const_defined?(name, false)
end
+ SCHEMA_ALLOC_METHODS = %i[
+ alloc_from_TypeOSGymSandboxTemplateSpec
+ alloc_from_TypeOSGymSandboxWarmPoolSpec
+ ].freeze
SCHEMA_CHECK_LOWER_METHODS = %i[
check_lower_TypeClaimSpec
check_lower_TypeOSGymSandboxClaimStatus
@@ -30,6 +34,20 @@ module FleetSdk
schema_rust_buffer = CyclopsSdkSchema::RustBuffer
schema_stream = CyclopsSdkSchema.const_get(:RustBufferStream, false)
+ SCHEMA_ALLOC_METHODS.each do |method_name|
+ RustBuffer.define_singleton_method(method_name) do |value|
+ buffer = schema_rust_buffer.public_send(method_name, value)
+ begin
+ RustBuffer.allocWithBuilder do |builder|
+ builder.write(buffer.data.read_bytes(buffer.len))
+ builder.finalize
+ end
+ ensure
+ buffer.free
+ end
+ end
+ end
+
SCHEMA_CHECK_LOWER_METHODS.each do |method_name|
RustBuffer.define_singleton_method(method_name) do |value|
schema_rust_buffer.public_send(method_name.to_s.gsub("OsGym", "OSGym"), value)
@@ -58,5 +76,6 @@ module FleetSdk
end
end
- private_constant :SCHEMA_CHECK_LOWER_METHODS, :SCHEMA_READ_METHODS, :SCHEMA_WRITE_METHODS
+ private_constant :SCHEMA_ALLOC_METHODS, :SCHEMA_CHECK_LOWER_METHODS,
+ :SCHEMA_READ_METHODS, :SCHEMA_WRITE_METHODS
end
diff --git a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb
index a5d5e6144f..23aa9526f3 100644
--- a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb
+++ b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/schema.rb
@@ -499,6 +499,8 @@ end
end
+
+
# The Enum type ServiceProtocol.
def self.check_lower_TypeServiceProtocol(v)
@@ -1050,6 +1052,20 @@ class RustBufferStream
read(size).force_encoding(Encoding::UTF_8)
end
+ # The Object type OSGymSandboxTemplateSpecBuilder.
+
+ def readTypeOSGymSandboxTemplateSpecBuilder
+ handle = unpack_from 8, 'Q>'
+ return OSGymSandboxTemplateSpecBuilder.uniffi_allocate(handle)
+ end
+
+ # The Object type OSGymSandboxWarmPoolSpecBuilder.
+
+ def readTypeOSGymSandboxWarmPoolSpecBuilder
+ handle = unpack_from 8, 'Q>'
+ return OSGymSandboxWarmPoolSpecBuilder.uniffi_allocate(handle)
+ end
+
# The Object type PreservedJson.
def readTypePreservedJson
@@ -1057,6 +1073,27 @@ class RustBufferStream
return PreservedJson.uniffi_allocate(handle)
end
+ # The Object type SandboxServiceBuilder.
+
+ def readTypeSandboxServiceBuilder
+ handle = unpack_from 8, 'Q>'
+ return SandboxServiceBuilder.uniffi_allocate(handle)
+ end
+
+ # The Object type SandboxTemplateRefBuilder.
+
+ def readTypeSandboxTemplateRefBuilder
+ handle = unpack_from 8, 'Q>'
+ return SandboxTemplateRefBuilder.uniffi_allocate(handle)
+ end
+
+ # The Object type VmTemplateBuilder.
+
+ def readTypeVmTemplateBuilder
+ handle = unpack_from 8, 'Q>'
+ return VmTemplateBuilder.uniffi_allocate(handle)
+ end
+
# The Record type ClaimLifecycle.
def readTypeClaimLifecycle
@@ -1305,6 +1342,26 @@ class RustBufferStream
+
+
+ # The Error type SchemaBuildError
+
+ def readTypeSchemaBuildError
+ variant = unpack_from 4, 'l>'
+
+ if variant == 1
+ return SchemaBuildError::MissingRequiredField.new(
+ readString(),
+ readString()
+ )
+ end
+
+ raise InternalError, 'Unexpected variant tag for TypeSchemaBuildError'
+ end
+
+
+
+
# The Enum type ServiceProtocol.
def readTypeServiceProtocol
@@ -1703,6 +1760,20 @@ class RustBufferBuilder
write v
end
+ # The Object type OSGymSandboxTemplateSpecBuilder.
+
+ def write_TypeOSGymSandboxTemplateSpecBuilder(obj)
+ handle = OSGymSandboxTemplateSpecBuilder.uniffi_lower obj
+ pack_into(8, 'Q>', handle)
+ end
+
+ # The Object type OSGymSandboxWarmPoolSpecBuilder.
+
+ def write_TypeOSGymSandboxWarmPoolSpecBuilder(obj)
+ handle = OSGymSandboxWarmPoolSpecBuilder.uniffi_lower obj
+ pack_into(8, 'Q>', handle)
+ end
+
# The Object type PreservedJson.
def write_TypePreservedJson(obj)
@@ -1710,6 +1781,27 @@ class RustBufferBuilder
pack_into(8, 'Q>', handle)
end
+ # The Object type SandboxServiceBuilder.
+
+ def write_TypeSandboxServiceBuilder(obj)
+ handle = SandboxServiceBuilder.uniffi_lower obj
+ pack_into(8, 'Q>', handle)
+ end
+
+ # The Object type SandboxTemplateRefBuilder.
+
+ def write_TypeSandboxTemplateRefBuilder(obj)
+ handle = SandboxTemplateRefBuilder.uniffi_lower obj
+ pack_into(8, 'Q>', handle)
+ end
+
+ # The Object type VmTemplateBuilder.
+
+ def write_TypeVmTemplateBuilder(obj)
+ handle = VmTemplateBuilder.uniffi_lower obj
+ pack_into(8, 'Q>', handle)
+ end
+
# The Record type ClaimLifecycle.
def write_TypeClaimLifecycle(v)
@@ -1867,6 +1959,8 @@ class RustBufferBuilder
end
+
+
# The Enum type ServiceProtocol.
def write_TypeServiceProtocol(v)
@@ -2157,6 +2251,26 @@ CALL_ERROR = 1
CALL_PANIC = 2
+module SchemaBuildError
+ class MissingRequiredField < StandardError
+ def initialize(record_type, field)
+ @record_type = record_type
+ @field = field
+ super()
+ end
+
+ attr_reader :record_type, :field
+
+
+ def to_s
+ "#{self.class.name}(record_type=#{@record_type.inspect}, field=#{@field.inspect})"
+ end
+ end
+
+end
+
+
+
@@ -2182,6 +2296,9 @@ end
# Map error modules to the RustBuffer method name that reads them
ERROR_MODULE_TO_READER_METHOD = {
+ SchemaBuildError => :readTypeSchemaBuildError,
+
+
@@ -2257,6 +2374,96 @@ module UniFFILib
ffi_lib 'cyclops_sdk'
+ attach_function :uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :void
+ attach_function :uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new,
+ [RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build,
+ [:uint64, RustCallStatus.by_ref],
+ RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port,
+ [:uint64, :uint16, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :void
+ attach_function :uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build,
+ [:uint64, RustCallStatus.by_ref],
+ RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :void
+ attach_function :uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new,
+ [RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build,
+ [:uint64, RustCallStatus.by_ref],
+ RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores,
+ [:uint64, :uint32, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes,
+ [:uint64, :uint64, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
attach_function :uniffi_cyclops_sdk_schema_fn_clone_preservedjson,
[:uint64, RustCallStatus.by_ref],
:uint64
@@ -2269,6 +2476,42 @@ module UniFFILib
attach_function :uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json,
[:uint64, RustCallStatus.by_ref],
RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :void
+ attach_function :uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build,
+ [:uint64, RustCallStatus.by_ref],
+ RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :void
+ attach_function :uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build,
+ [:uint64, RustCallStatus.by_ref],
+ RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas,
+ [:uint64, :uint32, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
attach_function :ffi_cyclops_sdk_schema_rustbuffer_alloc,
[:uint64, RustCallStatus.by_ref],
RustBuffer.by_value
@@ -2281,12 +2524,108 @@ module UniFFILib
attach_function :ffi_cyclops_sdk_schema_rustbuffer_reserve,
[RustBuffer.by_value, :uint64, RustCallStatus.by_ref],
RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_build,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_name,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_protocol,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_target_port,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_build,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_name,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_build,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_command,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_container_disk_image,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_cpu_cores,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_firmware,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_policy,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_secret,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_memory,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_node_selector,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_oidc,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_probes,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime_class_name,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_services,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_tolerations,
+ [RustCallStatus.by_ref],
+ :uint16
attach_function :uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json,
[RustCallStatus.by_ref],
:uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_build,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_constructor_sandboxservicebuilder_new,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_constructor_sandboxtemplaterefbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_constructor_vmtemplatebuilder_new,
+ [RustCallStatus.by_ref],
+ :uint16
attach_function :uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json,
[RustCallStatus.by_ref],
:uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxtemplatespecbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint16
attach_function :ffi_cyclops_sdk_schema_uniffi_contract_version,
[RustCallStatus.by_ref],
:uint32
@@ -2299,6 +2638,7 @@ end
+
class Firmware
BIOS = 1
EFI = 2
@@ -2778,6 +3118,285 @@ end
+ class SandboxServiceBuilder
+
+ # A private helper for initializing instances of the class from a raw handle,
+ # bypassing any initialization logic and ensuring they are GC'd properly.
+ def self.uniffi_allocate(handle)
+ inst = allocate
+ inst.instance_variable_set :@handle, handle
+ ObjectSpace.define_finalizer(inst, uniffi_define_finalizer_by_handle(handle, inst.object_id))
+ return inst
+ end
+
+ # A private helper for registering an object finalizer.
+ # N.B. it's important that this does not capture a reference
+ # to the actual instance, only its underlying handle.
+ def self.uniffi_define_finalizer_by_handle(handle, object_id)
+ Proc.new do |_id|
+ CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder,
+ handle
+ )
+ end
+ end
+
+ # A private helper for lowering instances into a raw handle.
+ # This does an explicit typecheck, because accidentally lowering a different type of
+ # object in a place where this type is expected, could lead to memory unsafety.
+ def self.uniffi_check_lower(inst)
+ if not inst.is_a? self
+ raise TypeError.new "Expected a SandboxServiceBuilder instance, got #{inst}"
+ end
+ end
+
+ def uniffi_clone_handle()
+ return CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder,
+ @handle
+ )
+ end
+
+ def self.uniffi_lower(inst)
+ return inst.uniffi_clone_handle()
+ end
+ def initialize()
+ handle = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new,)
+ @handle = handle
+ ObjectSpace.define_finalizer(self, self.class.uniffi_define_finalizer_by_handle(handle, self.object_id))
+ end
+
+
+
+ def build()
+ result = CyclopsSdkSchema.rust_call_with_error(SchemaBuildError,:uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build,uniffi_clone_handle(),)
+ return result.consumeIntoTypeSandboxService
+ end
+ def name(value)
+ value = CyclopsSdkSchema::uniffi_utf8(value)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return SandboxServiceBuilder.uniffi_allocate(result)
+ end
+ def protocol(value)
+ value = value
+ RustBuffer.check_lower_TypeServiceProtocol(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol,uniffi_clone_handle(),RustBuffer.alloc_from_TypeServiceProtocol(value))
+ return SandboxServiceBuilder.uniffi_allocate(result)
+ end
+ def target_port(value)
+ value = CyclopsSdkSchema::uniffi_in_range(value, "u16", 0, 2**16)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port,uniffi_clone_handle(),value)
+ return SandboxServiceBuilder.uniffi_allocate(result)
+ end
+
+end
+
+ class SandboxTemplateRefBuilder
+
+ # A private helper for initializing instances of the class from a raw handle,
+ # bypassing any initialization logic and ensuring they are GC'd properly.
+ def self.uniffi_allocate(handle)
+ inst = allocate
+ inst.instance_variable_set :@handle, handle
+ ObjectSpace.define_finalizer(inst, uniffi_define_finalizer_by_handle(handle, inst.object_id))
+ return inst
+ end
+
+ # A private helper for registering an object finalizer.
+ # N.B. it's important that this does not capture a reference
+ # to the actual instance, only its underlying handle.
+ def self.uniffi_define_finalizer_by_handle(handle, object_id)
+ Proc.new do |_id|
+ CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder,
+ handle
+ )
+ end
+ end
+
+ # A private helper for lowering instances into a raw handle.
+ # This does an explicit typecheck, because accidentally lowering a different type of
+ # object in a place where this type is expected, could lead to memory unsafety.
+ def self.uniffi_check_lower(inst)
+ if not inst.is_a? self
+ raise TypeError.new "Expected a SandboxTemplateRefBuilder instance, got #{inst}"
+ end
+ end
+
+ def uniffi_clone_handle()
+ return CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder,
+ @handle
+ )
+ end
+
+ def self.uniffi_lower(inst)
+ return inst.uniffi_clone_handle()
+ end
+ def initialize()
+ handle = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new,)
+ @handle = handle
+ ObjectSpace.define_finalizer(self, self.class.uniffi_define_finalizer_by_handle(handle, self.object_id))
+ end
+
+
+
+ def build()
+ result = CyclopsSdkSchema.rust_call_with_error(SchemaBuildError,:uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build,uniffi_clone_handle(),)
+ return result.consumeIntoTypeSandboxTemplateRef
+ end
+ def name(value)
+ value = CyclopsSdkSchema::uniffi_utf8(value)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return SandboxTemplateRefBuilder.uniffi_allocate(result)
+ end
+
+end
+
+ class VmTemplateBuilder
+
+ # A private helper for initializing instances of the class from a raw handle,
+ # bypassing any initialization logic and ensuring they are GC'd properly.
+ def self.uniffi_allocate(handle)
+ inst = allocate
+ inst.instance_variable_set :@handle, handle
+ ObjectSpace.define_finalizer(inst, uniffi_define_finalizer_by_handle(handle, inst.object_id))
+ return inst
+ end
+
+ # A private helper for registering an object finalizer.
+ # N.B. it's important that this does not capture a reference
+ # to the actual instance, only its underlying handle.
+ def self.uniffi_define_finalizer_by_handle(handle, object_id)
+ Proc.new do |_id|
+ CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder,
+ handle
+ )
+ end
+ end
+
+ # A private helper for lowering instances into a raw handle.
+ # This does an explicit typecheck, because accidentally lowering a different type of
+ # object in a place where this type is expected, could lead to memory unsafety.
+ def self.uniffi_check_lower(inst)
+ if not inst.is_a? self
+ raise TypeError.new "Expected a VmTemplateBuilder instance, got #{inst}"
+ end
+ end
+
+ def uniffi_clone_handle()
+ return CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder,
+ @handle
+ )
+ end
+
+ def self.uniffi_lower(inst)
+ return inst.uniffi_clone_handle()
+ end
+ def initialize()
+ handle = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new,)
+ @handle = handle
+ ObjectSpace.define_finalizer(self, self.class.uniffi_define_finalizer_by_handle(handle, self.object_id))
+ end
+
+
+
+ def build()
+ result = CyclopsSdkSchema.rust_call_with_error(SchemaBuildError,:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build,uniffi_clone_handle(),)
+ return result.consumeIntoTypeVmTemplate
+ end
+ def command(value)
+ value = value.map { |v| CyclopsSdkSchema::uniffi_utf8(v) }
+ RustBuffer.check_lower_Sequencestring(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command,uniffi_clone_handle(),RustBuffer.alloc_from_Sequencestring(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def container_disk_image(value)
+ value = CyclopsSdkSchema::uniffi_utf8(value)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def cpu_cores(value)
+ value = CyclopsSdkSchema::uniffi_in_range(value, "u32", 0, 2**32)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores,uniffi_clone_handle(),value)
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def firmware(value)
+ value = value
+ RustBuffer.check_lower_TypeFirmware(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware,uniffi_clone_handle(),RustBuffer.alloc_from_TypeFirmware(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def image_pull_policy(value)
+ value = value
+ RustBuffer.check_lower_TypeImagePullPolicy(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy,uniffi_clone_handle(),RustBuffer.alloc_from_TypeImagePullPolicy(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def image_pull_secret(value)
+ value = CyclopsSdkSchema::uniffi_utf8(value)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def memory(value)
+ value = CyclopsSdkSchema::uniffi_utf8(value)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def node_selector(value)
+ value = value.each.with_object({}) { |(k, v), res| res[CyclopsSdkSchema::uniffi_utf8(k)] = CyclopsSdkSchema::uniffi_utf8(v) }
+ RustBuffer.check_lower_MapStringString(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector,uniffi_clone_handle(),RustBuffer.alloc_from_MapStringString(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def oidc(value)
+ value = value
+ RustBuffer.check_lower_TypeOidcConfig(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc,uniffi_clone_handle(),RustBuffer.alloc_from_TypeOidcConfig(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def probes(value)
+ value = value
+ (PreservedJson.uniffi_check_lower value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes,uniffi_clone_handle(),(PreservedJson.uniffi_lower value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def runtime(value)
+ value = value
+ RustBuffer.check_lower_TypeRuntimeKind(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime,uniffi_clone_handle(),RustBuffer.alloc_from_TypeRuntimeKind(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def runtime_class_name(value)
+ value = CyclopsSdkSchema::uniffi_utf8(value)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def services(value)
+ value = value
+ RustBuffer.check_lower_SequenceTypeSandboxService(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services,uniffi_clone_handle(),RustBuffer.alloc_from_SequenceTypeSandboxService(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+ def tolerations(value)
+ value = value
+ RustBuffer.check_lower_SequenceTypePreservedJson(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations,uniffi_clone_handle(),RustBuffer.alloc_from_SequenceTypePreservedJson(value))
+ return VmTemplateBuilder.uniffi_allocate(result)
+ end
+
+end
+
class PreservedJson
# A private helper for initializing instances of the class from a raw handle,
@@ -2836,6 +3455,144 @@ end
return result.consumeIntoString
end
+end
+
+ class OSGymSandboxTemplateSpecBuilder
+
+ # A private helper for initializing instances of the class from a raw handle,
+ # bypassing any initialization logic and ensuring they are GC'd properly.
+ def self.uniffi_allocate(handle)
+ inst = allocate
+ inst.instance_variable_set :@handle, handle
+ ObjectSpace.define_finalizer(inst, uniffi_define_finalizer_by_handle(handle, inst.object_id))
+ return inst
+ end
+
+ # A private helper for registering an object finalizer.
+ # N.B. it's important that this does not capture a reference
+ # to the actual instance, only its underlying handle.
+ def self.uniffi_define_finalizer_by_handle(handle, object_id)
+ Proc.new do |_id|
+ CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder,
+ handle
+ )
+ end
+ end
+
+ # A private helper for lowering instances into a raw handle.
+ # This does an explicit typecheck, because accidentally lowering a different type of
+ # object in a place where this type is expected, could lead to memory unsafety.
+ def self.uniffi_check_lower(inst)
+ if not inst.is_a? self
+ raise TypeError.new "Expected a OSGymSandboxTemplateSpecBuilder instance, got #{inst}"
+ end
+ end
+
+ def uniffi_clone_handle()
+ return CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder,
+ @handle
+ )
+ end
+
+ def self.uniffi_lower(inst)
+ return inst.uniffi_clone_handle()
+ end
+ def initialize()
+ handle = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new,)
+ @handle = handle
+ ObjectSpace.define_finalizer(self, self.class.uniffi_define_finalizer_by_handle(handle, self.object_id))
+ end
+
+
+
+ def build()
+ result = CyclopsSdkSchema.rust_call_with_error(SchemaBuildError,:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build,uniffi_clone_handle(),)
+ return result.consumeIntoTypeOSGymSandboxTemplateSpec
+ end
+ def vm_template(value)
+ value = value
+ RustBuffer.check_lower_TypeVmTemplate(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template,uniffi_clone_handle(),RustBuffer.alloc_from_TypeVmTemplate(value))
+ return OSGymSandboxTemplateSpecBuilder.uniffi_allocate(result)
+ end
+
+end
+
+ class OSGymSandboxWarmPoolSpecBuilder
+
+ # A private helper for initializing instances of the class from a raw handle,
+ # bypassing any initialization logic and ensuring they are GC'd properly.
+ def self.uniffi_allocate(handle)
+ inst = allocate
+ inst.instance_variable_set :@handle, handle
+ ObjectSpace.define_finalizer(inst, uniffi_define_finalizer_by_handle(handle, inst.object_id))
+ return inst
+ end
+
+ # A private helper for registering an object finalizer.
+ # N.B. it's important that this does not capture a reference
+ # to the actual instance, only its underlying handle.
+ def self.uniffi_define_finalizer_by_handle(handle, object_id)
+ Proc.new do |_id|
+ CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder,
+ handle
+ )
+ end
+ end
+
+ # A private helper for lowering instances into a raw handle.
+ # This does an explicit typecheck, because accidentally lowering a different type of
+ # object in a place where this type is expected, could lead to memory unsafety.
+ def self.uniffi_check_lower(inst)
+ if not inst.is_a? self
+ raise TypeError.new "Expected a OSGymSandboxWarmPoolSpecBuilder instance, got #{inst}"
+ end
+ end
+
+ def uniffi_clone_handle()
+ return CyclopsSdkSchema.rust_call(
+ :uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder,
+ @handle
+ )
+ end
+
+ def self.uniffi_lower(inst)
+ return inst.uniffi_clone_handle()
+ end
+ def initialize()
+ handle = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new,)
+ @handle = handle
+ ObjectSpace.define_finalizer(self, self.class.uniffi_define_finalizer_by_handle(handle, self.object_id))
+ end
+
+
+
+ def autoscaling(value)
+ value = value
+ RustBuffer.check_lower_TypeWarmPoolAutoscaling(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling,uniffi_clone_handle(),RustBuffer.alloc_from_TypeWarmPoolAutoscaling(value))
+ return OSGymSandboxWarmPoolSpecBuilder.uniffi_allocate(result)
+ end
+ def build()
+ result = CyclopsSdkSchema.rust_call_with_error(SchemaBuildError,:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build,uniffi_clone_handle(),)
+ return result.consumeIntoTypeOSGymSandboxWarmPoolSpec
+ end
+ def replicas(value)
+ value = CyclopsSdkSchema::uniffi_in_range(value, "u32", 0, 2**32)
+
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas,uniffi_clone_handle(),value)
+ return OSGymSandboxWarmPoolSpecBuilder.uniffi_allocate(result)
+ end
+ def sandbox_template_ref(value)
+ value = value
+ RustBuffer.check_lower_TypeSandboxTemplateRef(value)
+ result = CyclopsSdkSchema.rust_call(:uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref,uniffi_clone_handle(),RustBuffer.alloc_from_TypeSandboxTemplateRef(value))
+ return OSGymSandboxWarmPoolSpecBuilder.uniffi_allocate(result)
+ end
+
end
end
diff --git a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb
index 21672db397..0ed5920ffc 100644
--- a/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb
+++ b/libs/fleet/sdk-bindings/ruby/cyclops_sdk/sdk.rb
@@ -547,6 +547,8 @@ private_constant :UniffiHandleMap
+
+
# The Optional<T> type for string.
def self.check_lower_Optionalstring(v)
@@ -930,6 +932,20 @@ class RustBufferStream
return AccessTokenProvider.uniffi_allocate(handle)
end
+ # The Object type CreatePoolRequestBuilder.
+
+ def readTypeCreatePoolRequestBuilder
+ handle = unpack_from 8, 'Q>'
+ return CreatePoolRequestBuilder.uniffi_allocate(handle)
+ end
+
+ # The Object type CreateTemplateRequestBuilder.
+
+ def readTypeCreateTemplateRequestBuilder
+ handle = unpack_from 8, 'Q>'
+ return CreateTemplateRequestBuilder.uniffi_allocate(handle)
+ end
+
# The Object type CyclopsClient.
def readTypeCyclopsClient
@@ -1178,6 +1194,26 @@ class RustBufferStream
+ # The Error type SdkBuildError
+
+ def readTypeSdkBuildError
+ variant = unpack_from 4, 'l>'
+
+ if variant == 1
+ return SdkBuildError::MissingRequiredField.new(
+ readString(),
+ readString()
+ )
+ end
+
+ raise InternalError, 'Unexpected variant tag for TypeSdkBuildError'
+ end
+
+
+
+
+
+
# The Error type SdkError
def readTypeSdkError
@@ -1535,6 +1571,20 @@ class RustBufferBuilder
pack_into(8, 'Q>', handle)
end
+ # The Object type CreatePoolRequestBuilder.
+
+ def write_TypeCreatePoolRequestBuilder(obj)
+ handle = CreatePoolRequestBuilder.uniffi_lower obj
+ pack_into(8, 'Q>', handle)
+ end
+
+ # The Object type CreateTemplateRequestBuilder.
+
+ def write_TypeCreateTemplateRequestBuilder(obj)
+ handle = CreateTemplateRequestBuilder.uniffi_lower obj
+ pack_into(8, 'Q>', handle)
+ end
+
# The Object type CyclopsClient.
def write_TypeCyclopsClient(obj)
@@ -1713,6 +1763,8 @@ class RustBufferBuilder
+
+
# The Optional<T> type for string.
def write_Optionalstring(v)
@@ -1943,6 +1995,26 @@ end
+module SdkBuildError
+ class MissingRequiredField < StandardError
+ def initialize(record_type, field)
+ @record_type = record_type
+ @field = field
+ super()
+ end
+
+ attr_reader :record_type, :field
+
+
+ def to_s
+ "#{self.class.name}(record_type=#{@record_type.inspect}, field=#{@field.inspect})"
+ end
+ end
+
+end
+
+
+
module SdkError
class Configuration < StandardError
def initialize(reason)
@@ -2089,6 +2161,9 @@ ERROR_MODULE_TO_READER_METHOD = {
HttpError => :readTypeHttpError,
+ SdkBuildError => :readTypeSdkBuildError,
+
+
SdkError => :readTypeSdkError,
}
@@ -2447,6 +2522,45 @@ module UniFFILib
attach_function :uniffi_cyclops_sdk_fn_method_httpclient_execute,
[:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
:uint64
+ attach_function :uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :void
+ attach_function :uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build,
+ [:uint64, RustCallStatus.by_ref],
+ RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder,
+ [:uint64, RustCallStatus.by_ref],
+ :void
+ attach_function :uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build,
+ [:uint64, RustCallStatus.by_ref],
+ RustBuffer.by_value
+ attach_function :uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
+ attach_function :uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec,
+ [:uint64, RustBuffer.by_value, RustCallStatus.by_ref],
+ :uint64
attach_function :uniffi_cyclops_sdk_fn_clone_cyclopscredentials,
[:uint64, RustCallStatus.by_ref],
:uint64
@@ -2543,6 +2657,27 @@ module UniFFILib
attach_function :uniffi_cyclops_sdk_checksum_method_httpclient_execute,
[RustCallStatus.by_ref],
:uint16
+ attach_function :uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_build,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_namespace,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_spec,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_build,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_name,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_namespace,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_spec,
+ [RustCallStatus.by_ref],
+ :uint16
attach_function :uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect,
[RustCallStatus.by_ref],
:uint16
@@ -2564,6 +2699,12 @@ module UniFFILib
attach_function :uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_native_http_client,
[RustCallStatus.by_ref],
:uint16
+ attach_function :uniffi_cyclops_sdk_checksum_constructor_createpoolrequestbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint16
+ attach_function :uniffi_cyclops_sdk_checksum_constructor_createtemplaterequestbuilder_new,
+ [RustCallStatus.by_ref],
+ :uint16
attach_function :uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new,
[RustCallStatus.by_ref],
:uint16
@@ -2579,6 +2720,7 @@ end
+
# Record type Claim
class Claim
attr_reader :api_version, :kind, :metadata, :spec, :status
@@ -3544,6 +3686,150 @@ end
return result.consumeIntoTypeHttpResponse
end
+end
+
+ class CreatePoolRequestBuilder
+
+ # A private helper for initializing instances of the class from a raw handle,
+ # bypassing any initialization logic and ensuring they are GC'd properly.
+ def self.uniffi_allocate(handle)
+ inst = allocate
+ inst.instance_variable_set :@handle, handle
+ ObjectSpace.define_finalizer(inst, uniffi_define_finalizer_by_handle(handle, inst.object_id))
+ return inst
+ end
+
+ # A private helper for registering an object finalizer.
+ # N.B. it's important that this does not capture a reference
+ # to the actual instance, only its underlying handle.
+ def self.uniffi_define_finalizer_by_handle(handle, object_id)
+ Proc.new do |_id|
+ FleetSdk.rust_call(
+ :uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder,
+ handle
+ )
+ end
+ end
+
+ # A private helper for lowering instances into a raw handle.
+ # This does an explicit typecheck, because accidentally lowering a different type of
+ # object in a place where this type is expected, could lead to memory unsafety.
+ def self.uniffi_check_lower(inst)
+ if not inst.is_a? self
+ raise TypeError.new "Expected a CreatePoolRequestBuilder instance, got #{inst}"
+ end
+ end
+
+ def uniffi_clone_handle()
+ return FleetSdk.rust_call(
+ :uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder,
+ @handle
+ )
+ end
+
+ def self.uniffi_lower(inst)
+ return inst.uniffi_clone_handle()
+ end
+ def initialize()
+ handle = FleetSdk.rust_call(:uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new,)
+ @handle = handle
+ ObjectSpace.define_finalizer(self, self.class.uniffi_define_finalizer_by_handle(handle, self.object_id))
+ end
+
+
+
+ def build()
+ result = FleetSdk.rust_call_with_error(SdkBuildError,:uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build,uniffi_clone_handle(),)
+ return result.consumeIntoTypeCreatePoolRequest
+ end
+ def namespace(value)
+ value = FleetSdk::uniffi_utf8(value)
+
+ result = FleetSdk.rust_call(:uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return CreatePoolRequestBuilder.uniffi_allocate(result)
+ end
+ def spec(value)
+ value = value
+ RustBuffer.check_lower_TypeOSGymSandboxWarmPoolSpec(value)
+ result = FleetSdk.rust_call(:uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec,uniffi_clone_handle(),RustBuffer.alloc_from_TypeOSGymSandboxWarmPoolSpec(value))
+ return CreatePoolRequestBuilder.uniffi_allocate(result)
+ end
+
+end
+
+ class CreateTemplateRequestBuilder
+
+ # A private helper for initializing instances of the class from a raw handle,
+ # bypassing any initialization logic and ensuring they are GC'd properly.
+ def self.uniffi_allocate(handle)
+ inst = allocate
+ inst.instance_variable_set :@handle, handle
+ ObjectSpace.define_finalizer(inst, uniffi_define_finalizer_by_handle(handle, inst.object_id))
+ return inst
+ end
+
+ # A private helper for registering an object finalizer.
+ # N.B. it's important that this does not capture a reference
+ # to the actual instance, only its underlying handle.
+ def self.uniffi_define_finalizer_by_handle(handle, object_id)
+ Proc.new do |_id|
+ FleetSdk.rust_call(
+ :uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder,
+ handle
+ )
+ end
+ end
+
+ # A private helper for lowering instances into a raw handle.
+ # This does an explicit typecheck, because accidentally lowering a different type of
+ # object in a place where this type is expected, could lead to memory unsafety.
+ def self.uniffi_check_lower(inst)
+ if not inst.is_a? self
+ raise TypeError.new "Expected a CreateTemplateRequestBuilder instance, got #{inst}"
+ end
+ end
+
+ def uniffi_clone_handle()
+ return FleetSdk.rust_call(
+ :uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder,
+ @handle
+ )
+ end
+
+ def self.uniffi_lower(inst)
+ return inst.uniffi_clone_handle()
+ end
+ def initialize()
+ handle = FleetSdk.rust_call(:uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new,)
+ @handle = handle
+ ObjectSpace.define_finalizer(self, self.class.uniffi_define_finalizer_by_handle(handle, self.object_id))
+ end
+
+
+
+ def build()
+ result = FleetSdk.rust_call_with_error(SdkBuildError,:uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build,uniffi_clone_handle(),)
+ return result.consumeIntoTypeCreateTemplateRequest
+ end
+ def name(value)
+ value = FleetSdk::uniffi_utf8(value)
+
+ result = FleetSdk.rust_call(:uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return CreateTemplateRequestBuilder.uniffi_allocate(result)
+ end
+ def namespace(value)
+ value = FleetSdk::uniffi_utf8(value)
+
+ result = FleetSdk.rust_call(:uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace,uniffi_clone_handle(),RustBuffer.allocFromString(value))
+ return CreateTemplateRequestBuilder.uniffi_allocate(result)
+ end
+ def spec(value)
+ value = value
+ RustBuffer.check_lower_TypeOSGymSandboxTemplateSpec(value)
+ result = FleetSdk.rust_call(:uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec,uniffi_clone_handle(),RustBuffer.alloc_from_TypeOSGymSandboxTemplateSpec(value))
+ return CreateTemplateRequestBuilder.uniffi_allocate(result)
+ end
+
end
module UniffiCallbackInterfaceHttpClient
diff --git a/libs/fleet/sdk-bindings/ruby/tests/test_builders.rb b/libs/fleet/sdk-bindings/ruby/tests/test_builders.rb
new file mode 100644
index 0000000000..3a93dc1f8b
--- /dev/null
+++ b/libs/fleet/sdk-bindings/ruby/tests/test_builders.rb
@@ -0,0 +1,18 @@
+require 'cyclops_sdk'
+service = FleetSdk::SandboxServiceBuilder.new.name('mcp').target_port(3000).build
+vm = FleetSdk::VmTemplateBuilder.new.container_disk_image('registry.example/vm:latest').image_pull_secret('registry-secret').cpu_cores(4).memory('8Gi').services([service]).build
+template = FleetSdk::OSGymSandboxTemplateSpecBuilder.new.vm_template(vm).build
+request = FleetSdk::CreateTemplateRequestBuilder.new.namespace('default').name('desktop').spec(template).build
+raise 'wrong service type' unless service.instance_of?(FleetSdk::SandboxService)
+raise 'wrong VM type' unless vm.instance_of?(FleetSdk::VmTemplate)
+raise 'wrong request type' unless request.instance_of?(FleetSdk::CreateTemplateRequest)
+raise 'optional protocol was not omitted' unless service.protocol.nil?
+raise 'optional command was not omitted' unless vm.command.nil?
+begin
+ FleetSdk::VmTemplateBuilder.new.build
+ raise 'missing required field did not fail'
+rescue FleetSdk::SchemaBuildError::MissingRequiredField => error
+ raise 'wrong schema error' unless error.record_type == 'VmTemplate' && error.field == 'container_disk_image'
+end
+legacy = FleetSdk::SandboxTemplateRef.new(name: 'legacy')
+raise 'legacy constructor changed' unless legacy.name == 'legacy'
diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift b/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift
index d904a4cfe6..687513ac9e 100644
--- a/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift
+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdk.swift
@@ -770,6 +770,307 @@ public func FfiConverterTypeAccessTokenProvider_lower(_ value: AccessTokenProvid
+public protocol CreatePoolRequestBuilderProtocol: AnyObject, Sendable {
+
+ func build() throws -> CreatePoolRequest
+
+ func namespace(value: String) -> CreatePoolRequestBuilder
+
+ func spec(value: OsGymSandboxWarmPoolSpec) -> CreatePoolRequestBuilder
+
+}
+open class CreatePoolRequestBuilder: CreatePoolRequestBuilderProtocol, @unchecked Sendable {
+ fileprivate let handle: UInt64
+
+ /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public struct NoHandle {
+ public init() {}
+ }
+
+ // TODO: We'd like this to be `private` but for Swifty reasons,
+ // we can't implement `FfiConverter` without making this `required` and we can't
+ // make it `required` without making it `public`.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ required public init(unsafeFromHandle handle: UInt64) {
+ self.handle = handle
+ }
+
+ // This constructor can be used to instantiate a fake object.
+ // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
+ //
+ // - Warning:
+ // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public init(noHandle: NoHandle) {
+ self.handle = 0
+ }
+
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public func uniffiCloneHandle() -> UInt64 {
+ return try! rustCall { uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder(self.handle, $0) }
+ }
+public convenience init() {
+ let handle =
+ try! rustCall() {
+ uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new($0
+ )
+}
+ self.init(unsafeFromHandle: handle)
+}
+
+ deinit {
+ if handle == 0 {
+ // Mock objects have handle=0 don't try to free them
+ return
+ }
+
+ try! rustCall { uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder(handle, $0) }
+ }
+
+
+
+
+open func build()throws -> CreatePoolRequest {
+ return try FfiConverterTypeCreatePoolRequest_lift(try rustCallWithError(FfiConverterTypeSdkBuildError_lift) {
+ uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
+open func namespace(value: String) -> CreatePoolRequestBuilder {
+ return try! FfiConverterTypeCreatePoolRequestBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+open func spec(value: OsGymSandboxWarmPoolSpec) -> CreatePoolRequestBuilder {
+ return try! FfiConverterTypeCreatePoolRequestBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeOSGymSandboxWarmPoolSpec_lower(value),$0
+ )
+})
+}
+
+
+
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeCreatePoolRequestBuilder: FfiConverter {
+ typealias FfiType = UInt64
+ typealias SwiftType = CreatePoolRequestBuilder
+
+ public static func lift(_ handle: UInt64) throws -> CreatePoolRequestBuilder {
+ return CreatePoolRequestBuilder(unsafeFromHandle: handle)
+ }
+
+ public static func lower(_ value: CreatePoolRequestBuilder) -> UInt64 {
+ return value.uniffiCloneHandle()
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreatePoolRequestBuilder {
+ let handle: UInt64 = try readInt(&buf)
+ return try lift(handle)
+ }
+
+ public static func write(_ value: CreatePoolRequestBuilder, into buf: inout [UInt8]) {
+ writeInt(&buf, lower(value))
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeCreatePoolRequestBuilder_lift(_ handle: UInt64) throws -> CreatePoolRequestBuilder {
+ return try FfiConverterTypeCreatePoolRequestBuilder.lift(handle)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeCreatePoolRequestBuilder_lower(_ value: CreatePoolRequestBuilder) -> UInt64 {
+ return FfiConverterTypeCreatePoolRequestBuilder.lower(value)
+}
+
+
+
+
+
+
+public protocol CreateTemplateRequestBuilderProtocol: AnyObject, Sendable {
+
+ func build() throws -> CreateTemplateRequest
+
+ func name(value: String) -> CreateTemplateRequestBuilder
+
+ func namespace(value: String) -> CreateTemplateRequestBuilder
+
+ func spec(value: OsGymSandboxTemplateSpec) -> CreateTemplateRequestBuilder
+
+}
+open class CreateTemplateRequestBuilder: CreateTemplateRequestBuilderProtocol, @unchecked Sendable {
+ fileprivate let handle: UInt64
+
+ /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public struct NoHandle {
+ public init() {}
+ }
+
+ // TODO: We'd like this to be `private` but for Swifty reasons,
+ // we can't implement `FfiConverter` without making this `required` and we can't
+ // make it `required` without making it `public`.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ required public init(unsafeFromHandle handle: UInt64) {
+ self.handle = handle
+ }
+
+ // This constructor can be used to instantiate a fake object.
+ // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
+ //
+ // - Warning:
+ // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public init(noHandle: NoHandle) {
+ self.handle = 0
+ }
+
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public func uniffiCloneHandle() -> UInt64 {
+ return try! rustCall { uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder(self.handle, $0) }
+ }
+public convenience init() {
+ let handle =
+ try! rustCall() {
+ uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new($0
+ )
+}
+ self.init(unsafeFromHandle: handle)
+}
+
+ deinit {
+ if handle == 0 {
+ // Mock objects have handle=0 don't try to free them
+ return
+ }
+
+ try! rustCall { uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder(handle, $0) }
+ }
+
+
+
+
+open func build()throws -> CreateTemplateRequest {
+ return try FfiConverterTypeCreateTemplateRequest_lift(try rustCallWithError(FfiConverterTypeSdkBuildError_lift) {
+ uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
+open func name(value: String) -> CreateTemplateRequestBuilder {
+ return try! FfiConverterTypeCreateTemplateRequestBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+open func namespace(value: String) -> CreateTemplateRequestBuilder {
+ return try! FfiConverterTypeCreateTemplateRequestBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+open func spec(value: OsGymSandboxTemplateSpec) -> CreateTemplateRequestBuilder {
+ return try! FfiConverterTypeCreateTemplateRequestBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeOSGymSandboxTemplateSpec_lower(value),$0
+ )
+})
+}
+
+
+
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeCreateTemplateRequestBuilder: FfiConverter {
+ typealias FfiType = UInt64
+ typealias SwiftType = CreateTemplateRequestBuilder
+
+ public static func lift(_ handle: UInt64) throws -> CreateTemplateRequestBuilder {
+ return CreateTemplateRequestBuilder(unsafeFromHandle: handle)
+ }
+
+ public static func lower(_ value: CreateTemplateRequestBuilder) -> UInt64 {
+ return value.uniffiCloneHandle()
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreateTemplateRequestBuilder {
+ let handle: UInt64 = try readInt(&buf)
+ return try lift(handle)
+ }
+
+ public static func write(_ value: CreateTemplateRequestBuilder, into buf: inout [UInt8]) {
+ writeInt(&buf, lower(value))
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeCreateTemplateRequestBuilder_lift(_ handle: UInt64) throws -> CreateTemplateRequestBuilder {
+ return try FfiConverterTypeCreateTemplateRequestBuilder.lift(handle)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeCreateTemplateRequestBuilder_lower(_ value: CreateTemplateRequestBuilder) -> UInt64 {
+ return FfiConverterTypeCreateTemplateRequestBuilder.lower(value)
+}
+
+
+
+
+
+
public protocol CyclopsClientProtocol: AnyObject, Sendable {
func createClaim(request: CreateClaimRequest) async throws -> Claim
@@ -2937,6 +3238,82 @@ public func FfiConverterTypeHttpError_lower(_ value: HttpError) -> RustBuffer {
}
+public enum SdkBuildError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError {
+
+
+
+ case MissingRequiredField(recordType: String, field: String
+ )
+
+
+
+
+
+
+ public var errorDescription: String? {
+ String(reflecting: self)
+ }
+
+}
+
+#if compiler(>=6)
+extension SdkBuildError: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeSdkBuildError: FfiConverterRustBuffer {
+ typealias SwiftType = SdkBuildError
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SdkBuildError {
+ let variant: Int32 = try readInt(&buf)
+ switch variant {
+
+
+
+
+ case 1: return .MissingRequiredField(
+ recordType: try FfiConverterString.read(from: &buf),
+ field: try FfiConverterString.read(from: &buf)
+ )
+
+ default: throw UniffiInternalError.unexpectedEnumCase
+ }
+ }
+
+ public static func write(_ value: SdkBuildError, into buf: inout [UInt8]) {
+ switch value {
+
+
+
+
+
+ case let .MissingRequiredField(recordType,field):
+ writeInt(&buf, Int32(1))
+ FfiConverterString.write(recordType, into: &buf)
+ FfiConverterString.write(field, into: &buf)
+
+ }
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeSdkBuildError_lift(_ buf: RustBuffer) throws -> SdkBuildError {
+ return try FfiConverterTypeSdkBuildError.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeSdkBuildError_lower(_ value: SdkBuildError) -> RustBuffer {
+ return FfiConverterTypeSdkBuildError.lower(value)
+}
+
+
public enum SdkError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError {
@@ -3681,6 +4058,27 @@ private let initializationResult: InitializationResult = {
if (uniffi_cyclops_sdk_checksum_method_httpclient_execute() != 38803) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_build() != 60558) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_namespace() != 18934) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_spec() != 7566) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_build() != 46749) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_name() != 38970) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_namespace() != 38181) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_spec() != 29902) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect() != 54404) {
return InitializationResult.apiChecksumMismatch
}
@@ -3702,6 +4100,12 @@ private let initializationResult: InitializationResult = {
if (uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_native_http_client() != 49301) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cyclops_sdk_checksum_constructor_createpoolrequestbuilder_new() != 33658) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_checksum_constructor_createtemplaterequestbuilder_new() != 6787) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cyclops_sdk_checksum_constructor_cyclopscredentials_new() != 25746) {
return InitializationResult.apiChecksumMismatch
}
diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h b/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h
index b0eefb21bf..fa97dea28b 100644
--- a/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h
+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdkFFI.h
@@ -473,6 +473,73 @@ void uniffi_cyclops_sdk_fn_init_callback_vtable_httpclient(const UniffiVTableCal
uint64_t uniffi_cyclops_sdk_fn_method_httpclient_execute(uint64_t ptr, RustBuffer request
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_CREATEPOOLREQUESTBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_CREATEPOOLREQUESTBUILDER
+uint64_t uniffi_cyclops_sdk_fn_clone_createpoolrequestbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_FREE_CREATEPOOLREQUESTBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_FREE_CREATEPOOLREQUESTBUILDER
+void uniffi_cyclops_sdk_fn_free_createpoolrequestbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CREATEPOOLREQUESTBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CREATEPOOLREQUESTBUILDER_NEW
+uint64_t uniffi_cyclops_sdk_fn_constructor_createpoolrequestbuilder_new(RustCallStatus *_Nonnull out_status
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATEPOOLREQUESTBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATEPOOLREQUESTBUILDER_BUILD
+RustBuffer uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_build(uint64_t ptr, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATEPOOLREQUESTBUILDER_NAMESPACE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATEPOOLREQUESTBUILDER_NAMESPACE
+uint64_t uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_namespace(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATEPOOLREQUESTBUILDER_SPEC
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATEPOOLREQUESTBUILDER_SPEC
+uint64_t uniffi_cyclops_sdk_fn_method_createpoolrequestbuilder_spec(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_CREATETEMPLATEREQUESTBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_CREATETEMPLATEREQUESTBUILDER
+uint64_t uniffi_cyclops_sdk_fn_clone_createtemplaterequestbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_FREE_CREATETEMPLATEREQUESTBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_FREE_CREATETEMPLATEREQUESTBUILDER
+void uniffi_cyclops_sdk_fn_free_createtemplaterequestbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CREATETEMPLATEREQUESTBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CONSTRUCTOR_CREATETEMPLATEREQUESTBUILDER_NEW
+uint64_t uniffi_cyclops_sdk_fn_constructor_createtemplaterequestbuilder_new(RustCallStatus *_Nonnull out_status
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATETEMPLATEREQUESTBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATETEMPLATEREQUESTBUILDER_BUILD
+RustBuffer uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_build(uint64_t ptr, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATETEMPLATEREQUESTBUILDER_NAME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATETEMPLATEREQUESTBUILDER_NAME
+uint64_t uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_name(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATETEMPLATEREQUESTBUILDER_NAMESPACE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATETEMPLATEREQUESTBUILDER_NAMESPACE
+uint64_t uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_namespace(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATETEMPLATEREQUESTBUILDER_SPEC
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_METHOD_CREATETEMPLATEREQUESTBUILDER_SPEC
+uint64_t uniffi_cyclops_sdk_fn_method_createtemplaterequestbuilder_spec(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_CYCLOPSCREDENTIALS
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_FN_CLONE_CYCLOPSCREDENTIALS
uint64_t uniffi_cyclops_sdk_fn_clone_cyclopscredentials(uint64_t handle, RustCallStatus *_Nonnull out_status
@@ -896,6 +963,48 @@ uint16_t uniffi_cyclops_sdk_checksum_method_accesstokenprovider_get_access_token
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_HTTPCLIENT_EXECUTE
uint16_t uniffi_cyclops_sdk_checksum_method_httpclient_execute(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATEPOOLREQUESTBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATEPOOLREQUESTBUILDER_BUILD
+uint16_t uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_build(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATEPOOLREQUESTBUILDER_NAMESPACE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATEPOOLREQUESTBUILDER_NAMESPACE
+uint16_t uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_namespace(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATEPOOLREQUESTBUILDER_SPEC
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATEPOOLREQUESTBUILDER_SPEC
+uint16_t uniffi_cyclops_sdk_checksum_method_createpoolrequestbuilder_spec(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATETEMPLATEREQUESTBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATETEMPLATEREQUESTBUILDER_BUILD
+uint16_t uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_build(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATETEMPLATEREQUESTBUILDER_NAME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATETEMPLATEREQUESTBUILDER_NAME
+uint16_t uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_name(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATETEMPLATEREQUESTBUILDER_NAMESPACE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATETEMPLATEREQUESTBUILDER_NAMESPACE
+uint16_t uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_namespace(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATETEMPLATEREQUESTBUILDER_SPEC
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_METHOD_CREATETEMPLATEREQUESTBUILDER_SPEC
+uint16_t uniffi_cyclops_sdk_checksum_method_createtemplaterequestbuilder_spec(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT
@@ -938,6 +1047,18 @@ uint16_t uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_acce
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCLIENT_CONNECT_WITH_NATIVE_HTTP_CLIENT
uint16_t uniffi_cyclops_sdk_checksum_constructor_cyclopsclient_connect_with_native_http_client(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CREATEPOOLREQUESTBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CREATEPOOLREQUESTBUILDER_NEW
+uint16_t uniffi_cyclops_sdk_checksum_constructor_createpoolrequestbuilder_new(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CREATETEMPLATEREQUESTBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CREATETEMPLATEREQUESTBUILDER_NEW
+uint16_t uniffi_cyclops_sdk_checksum_constructor_createtemplaterequestbuilder_new(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_CHECKSUM_CONSTRUCTOR_CYCLOPSCREDENTIALS_NEW
diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdkSchema.swift b/libs/fleet/sdk-bindings/swift/CyclopsSdkSchema.swift
index ab5f93a8c6..81ea8233f9 100644
--- a/libs/fleet/sdk-bindings/swift/CyclopsSdkSchema.swift
+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdkSchema.swift
@@ -516,12 +516,744 @@ fileprivate struct FfiConverterString: FfiConverter {
+public protocol OsGymSandboxTemplateSpecBuilderProtocol: AnyObject, Sendable {
+
+ func build() throws -> OsGymSandboxTemplateSpec
+
+ func vmTemplate(value: VmTemplate) -> OsGymSandboxTemplateSpecBuilder
+
+}
+open class OsGymSandboxTemplateSpecBuilder: OsGymSandboxTemplateSpecBuilderProtocol, @unchecked Sendable {
+ fileprivate let handle: UInt64
+
+ /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public struct NoHandle {
+ public init() {}
+ }
+
+ // TODO: We'd like this to be `private` but for Swifty reasons,
+ // we can't implement `FfiConverter` without making this `required` and we can't
+ // make it `required` without making it `public`.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ required public init(unsafeFromHandle handle: UInt64) {
+ self.handle = handle
+ }
+
+ // This constructor can be used to instantiate a fake object.
+ // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
+ //
+ // - Warning:
+ // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public init(noHandle: NoHandle) {
+ self.handle = 0
+ }
+
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public func uniffiCloneHandle() -> UInt64 {
+ return try! rustCall { uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder(self.handle, $0) }
+ }
+public convenience init() {
+ let handle =
+ try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new($0
+ )
+}
+ self.init(unsafeFromHandle: handle)
+}
+
+ deinit {
+ if handle == 0 {
+ // Mock objects have handle=0 don't try to free them
+ return
+ }
+
+ try! rustCall { uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder(handle, $0) }
+ }
+
+
+
+
+open func build()throws -> OsGymSandboxTemplateSpec {
+ return try FfiConverterTypeOSGymSandboxTemplateSpec_lift(try rustCallWithError(FfiConverterTypeSchemaBuildError_lift) {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
+open func vmTemplate(value: VmTemplate) -> OsGymSandboxTemplateSpecBuilder {
+ return try! FfiConverterTypeOSGymSandboxTemplateSpecBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeVmTemplate_lower(value),$0
+ )
+})
+}
+
+
+
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeOSGymSandboxTemplateSpecBuilder: FfiConverter {
+ typealias FfiType = UInt64
+ typealias SwiftType = OsGymSandboxTemplateSpecBuilder
+
+ public static func lift(_ handle: UInt64) throws -> OsGymSandboxTemplateSpecBuilder {
+ return OsGymSandboxTemplateSpecBuilder(unsafeFromHandle: handle)
+ }
+
+ public static func lower(_ value: OsGymSandboxTemplateSpecBuilder) -> UInt64 {
+ return value.uniffiCloneHandle()
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OsGymSandboxTemplateSpecBuilder {
+ let handle: UInt64 = try readInt(&buf)
+ return try lift(handle)
+ }
+
+ public static func write(_ value: OsGymSandboxTemplateSpecBuilder, into buf: inout [UInt8]) {
+ writeInt(&buf, lower(value))
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeOSGymSandboxTemplateSpecBuilder_lift(_ handle: UInt64) throws -> OsGymSandboxTemplateSpecBuilder {
+ return try FfiConverterTypeOSGymSandboxTemplateSpecBuilder.lift(handle)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeOSGymSandboxTemplateSpecBuilder_lower(_ value: OsGymSandboxTemplateSpecBuilder) -> UInt64 {
+ return FfiConverterTypeOSGymSandboxTemplateSpecBuilder.lower(value)
+}
+
+
+
+
+
+
+public protocol OsGymSandboxWarmPoolSpecBuilderProtocol: AnyObject, Sendable {
+
+ func autoscaling(value: WarmPoolAutoscaling) -> OsGymSandboxWarmPoolSpecBuilder
+
+ func build() throws -> OsGymSandboxWarmPoolSpec
+
+ func replicas(value: UInt32) -> OsGymSandboxWarmPoolSpecBuilder
+
+ func sandboxTemplateRef(value: SandboxTemplateRef) -> OsGymSandboxWarmPoolSpecBuilder
+
+}
+open class OsGymSandboxWarmPoolSpecBuilder: OsGymSandboxWarmPoolSpecBuilderProtocol, @unchecked Sendable {
+ fileprivate let handle: UInt64
+
+ /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public struct NoHandle {
+ public init() {}
+ }
+
+ // TODO: We'd like this to be `private` but for Swifty reasons,
+ // we can't implement `FfiConverter` without making this `required` and we can't
+ // make it `required` without making it `public`.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ required public init(unsafeFromHandle handle: UInt64) {
+ self.handle = handle
+ }
+
+ // This constructor can be used to instantiate a fake object.
+ // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
+ //
+ // - Warning:
+ // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public init(noHandle: NoHandle) {
+ self.handle = 0
+ }
+
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public func uniffiCloneHandle() -> UInt64 {
+ return try! rustCall { uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder(self.handle, $0) }
+ }
+public convenience init() {
+ let handle =
+ try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new($0
+ )
+}
+ self.init(unsafeFromHandle: handle)
+}
+
+ deinit {
+ if handle == 0 {
+ // Mock objects have handle=0 don't try to free them
+ return
+ }
+
+ try! rustCall { uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder(handle, $0) }
+ }
+
+
+
+
+open func autoscaling(value: WarmPoolAutoscaling) -> OsGymSandboxWarmPoolSpecBuilder {
+ return try! FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeWarmPoolAutoscaling_lower(value),$0
+ )
+})
+}
+
+open func build()throws -> OsGymSandboxWarmPoolSpec {
+ return try FfiConverterTypeOSGymSandboxWarmPoolSpec_lift(try rustCallWithError(FfiConverterTypeSchemaBuildError_lift) {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
+open func replicas(value: UInt32) -> OsGymSandboxWarmPoolSpecBuilder {
+ return try! FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(
+ self.uniffiCloneHandle(),
+ FfiConverterUInt32.lower(value),$0
+ )
+})
+}
+
+open func sandboxTemplateRef(value: SandboxTemplateRef) -> OsGymSandboxWarmPoolSpecBuilder {
+ return try! FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeSandboxTemplateRef_lower(value),$0
+ )
+})
+}
+
+
+
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder: FfiConverter {
+ typealias FfiType = UInt64
+ typealias SwiftType = OsGymSandboxWarmPoolSpecBuilder
+
+ public static func lift(_ handle: UInt64) throws -> OsGymSandboxWarmPoolSpecBuilder {
+ return OsGymSandboxWarmPoolSpecBuilder(unsafeFromHandle: handle)
+ }
+
+ public static func lower(_ value: OsGymSandboxWarmPoolSpecBuilder) -> UInt64 {
+ return value.uniffiCloneHandle()
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OsGymSandboxWarmPoolSpecBuilder {
+ let handle: UInt64 = try readInt(&buf)
+ return try lift(handle)
+ }
+
+ public static func write(_ value: OsGymSandboxWarmPoolSpecBuilder, into buf: inout [UInt8]) {
+ writeInt(&buf, lower(value))
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lift(_ handle: UInt64) throws -> OsGymSandboxWarmPoolSpecBuilder {
+ return try FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lift(handle)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder_lower(_ value: OsGymSandboxWarmPoolSpecBuilder) -> UInt64 {
+ return FfiConverterTypeOSGymSandboxWarmPoolSpecBuilder.lower(value)
+}
+
+
+
+
+
+
public protocol PreservedJsonProtocol: AnyObject, Sendable {
- func toJson() -> String
+ func toJson() -> String
+
+}
+open class PreservedJson: PreservedJsonProtocol, @unchecked Sendable {
+ fileprivate let handle: UInt64
+
+ /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public struct NoHandle {
+ public init() {}
+ }
+
+ // TODO: We'd like this to be `private` but for Swifty reasons,
+ // we can't implement `FfiConverter` without making this `required` and we can't
+ // make it `required` without making it `public`.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ required public init(unsafeFromHandle handle: UInt64) {
+ self.handle = handle
+ }
+
+ // This constructor can be used to instantiate a fake object.
+ // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
+ //
+ // - Warning:
+ // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public init(noHandle: NoHandle) {
+ self.handle = 0
+ }
+
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public func uniffiCloneHandle() -> UInt64 {
+ return try! rustCall { uniffi_cyclops_sdk_schema_fn_clone_preservedjson(self.handle, $0) }
+ }
+ // No primary constructor declared for this class.
+
+ deinit {
+ if handle == 0 {
+ // Mock objects have handle=0 don't try to free them
+ return
+ }
+
+ try! rustCall { uniffi_cyclops_sdk_schema_fn_free_preservedjson(handle, $0) }
+ }
+
+
+public static func fromJson(value: String)throws -> PreservedJson {
+ return try FfiConverterTypePreservedJson_lift(try rustCallWithError(FfiConverterTypeJsonValueError_lift) {
+ uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+
+
+open func toJson() -> String {
+ return try! FfiConverterString.lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
+
+
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypePreservedJson: FfiConverter {
+ typealias FfiType = UInt64
+ typealias SwiftType = PreservedJson
+
+ public static func lift(_ handle: UInt64) throws -> PreservedJson {
+ return PreservedJson(unsafeFromHandle: handle)
+ }
+
+ public static func lower(_ value: PreservedJson) -> UInt64 {
+ return value.uniffiCloneHandle()
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PreservedJson {
+ let handle: UInt64 = try readInt(&buf)
+ return try lift(handle)
+ }
+
+ public static func write(_ value: PreservedJson, into buf: inout [UInt8]) {
+ writeInt(&buf, lower(value))
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypePreservedJson_lift(_ handle: UInt64) throws -> PreservedJson {
+ return try FfiConverterTypePreservedJson.lift(handle)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypePreservedJson_lower(_ value: PreservedJson) -> UInt64 {
+ return FfiConverterTypePreservedJson.lower(value)
+}
+
+
+
+
+
+
+public protocol SandboxServiceBuilderProtocol: AnyObject, Sendable {
+
+ func build() throws -> SandboxService
+
+ func name(value: String) -> SandboxServiceBuilder
+
+ func `protocol`(value: ServiceProtocol) -> SandboxServiceBuilder
+
+ func targetPort(value: UInt16) -> SandboxServiceBuilder
+
+}
+open class SandboxServiceBuilder: SandboxServiceBuilderProtocol, @unchecked Sendable {
+ fileprivate let handle: UInt64
+
+ /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public struct NoHandle {
+ public init() {}
+ }
+
+ // TODO: We'd like this to be `private` but for Swifty reasons,
+ // we can't implement `FfiConverter` without making this `required` and we can't
+ // make it `required` without making it `public`.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ required public init(unsafeFromHandle handle: UInt64) {
+ self.handle = handle
+ }
+
+ // This constructor can be used to instantiate a fake object.
+ // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
+ //
+ // - Warning:
+ // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public init(noHandle: NoHandle) {
+ self.handle = 0
+ }
+
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public func uniffiCloneHandle() -> UInt64 {
+ return try! rustCall { uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder(self.handle, $0) }
+ }
+public convenience init() {
+ let handle =
+ try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new($0
+ )
+}
+ self.init(unsafeFromHandle: handle)
+}
+
+ deinit {
+ if handle == 0 {
+ // Mock objects have handle=0 don't try to free them
+ return
+ }
+
+ try! rustCall { uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder(handle, $0) }
+ }
+
+
+
+
+open func build()throws -> SandboxService {
+ return try FfiConverterTypeSandboxService_lift(try rustCallWithError(FfiConverterTypeSchemaBuildError_lift) {
+ uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
+open func name(value: String) -> SandboxServiceBuilder {
+ return try! FfiConverterTypeSandboxServiceBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+open func `protocol`(value: ServiceProtocol) -> SandboxServiceBuilder {
+ return try! FfiConverterTypeSandboxServiceBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeServiceProtocol_lower(value),$0
+ )
+})
+}
+
+open func targetPort(value: UInt16) -> SandboxServiceBuilder {
+ return try! FfiConverterTypeSandboxServiceBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port(
+ self.uniffiCloneHandle(),
+ FfiConverterUInt16.lower(value),$0
+ )
+})
+}
+
+
+
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeSandboxServiceBuilder: FfiConverter {
+ typealias FfiType = UInt64
+ typealias SwiftType = SandboxServiceBuilder
+
+ public static func lift(_ handle: UInt64) throws -> SandboxServiceBuilder {
+ return SandboxServiceBuilder(unsafeFromHandle: handle)
+ }
+
+ public static func lower(_ value: SandboxServiceBuilder) -> UInt64 {
+ return value.uniffiCloneHandle()
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SandboxServiceBuilder {
+ let handle: UInt64 = try readInt(&buf)
+ return try lift(handle)
+ }
+
+ public static func write(_ value: SandboxServiceBuilder, into buf: inout [UInt8]) {
+ writeInt(&buf, lower(value))
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeSandboxServiceBuilder_lift(_ handle: UInt64) throws -> SandboxServiceBuilder {
+ return try FfiConverterTypeSandboxServiceBuilder.lift(handle)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeSandboxServiceBuilder_lower(_ value: SandboxServiceBuilder) -> UInt64 {
+ return FfiConverterTypeSandboxServiceBuilder.lower(value)
+}
+
+
+
+
+
+
+public protocol SandboxTemplateRefBuilderProtocol: AnyObject, Sendable {
+
+ func build() throws -> SandboxTemplateRef
+
+ func name(value: String) -> SandboxTemplateRefBuilder
+
+}
+open class SandboxTemplateRefBuilder: SandboxTemplateRefBuilderProtocol, @unchecked Sendable {
+ fileprivate let handle: UInt64
+
+ /// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public struct NoHandle {
+ public init() {}
+ }
+
+ // TODO: We'd like this to be `private` but for Swifty reasons,
+ // we can't implement `FfiConverter` without making this `required` and we can't
+ // make it `required` without making it `public`.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ required public init(unsafeFromHandle handle: UInt64) {
+ self.handle = handle
+ }
+
+ // This constructor can be used to instantiate a fake object.
+ // - Parameter noHandle: Placeholder value so we can have a constructor separate from the default empty one that may be implemented for classes extending [FFIObject].
+ //
+ // - Warning:
+ // Any object instantiated with this constructor cannot be passed to an actual Rust-backed object. Since there isn't a backing handle the FFI lower functions will crash.
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public init(noHandle: NoHandle) {
+ self.handle = 0
+ }
+
+#if swift(>=5.8)
+ @_documentation(visibility: private)
+#endif
+ public func uniffiCloneHandle() -> UInt64 {
+ return try! rustCall { uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder(self.handle, $0) }
+ }
+public convenience init() {
+ let handle =
+ try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new($0
+ )
+}
+ self.init(unsafeFromHandle: handle)
+}
+
+ deinit {
+ if handle == 0 {
+ // Mock objects have handle=0 don't try to free them
+ return
+ }
+
+ try! rustCall { uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder(handle, $0) }
+ }
+
+
+
+
+open func build()throws -> SandboxTemplateRef {
+ return try FfiConverterTypeSandboxTemplateRef_lift(try rustCallWithError(FfiConverterTypeSchemaBuildError_lift) {
+ uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
+open func name(value: String) -> SandboxTemplateRefBuilder {
+ return try! FfiConverterTypeSandboxTemplateRefBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+
+
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeSandboxTemplateRefBuilder: FfiConverter {
+ typealias FfiType = UInt64
+ typealias SwiftType = SandboxTemplateRefBuilder
+
+ public static func lift(_ handle: UInt64) throws -> SandboxTemplateRefBuilder {
+ return SandboxTemplateRefBuilder(unsafeFromHandle: handle)
+ }
+
+ public static func lower(_ value: SandboxTemplateRefBuilder) -> UInt64 {
+ return value.uniffiCloneHandle()
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SandboxTemplateRefBuilder {
+ let handle: UInt64 = try readInt(&buf)
+ return try lift(handle)
+ }
+ public static func write(_ value: SandboxTemplateRefBuilder, into buf: inout [UInt8]) {
+ writeInt(&buf, lower(value))
+ }
}
-open class PreservedJson: PreservedJsonProtocol, @unchecked Sendable {
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeSandboxTemplateRefBuilder_lift(_ handle: UInt64) throws -> SandboxTemplateRefBuilder {
+ return try FfiConverterTypeSandboxTemplateRefBuilder.lift(handle)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeSandboxTemplateRefBuilder_lower(_ value: SandboxTemplateRefBuilder) -> UInt64 {
+ return FfiConverterTypeSandboxTemplateRefBuilder.lower(value)
+}
+
+
+
+
+
+
+public protocol VmTemplateBuilderProtocol: AnyObject, Sendable {
+
+ func build() throws -> VmTemplate
+
+ func command(value: [String]) -> VmTemplateBuilder
+
+ func containerDiskImage(value: String) -> VmTemplateBuilder
+
+ func cpuCores(value: UInt32) -> VmTemplateBuilder
+
+ func firmware(value: Firmware) -> VmTemplateBuilder
+
+ func imagePullPolicy(value: ImagePullPolicy) -> VmTemplateBuilder
+
+ func imagePullSecret(value: String) -> VmTemplateBuilder
+
+ func memory(value: String) -> VmTemplateBuilder
+
+ func nodeSelector(value: [String: String]) -> VmTemplateBuilder
+
+ func oidc(value: OidcConfig) -> VmTemplateBuilder
+
+ func probes(value: PreservedJson) -> VmTemplateBuilder
+
+ func runtime(value: RuntimeKind) -> VmTemplateBuilder
+
+ func runtimeClassName(value: String) -> VmTemplateBuilder
+
+ func services(value: [SandboxService]) -> VmTemplateBuilder
+
+ func tolerations(value: [PreservedJson]) -> VmTemplateBuilder
+
+}
+open class VmTemplateBuilder: VmTemplateBuilderProtocol, @unchecked Sendable {
fileprivate let handle: UInt64
/// Used to instantiate a [FFIObject] without an actual handle, for fakes in tests, mostly.
@@ -558,9 +1290,16 @@ open class PreservedJson: PreservedJsonProtocol, @unchecked Sendable {
@_documentation(visibility: private)
#endif
public func uniffiCloneHandle() -> UInt64 {
- return try! rustCall { uniffi_cyclops_sdk_schema_fn_clone_preservedjson(self.handle, $0) }
+ return try! rustCall { uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder(self.handle, $0) }
}
- // No primary constructor declared for this class.
+public convenience init() {
+ let handle =
+ try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new($0
+ )
+}
+ self.init(unsafeFromHandle: handle)
+}
deinit {
if handle == 0 {
@@ -568,24 +1307,142 @@ open class PreservedJson: PreservedJsonProtocol, @unchecked Sendable {
return
}
- try! rustCall { uniffi_cyclops_sdk_schema_fn_free_preservedjson(handle, $0) }
+ try! rustCall { uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder(handle, $0) }
}
-public static func fromJson(value: String)throws -> PreservedJson {
- return try FfiConverterTypePreservedJson_lift(try rustCallWithError(FfiConverterTypeJsonValueError_lift) {
- uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(
+
+
+open func build()throws -> VmTemplate {
+ return try FfiConverterTypeVmTemplate_lift(try rustCallWithError(FfiConverterTypeSchemaBuildError_lift) {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build(
+ self.uniffiCloneHandle(),$0
+ )
+})
+}
+
+open func command(value: [String]) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command(
+ self.uniffiCloneHandle(),
+ FfiConverterSequenceString.lower(value),$0
+ )
+})
+}
+
+open func containerDiskImage(value: String) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image(
+ self.uniffiCloneHandle(),
FfiConverterString.lower(value),$0
)
})
}
+open func cpuCores(value: UInt32) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores(
+ self.uniffiCloneHandle(),
+ FfiConverterUInt32.lower(value),$0
+ )
+})
+}
+open func firmware(value: Firmware) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeFirmware_lower(value),$0
+ )
+})
+}
-open func toJson() -> String {
- return try! FfiConverterString.lift(try! rustCall() {
- uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(
- self.uniffiCloneHandle(),$0
+open func imagePullPolicy(value: ImagePullPolicy) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeImagePullPolicy_lower(value),$0
+ )
+})
+}
+
+open func imagePullSecret(value: String) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+open func memory(value: String) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+open func nodeSelector(value: [String: String]) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector(
+ self.uniffiCloneHandle(),
+ FfiConverterDictionaryStringString.lower(value),$0
+ )
+})
+}
+
+open func oidc(value: OidcConfig) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeOidcConfig_lower(value),$0
+ )
+})
+}
+
+open func probes(value: PreservedJson) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes(
+ self.uniffiCloneHandle(),
+ FfiConverterTypePreservedJson_lower(value),$0
+ )
+})
+}
+
+open func runtime(value: RuntimeKind) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime(
+ self.uniffiCloneHandle(),
+ FfiConverterTypeRuntimeKind_lower(value),$0
+ )
+})
+}
+
+open func runtimeClassName(value: String) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name(
+ self.uniffiCloneHandle(),
+ FfiConverterString.lower(value),$0
+ )
+})
+}
+
+open func services(value: [SandboxService]) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services(
+ self.uniffiCloneHandle(),
+ FfiConverterSequenceTypeSandboxService.lower(value),$0
+ )
+})
+}
+
+open func tolerations(value: [PreservedJson]) -> VmTemplateBuilder {
+ return try! FfiConverterTypeVmTemplateBuilder_lift(try! rustCall() {
+ uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations(
+ self.uniffiCloneHandle(),
+ FfiConverterSequenceTypePreservedJson.lower(value),$0
)
})
}
@@ -598,24 +1455,24 @@ open func toJson() -> String {
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
-public struct FfiConverterTypePreservedJson: FfiConverter {
+public struct FfiConverterTypeVmTemplateBuilder: FfiConverter {
typealias FfiType = UInt64
- typealias SwiftType = PreservedJson
+ typealias SwiftType = VmTemplateBuilder
- public static func lift(_ handle: UInt64) throws -> PreservedJson {
- return PreservedJson(unsafeFromHandle: handle)
+ public static func lift(_ handle: UInt64) throws -> VmTemplateBuilder {
+ return VmTemplateBuilder(unsafeFromHandle: handle)
}
- public static func lower(_ value: PreservedJson) -> UInt64 {
+ public static func lower(_ value: VmTemplateBuilder) -> UInt64 {
return value.uniffiCloneHandle()
}
- public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PreservedJson {
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> VmTemplateBuilder {
let handle: UInt64 = try readInt(&buf)
return try lift(handle)
}
- public static func write(_ value: PreservedJson, into buf: inout [UInt8]) {
+ public static func write(_ value: VmTemplateBuilder, into buf: inout [UInt8]) {
writeInt(&buf, lower(value))
}
}
@@ -624,15 +1481,15 @@ public struct FfiConverterTypePreservedJson: FfiConverter {
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
-public func FfiConverterTypePreservedJson_lift(_ handle: UInt64) throws -> PreservedJson {
- return try FfiConverterTypePreservedJson.lift(handle)
+public func FfiConverterTypeVmTemplateBuilder_lift(_ handle: UInt64) throws -> VmTemplateBuilder {
+ return try FfiConverterTypeVmTemplateBuilder.lift(handle)
}
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
-public func FfiConverterTypePreservedJson_lower(_ value: PreservedJson) -> UInt64 {
- return FfiConverterTypePreservedJson.lower(value)
+public func FfiConverterTypeVmTemplateBuilder_lower(_ value: VmTemplateBuilder) -> UInt64 {
+ return FfiConverterTypeVmTemplateBuilder.lower(value)
}
@@ -1852,6 +2709,82 @@ public func FfiConverterTypeRuntimeKind_lower(_ value: RuntimeKind) -> RustBuffe
}
+
+public enum SchemaBuildError: Swift.Error, Equatable, Hashable, Foundation.LocalizedError {
+
+
+
+ case MissingRequiredField(recordType: String, field: String
+ )
+
+
+
+
+
+
+ public var errorDescription: String? {
+ String(reflecting: self)
+ }
+
+}
+
+#if compiler(>=6)
+extension SchemaBuildError: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeSchemaBuildError: FfiConverterRustBuffer {
+ typealias SwiftType = SchemaBuildError
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SchemaBuildError {
+ let variant: Int32 = try readInt(&buf)
+ switch variant {
+
+
+
+
+ case 1: return .MissingRequiredField(
+ recordType: try FfiConverterString.read(from: &buf),
+ field: try FfiConverterString.read(from: &buf)
+ )
+
+ default: throw UniffiInternalError.unexpectedEnumCase
+ }
+ }
+
+ public static func write(_ value: SchemaBuildError, into buf: inout [UInt8]) {
+ switch value {
+
+
+
+
+
+ case let .MissingRequiredField(recordType,field):
+ writeInt(&buf, Int32(1))
+ FfiConverterString.write(recordType, into: &buf)
+ FfiConverterString.write(field, into: &buf)
+
+ }
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeSchemaBuildError_lift(_ buf: RustBuffer) throws -> SchemaBuildError {
+ return try FfiConverterTypeSchemaBuildError.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeSchemaBuildError_lower(_ value: SchemaBuildError) -> RustBuffer {
+ return FfiConverterTypeSchemaBuildError.lower(value)
+}
+
// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
@@ -2468,12 +3401,108 @@ private let initializationResult: InitializationResult = {
if bindings_contract_version != scaffolding_contract_version {
return InitializationResult.contractVersionMismatch
}
+ if (uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_build() != 62919) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_name() != 62417) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_protocol() != 10309) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_target_port() != 61462) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_build() != 46569) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_name() != 1803) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_build() != 17867) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_command() != 20371) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_container_disk_image() != 49021) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_cpu_cores() != 25645) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_firmware() != 33926) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_policy() != 41828) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_secret() != 40154) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_memory() != 55615) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_node_selector() != 45280) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_oidc() != 27280) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_probes() != 40623) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime() != 63375) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime_class_name() != 25466) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_services() != 14113) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_tolerations() != 1632) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json() != 8252) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_build() != 53928) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template() != 6610) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling() != 44912) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build() != 5682) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas() != 50438) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref() != 7198) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_constructor_sandboxservicebuilder_new() != 21082) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_constructor_sandboxtemplaterefbuilder_new() != 4748) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_constructor_vmtemplatebuilder_new() != 27302) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json() != 24064) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxtemplatespecbuilder_new() != 22071) {
+ return InitializationResult.apiChecksumMismatch
+ }
+ if (uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new() != 26063) {
+ return InitializationResult.apiChecksumMismatch
+ }
return InitializationResult.ok
}()
diff --git a/libs/fleet/sdk-bindings/swift/CyclopsSdkSchemaFFI.h b/libs/fleet/sdk-bindings/swift/CyclopsSdkSchemaFFI.h
index bd17120c9a..e8fbe1ba45 100644
--- a/libs/fleet/sdk-bindings/swift/CyclopsSdkSchemaFFI.h
+++ b/libs/fleet/sdk-bindings/swift/CyclopsSdkSchemaFFI.h
@@ -242,6 +242,159 @@ typedef struct UniffiForeignFutureResultVoid {
typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureResultVoid
);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_SANDBOXSERVICEBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_SANDBOXSERVICEBUILDER
+uint64_t uniffi_cyclops_sdk_schema_fn_clone_sandboxservicebuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_SANDBOXSERVICEBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_SANDBOXSERVICEBUILDER
+void uniffi_cyclops_sdk_schema_fn_free_sandboxservicebuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_SANDBOXSERVICEBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_SANDBOXSERVICEBUILDER_NEW
+uint64_t uniffi_cyclops_sdk_schema_fn_constructor_sandboxservicebuilder_new(RustCallStatus *_Nonnull out_status
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXSERVICEBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXSERVICEBUILDER_BUILD
+RustBuffer uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_build(uint64_t ptr, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXSERVICEBUILDER_NAME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXSERVICEBUILDER_NAME
+uint64_t uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_name(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXSERVICEBUILDER_PROTOCOL
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXSERVICEBUILDER_PROTOCOL
+uint64_t uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_protocol(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXSERVICEBUILDER_TARGET_PORT
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXSERVICEBUILDER_TARGET_PORT
+uint64_t uniffi_cyclops_sdk_schema_fn_method_sandboxservicebuilder_target_port(uint64_t ptr, uint16_t value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_SANDBOXTEMPLATEREFBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_SANDBOXTEMPLATEREFBUILDER
+uint64_t uniffi_cyclops_sdk_schema_fn_clone_sandboxtemplaterefbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_SANDBOXTEMPLATEREFBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_SANDBOXTEMPLATEREFBUILDER
+void uniffi_cyclops_sdk_schema_fn_free_sandboxtemplaterefbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_SANDBOXTEMPLATEREFBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_SANDBOXTEMPLATEREFBUILDER_NEW
+uint64_t uniffi_cyclops_sdk_schema_fn_constructor_sandboxtemplaterefbuilder_new(RustCallStatus *_Nonnull out_status
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXTEMPLATEREFBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXTEMPLATEREFBUILDER_BUILD
+RustBuffer uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_build(uint64_t ptr, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXTEMPLATEREFBUILDER_NAME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_SANDBOXTEMPLATEREFBUILDER_NAME
+uint64_t uniffi_cyclops_sdk_schema_fn_method_sandboxtemplaterefbuilder_name(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_VMTEMPLATEBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_VMTEMPLATEBUILDER
+uint64_t uniffi_cyclops_sdk_schema_fn_clone_vmtemplatebuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_VMTEMPLATEBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_VMTEMPLATEBUILDER
+void uniffi_cyclops_sdk_schema_fn_free_vmtemplatebuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_VMTEMPLATEBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_VMTEMPLATEBUILDER_NEW
+uint64_t uniffi_cyclops_sdk_schema_fn_constructor_vmtemplatebuilder_new(RustCallStatus *_Nonnull out_status
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_BUILD
+RustBuffer uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_build(uint64_t ptr, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_COMMAND
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_COMMAND
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_command(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_CONTAINER_DISK_IMAGE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_CONTAINER_DISK_IMAGE
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_container_disk_image(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_CPU_CORES
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_CPU_CORES
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_cpu_cores(uint64_t ptr, uint32_t value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_FIRMWARE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_FIRMWARE
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_firmware(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_IMAGE_PULL_POLICY
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_IMAGE_PULL_POLICY
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_policy(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_IMAGE_PULL_SECRET
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_IMAGE_PULL_SECRET
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_image_pull_secret(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_MEMORY
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_MEMORY
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_memory(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_NODE_SELECTOR
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_NODE_SELECTOR
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_node_selector(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_OIDC
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_OIDC
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_oidc(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_PROBES
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_PROBES
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_probes(uint64_t ptr, uint64_t value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_RUNTIME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_RUNTIME
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_RUNTIME_CLASS_NAME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_RUNTIME_CLASS_NAME
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_runtime_class_name(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_SERVICES
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_SERVICES
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_services(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_TOLERATIONS
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_VMTEMPLATEBUILDER_TOLERATIONS
+uint64_t uniffi_cyclops_sdk_schema_fn_method_vmtemplatebuilder_tolerations(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_PRESERVEDJSON
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_PRESERVEDJSON
@@ -263,6 +416,68 @@ uint64_t uniffi_cyclops_sdk_schema_fn_constructor_preservedjson_from_json(RustBu
RustBuffer uniffi_cyclops_sdk_schema_fn_method_preservedjson_to_json(uint64_t ptr, RustCallStatus *_Nonnull out_status
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_OSGYMSANDBOXTEMPLATESPECBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_OSGYMSANDBOXTEMPLATESPECBUILDER
+uint64_t uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxtemplatespecbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_OSGYMSANDBOXTEMPLATESPECBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_OSGYMSANDBOXTEMPLATESPECBUILDER
+void uniffi_cyclops_sdk_schema_fn_free_osgymsandboxtemplatespecbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_OSGYMSANDBOXTEMPLATESPECBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_OSGYMSANDBOXTEMPLATESPECBUILDER_NEW
+uint64_t uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxtemplatespecbuilder_new(RustCallStatus *_Nonnull out_status
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXTEMPLATESPECBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXTEMPLATESPECBUILDER_BUILD
+RustBuffer uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_build(uint64_t ptr, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXTEMPLATESPECBUILDER_VM_TEMPLATE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXTEMPLATESPECBUILDER_VM_TEMPLATE
+uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxtemplatespecbuilder_vm_template(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_OSGYMSANDBOXWARMPOOLSPECBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CLONE_OSGYMSANDBOXWARMPOOLSPECBUILDER
+uint64_t uniffi_cyclops_sdk_schema_fn_clone_osgymsandboxwarmpoolspecbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_OSGYMSANDBOXWARMPOOLSPECBUILDER
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_FREE_OSGYMSANDBOXWARMPOOLSPECBUILDER
+void uniffi_cyclops_sdk_schema_fn_free_osgymsandboxwarmpoolspecbuilder(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_OSGYMSANDBOXWARMPOOLSPECBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_CONSTRUCTOR_OSGYMSANDBOXWARMPOOLSPECBUILDER_NEW
+uint64_t uniffi_cyclops_sdk_schema_fn_constructor_osgymsandboxwarmpoolspecbuilder_new(RustCallStatus *_Nonnull out_status
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_AUTOSCALING
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_AUTOSCALING
+uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_autoscaling(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_BUILD
+RustBuffer uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_build(uint64_t ptr, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
+uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_replicas(uint64_t ptr, uint32_t value, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_SANDBOX_TEMPLATE_REF
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_FN_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_SANDBOX_TEMPLATE_REF
+uint64_t uniffi_cyclops_sdk_schema_fn_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(uint64_t ptr, RustBuffer value, RustCallStatus *_Nonnull out_status
+);
+#endif
#ifndef UNIFFI_FFIDEF_FFI_CYCLOPS_SDK_SCHEMA_RUSTBUFFER_ALLOC
#define UNIFFI_FFIDEF_FFI_CYCLOPS_SDK_SCHEMA_RUSTBUFFER_ALLOC
RustBuffer ffi_cyclops_sdk_schema_rustbuffer_alloc(uint64_t size, RustCallStatus *_Nonnull out_status
@@ -521,18 +736,210 @@ void ffi_cyclops_sdk_schema_rust_future_free_void(uint64_t handle
#ifndef UNIFFI_FFIDEF_FFI_CYCLOPS_SDK_SCHEMA_RUST_FUTURE_COMPLETE_VOID
#define UNIFFI_FFIDEF_FFI_CYCLOPS_SDK_SCHEMA_RUST_FUTURE_COMPLETE_VOID
void ffi_cyclops_sdk_schema_rust_future_complete_void(uint64_t handle, RustCallStatus *_Nonnull out_status
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXSERVICEBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXSERVICEBUILDER_BUILD
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_build(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXSERVICEBUILDER_NAME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXSERVICEBUILDER_NAME
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_name(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXSERVICEBUILDER_PROTOCOL
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXSERVICEBUILDER_PROTOCOL
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_protocol(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXSERVICEBUILDER_TARGET_PORT
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXSERVICEBUILDER_TARGET_PORT
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_sandboxservicebuilder_target_port(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXTEMPLATEREFBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXTEMPLATEREFBUILDER_BUILD
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_build(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXTEMPLATEREFBUILDER_NAME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_SANDBOXTEMPLATEREFBUILDER_NAME
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_sandboxtemplaterefbuilder_name(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_BUILD
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_build(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_COMMAND
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_COMMAND
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_command(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_CONTAINER_DISK_IMAGE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_CONTAINER_DISK_IMAGE
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_container_disk_image(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_CPU_CORES
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_CPU_CORES
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_cpu_cores(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_FIRMWARE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_FIRMWARE
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_firmware(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_IMAGE_PULL_POLICY
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_IMAGE_PULL_POLICY
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_policy(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_IMAGE_PULL_SECRET
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_IMAGE_PULL_SECRET
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_image_pull_secret(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_MEMORY
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_MEMORY
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_memory(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_NODE_SELECTOR
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_NODE_SELECTOR
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_node_selector(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_OIDC
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_OIDC
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_oidc(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_PROBES
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_PROBES
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_probes(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_RUNTIME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_RUNTIME
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_RUNTIME_CLASS_NAME
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_RUNTIME_CLASS_NAME
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_runtime_class_name(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_SERVICES
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_SERVICES
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_services(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_TOLERATIONS
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_VMTEMPLATEBUILDER_TOLERATIONS
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_vmtemplatebuilder_tolerations(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_PRESERVEDJSON_TO_JSON
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_PRESERVEDJSON_TO_JSON
uint16_t uniffi_cyclops_sdk_schema_checksum_method_preservedjson_to_json(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXTEMPLATESPECBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXTEMPLATESPECBUILDER_BUILD
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_build(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXTEMPLATESPECBUILDER_VM_TEMPLATE
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXTEMPLATESPECBUILDER_VM_TEMPLATE
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxtemplatespecbuilder_vm_template(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_AUTOSCALING
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_AUTOSCALING
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_autoscaling(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_BUILD
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_BUILD
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_build(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_REPLICAS
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_replicas(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_SANDBOX_TEMPLATE_REF
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_METHOD_OSGYMSANDBOXWARMPOOLSPECBUILDER_SANDBOX_TEMPLATE_REF
+uint16_t uniffi_cyclops_sdk_schema_checksum_method_osgymsandboxwarmpoolspecbuilder_sandbox_template_ref(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_SANDBOXSERVICEBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_SANDBOXSERVICEBUILDER_NEW
+uint16_t uniffi_cyclops_sdk_schema_checksum_constructor_sandboxservicebuilder_new(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_SANDBOXTEMPLATEREFBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_SANDBOXTEMPLATEREFBUILDER_NEW
+uint16_t uniffi_cyclops_sdk_schema_checksum_constructor_sandboxtemplaterefbuilder_new(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_VMTEMPLATEBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_VMTEMPLATEBUILDER_NEW
+uint16_t uniffi_cyclops_sdk_schema_checksum_constructor_vmtemplatebuilder_new(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_PRESERVEDJSON_FROM_JSON
#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_PRESERVEDJSON_FROM_JSON
uint16_t uniffi_cyclops_sdk_schema_checksum_constructor_preservedjson_from_json(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_OSGYMSANDBOXTEMPLATESPECBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_OSGYMSANDBOXTEMPLATESPECBUILDER_NEW
+uint16_t uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxtemplatespecbuilder_new(void
+
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_OSGYMSANDBOXWARMPOOLSPECBUILDER_NEW
+#define UNIFFI_FFIDEF_UNIFFI_CYCLOPS_SDK_SCHEMA_CHECKSUM_CONSTRUCTOR_OSGYMSANDBOXWARMPOOLSPECBUILDER_NEW
+uint16_t uniffi_cyclops_sdk_schema_checksum_constructor_osgymsandboxwarmpoolspecbuilder_new(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_FFI_CYCLOPS_SDK_SCHEMA_UNIFFI_CONTRACT_VERSION
diff --git a/libs/fleet/sdk-bindings/swift/tests/TestBuilders.swift b/libs/fleet/sdk-bindings/swift/tests/TestBuilders.swift
new file mode 100644
index 0000000000..9508c3395f
--- /dev/null
+++ b/libs/fleet/sdk-bindings/swift/tests/TestBuilders.swift
@@ -0,0 +1,40 @@
+import Foundation
+
+@main struct TestBuilders {
+ static func main() throws {
+ let service: SandboxService = try SandboxServiceBuilder()
+ .name(value: "mcp")
+ .targetPort(value: 3000)
+ .build()
+ let vm: VmTemplate = try VmTemplateBuilder()
+ .containerDiskImage(value: "registry.example/vm:latest")
+ .imagePullSecret(value: "registry-secret")
+ .cpuCores(value: 4)
+ .memory(value: "8Gi")
+ .services(value: [service])
+ .build()
+ let template: OsGymSandboxTemplateSpec = try OsGymSandboxTemplateSpecBuilder()
+ .vmTemplate(value: vm)
+ .build()
+ let request: CreateTemplateRequest = try CreateTemplateRequestBuilder()
+ .namespace(value: "default")
+ .name(value: "desktop")
+ .spec(value: template)
+ .build()
+
+ precondition(service.protocol == nil)
+ precondition(vm.command == nil)
+ precondition(request.spec.vmTemplate.containerDiskImage == "registry.example/vm:latest")
+
+ do {
+ _ = try VmTemplateBuilder().build()
+ fatalError("missing required field did not fail")
+ } catch SchemaBuildError.MissingRequiredField(let recordType, let field) {
+ precondition(recordType == "VmTemplate")
+ precondition(field == "container_disk_image")
+ }
+
+ let legacy = SandboxTemplateRef(name: "legacy")
+ precondition(legacy.name == "legacy")
+ }
+}
diff --git a/libs/fleet/sdk-bindings/ts-uniffi/README.md b/libs/fleet/sdk-bindings/ts-uniffi/README.md
index c448d7256e..c17c522f8c 100644
--- a/libs/fleet/sdk-bindings/ts-uniffi/README.md
+++ b/libs/fleet/sdk-bindings/ts-uniffi/README.md
@@ -1,6 +1,15 @@
# Cyclops TypeScript UniFFI bindings
-Generated with `uniffi-bindgen-react-native` for Node.js N-API. Runtime
-requires `@ubjs/core`, `@ubjs/node`, and a colocated `libcyclops_sdk` cdylib.
-Browser source is generated in `../ts-uniffi-browser`; packaging its WASM crate
-requires a project `ubrn.config.yaml` and a wasm build pipeline.
+Generated with `uniffi-bindgen-react-native` for Node.js N-API. The checked-in
+Node.js and browser/WASM snapshots are outside
+`scripts/generate-sdk-bindings.sh`; they currently expose direct record
+factories, not the newer `UniffiBuilder` objects present in Rust metadata.
+Browser packaging runs UBRN generation at build time, but the resulting builder
+surface is not committed, drift-checked, or contract-tested. Regenerating where
+applicable and validating these separate runtime and packaging pipelines is
+required before builders can be advertised for either TypeScript target.
+
+Runtime requires `@ubjs/core`, `@ubjs/node`, and a colocated
+`libcyclops_sdk` cdylib. Browser source is generated in
+`../ts-uniffi-browser`; packaging its WASM crate requires a project
+`ubrn.config.yaml` and a wasm build pipeline.
diff --git a/libs/fleet/sdk-schema/Cargo.toml b/libs/fleet/sdk-schema/Cargo.toml
index d46b3e0a29..cfe73164cd 100644
--- a/libs/fleet/sdk-schema/Cargo.toml
+++ b/libs/fleet/sdk-schema/Cargo.toml
@@ -22,6 +22,7 @@ serde_json.workspace = true
serde_yaml.workspace = true
thiserror.workspace = true
uniffi.workspace = true
+uniffi-builder-derive = { path = "../uniffi-builder-derive" }
[dev-dependencies]
tempfile = "3"
diff --git a/libs/fleet/sdk-schema/src/common.rs b/libs/fleet/sdk-schema/src/common.rs
index 2aee8e75ba..96b7727e1a 100644
--- a/libs/fleet/sdk-schema/src/common.rs
+++ b/libs/fleet/sdk-schema/src/common.rs
@@ -111,7 +111,17 @@ pub enum ServiceProtocol {
UDP,
}
-#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, uniffi::Record)]
+#[derive(
+ Clone,
+ Debug,
+ PartialEq,
+ Serialize,
+ Deserialize,
+ JsonSchema,
+ uniffi::Record,
+ uniffi_builder_derive::UniffiBuilder,
+)]
+#[uniffi_builder(crate::SchemaBuildError)]
#[serde(rename_all = "camelCase")]
pub struct SandboxService {
#[schemars(description = "Service name suffix (sandbox name is prepended).")]
@@ -162,7 +172,17 @@ pub struct OidcConfig {
pub refresh_interval_seconds: Option<u32>,
}
-#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, uniffi::Record)]
+#[derive(
+ Clone,
+ Debug,
+ PartialEq,
+ Serialize,
+ Deserialize,
+ JsonSchema,
+ uniffi::Record,
+ uniffi_builder_derive::UniffiBuilder,
+)]
+#[uniffi_builder(crate::SchemaBuildError)]
#[serde(rename_all = "camelCase")]
pub struct VmTemplate {
#[schemars(
@@ -255,7 +275,17 @@ pub(crate) fn date_time_schema(_: &mut schemars::SchemaGenerator) -> schemars::S
schemars::json_schema!({"type": "string", "format": "date-time"})
}
-#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema, uniffi::Record)]
+#[derive(
+ Clone,
+ Debug,
+ PartialEq,
+ Serialize,
+ Deserialize,
+ JsonSchema,
+ uniffi::Record,
+ uniffi_builder_derive::UniffiBuilder,
+)]
+#[uniffi_builder(crate::SchemaBuildError)]
pub struct SandboxTemplateRef {
pub name: String,
}
diff --git a/libs/fleet/sdk-schema/src/lib.rs b/libs/fleet/sdk-schema/src/lib.rs
index 7755665fcd..369abfd912 100644
--- a/libs/fleet/sdk-schema/src/lib.rs
+++ b/libs/fleet/sdk-schema/src/lib.rs
@@ -9,17 +9,34 @@ pub use claim::{
ClaimLifecycle, ClaimSpec, OSGymSandboxClaim, OSGymSandboxClaimCondition,
OSGymSandboxClaimSandbox, OSGymSandboxClaimStatus,
};
-pub use common::SandboxTemplateRef;
pub use common::{
- Firmware, ImagePullPolicy, OidcConfig, RuntimeKind, SandboxService, ServiceProtocol, VmTemplate,
+ Firmware, ImagePullPolicy, OidcConfig, RuntimeKind, SandboxService, SandboxServiceBuilder,
+ ServiceProtocol, VmTemplate, VmTemplateBuilder,
};
+pub use common::{SandboxTemplateRef, SandboxTemplateRefBuilder};
pub use json::{JsonValueError, PreservedJson};
pub use sandbox::{
OSGymSandbox, OSGymSandboxSpec, OSGymSandboxStatus, OSGymSandboxTemplate,
- OSGymSandboxTemplateSpec,
+ OSGymSandboxTemplateSpec, OSGymSandboxTemplateSpecBuilder,
};
pub use warmpool::{
- OSGymSandboxWarmPool, OSGymSandboxWarmPoolSpec, OSGymSandboxWarmPoolStatus, WarmPoolAutoscaling,
+ OSGymSandboxWarmPool, OSGymSandboxWarmPoolSpec, OSGymSandboxWarmPoolSpecBuilder,
+ OSGymSandboxWarmPoolStatus, WarmPoolAutoscaling,
};
uniffi::setup_scaffolding!("cyclops_sdk_schema");
+
+#[derive(Debug, thiserror::Error, uniffi::Error)]
+pub enum SchemaBuildError {
+ #[error("{record_type} is missing required field {field}")]
+ MissingRequiredField { record_type: String, field: String },
+}
+
+impl SchemaBuildError {
+ pub fn missing(record_type: &str, field: &str) -> Self {
+ Self::MissingRequiredField {
+ record_type: record_type.into(),
+ field: field.into(),
+ }
+ }
+}
diff --git a/libs/fleet/sdk-schema/src/sandbox.rs b/libs/fleet/sdk-schema/src/sandbox.rs
index 0ea65f8118..6408b44871 100644
--- a/libs/fleet/sdk-schema/src/sandbox.rs
+++ b/libs/fleet/sdk-schema/src/sandbox.rs
@@ -80,7 +80,17 @@ pub struct OSGymSandboxStatus {
pub reset_vmi_uid: Option<String>,
}
-#[derive(CustomResource, Clone, Debug, Deserialize, Serialize, JsonSchema, uniffi::Record)]
+#[derive(
+ CustomResource,
+ Clone,
+ Debug,
+ Deserialize,
+ Serialize,
+ JsonSchema,
+ uniffi::Record,
+ uniffi_builder_derive::UniffiBuilder,
+)]
+#[uniffi_builder(crate::SchemaBuildError)]
#[kube(
group = "osgym.cua.ai",
version = "v1alpha1",
diff --git a/libs/fleet/sdk-schema/src/warmpool.rs b/libs/fleet/sdk-schema/src/warmpool.rs
index e86bd9e78f..ea53e7118f 100644
--- a/libs/fleet/sdk-schema/src/warmpool.rs
+++ b/libs/fleet/sdk-schema/src/warmpool.rs
@@ -57,7 +57,17 @@ pub struct WarmPoolAutoscaling {
}
#[allow(clippy::duplicated_attributes)]
-#[derive(CustomResource, Clone, Debug, Deserialize, Serialize, JsonSchema, uniffi::Record)]
+#[derive(
+ CustomResource,
+ Clone,
+ Debug,
+ Deserialize,
+ Serialize,
+ JsonSchema,
+ uniffi::Record,
+ uniffi_builder_derive::UniffiBuilder,
+)]
+#[uniffi_builder(crate::SchemaBuildError)]
#[kube(
group = "osgym.cua.ai",
version = "v1alpha1",
diff --git a/libs/fleet/sdk-schema/tests/uniffi_builder.rs b/libs/fleet/sdk-schema/tests/uniffi_builder.rs
new file mode 100644
index 0000000000..064e1108be
--- /dev/null
+++ b/libs/fleet/sdk-schema/tests/uniffi_builder.rs
@@ -0,0 +1,82 @@
+use cyclops_sdk_schema::{
+ OSGymSandboxTemplateSpec, OSGymSandboxTemplateSpecBuilder, OSGymSandboxWarmPoolSpec,
+ OSGymSandboxWarmPoolSpecBuilder, SandboxService, SandboxServiceBuilder, SandboxTemplateRef,
+ SandboxTemplateRefBuilder, SchemaBuildError, VmTemplate, VmTemplateBuilder,
+};
+
+#[test]
+fn builders_cover_schema_records_and_optional_omission() {
+ let service: SandboxService = SandboxServiceBuilder::new()
+ .name("mcp".into())
+ .target_port(3000)
+ .build()
+ .unwrap();
+ let vm: VmTemplate = VmTemplateBuilder::new()
+ .container_disk_image("image".into())
+ .image_pull_secret("secret".into())
+ .cpu_cores(4)
+ .memory("8Gi".into())
+ .services(vec![service.clone()])
+ .build()
+ .unwrap();
+ let template: OSGymSandboxTemplateSpec = OSGymSandboxTemplateSpecBuilder::new()
+ .vm_template(vm.clone())
+ .build()
+ .unwrap();
+ let reference: SandboxTemplateRef = SandboxTemplateRefBuilder::new()
+ .name("template".into())
+ .build()
+ .unwrap();
+ let pool: OSGymSandboxWarmPoolSpec = OSGymSandboxWarmPoolSpecBuilder::new()
+ .replicas(1)
+ .sandbox_template_ref(reference)
+ .build()
+ .unwrap();
+
+ assert_eq!(service.protocol, None);
+ assert_eq!(vm.command, None);
+ assert_eq!(vm.image_pull_secret.as_deref(), Some("secret"));
+ assert_eq!(vm.cpu_cores, Some(4));
+ assert_eq!(vm.memory.as_deref(), Some("8Gi"));
+ assert_eq!(template.vm_template.container_disk_image, "image");
+ assert_eq!(pool.autoscaling, None);
+}
+
+#[test]
+fn required_fields_use_stable_error() {
+ let error = VmTemplateBuilder::new().build().unwrap_err();
+ assert_eq!(
+ error.to_string(),
+ "VmTemplate is missing required field container_disk_image"
+ );
+ assert!(matches!(
+ error,
+ SchemaBuildError::MissingRequiredField { record_type, field }
+ if record_type == "VmTemplate" && field == "container_disk_image"
+ ));
+}
+
+#[test]
+fn generated_builders_are_send_and_sync() {
+ fn assert_send_sync<T: Send + Sync>() {}
+
+ assert_send_sync::<VmTemplateBuilder>();
+ assert_send_sync::<OSGymSandboxTemplateSpecBuilder>();
+}
+
+#[test]
+fn builder_setters_preserve_prior_versions() {
+ let base = VmTemplateBuilder::new();
+ let first = base.container_disk_image("registry.example/first:latest".to_owned());
+ let second = base.container_disk_image("registry.example/second:latest".to_owned());
+
+ assert!(base.build().is_err());
+ assert_eq!(
+ first.build().unwrap().container_disk_image,
+ "registry.example/first:latest"
+ );
+ assert_eq!(
+ second.build().unwrap().container_disk_image,
+ "registry.example/second:latest"
+ );
+}
diff --git a/libs/fleet/sdk/Cargo.toml b/libs/fleet/sdk/Cargo.toml
index bace32dab1..d114382999 100644
--- a/libs/fleet/sdk/Cargo.toml
+++ b/libs/fleet/sdk/Cargo.toml
@@ -22,6 +22,7 @@ serde_json.workspace = true
thiserror.workspace = true
tokio = { workspace = true, features = ["sync"] }
uniffi.workspace = true
+uniffi-builder-derive = { path = "../uniffi-builder-derive" }
url.workspace = true
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
diff --git a/libs/fleet/sdk/src/error.rs b/libs/fleet/sdk/src/error.rs
index 3e7754a0b2..e645174435 100644
--- a/libs/fleet/sdk/src/error.rs
+++ b/libs/fleet/sdk/src/error.rs
@@ -71,3 +71,18 @@ pub fn bounded_body(body: &[u8]) -> String {
}
rendered[..end].into()
}
+
+#[derive(Debug, Error, uniffi::Error)]
+pub enum SdkBuildError {
+ #[error("{record_type} is missing required field {field}")]
+ MissingRequiredField { record_type: String, field: String },
+}
+
+impl SdkBuildError {
+ pub fn missing(record_type: &str, field: &str) -> Self {
+ Self::MissingRequiredField {
+ record_type: record_type.into(),
+ field: field.into(),
+ }
+ }
+}
diff --git a/libs/fleet/sdk/src/lib.rs b/libs/fleet/sdk/src/lib.rs
index 52df2ec75b..db9e31172f 100644
--- a/libs/fleet/sdk/src/lib.rs
+++ b/libs/fleet/sdk/src/lib.rs
@@ -12,15 +12,16 @@ mod user_keys;
pub use client::CyclopsClient;
pub use error::{
- AccessTokenProviderError, HttpError, MAX_STATUS_BODY_BYTES, SdkError, bounded_body,
+ AccessTokenProviderError, HttpError, MAX_STATUS_BODY_BYTES, SdkBuildError, SdkError,
+ bounded_body,
};
pub use routes::validate_dns_label;
pub use transport::{AccessTokenProvider, HttpClient};
pub use types::{
- Claim, CreateClaimRequest, CreatePoolRequest, CreateTemplateRequest, CreateUserApiKeyRequest,
- CyclopsConfiguration, CyclopsCredentials, CyclopsTokenProviderConfiguration, HttpHeader,
- HttpRequest, HttpResponse, Namespace, NewUserApiKey, Pool, ResourceMetadata, Sandbox, Template,
- UserApiKey,
+ Claim, CreateClaimRequest, CreatePoolRequest, CreatePoolRequestBuilder, CreateTemplateRequest,
+ CreateTemplateRequestBuilder, CreateUserApiKeyRequest, CyclopsConfiguration,
+ CyclopsCredentials, CyclopsTokenProviderConfiguration, HttpHeader, HttpRequest, HttpResponse,
+ Namespace, NewUserApiKey, Pool, ResourceMetadata, Sandbox, Template, UserApiKey,
};
uniffi::setup_scaffolding!("fleet_sdk");
diff --git a/libs/fleet/sdk/src/types.rs b/libs/fleet/sdk/src/types.rs
index 3ecd684cd8..2bf33f55b0 100644
--- a/libs/fleet/sdk/src/types.rs
+++ b/libs/fleet/sdk/src/types.rs
@@ -191,7 +191,10 @@ pub struct Sandbox {
pub services: Vec<String>,
}
-#[derive(Clone, Debug, Serialize, Deserialize, uniffi::Record)]
+#[derive(
+ Clone, Debug, Serialize, Deserialize, uniffi::Record, uniffi_builder_derive::UniffiBuilder,
+)]
+#[uniffi_builder(crate::SdkBuildError)]
pub struct CreatePoolRequest {
pub namespace: String,
pub spec: OSGymSandboxWarmPoolSpec,
@@ -223,7 +226,10 @@ impl PartialEq for Template {
}
}
-#[derive(Clone, Debug, Serialize, Deserialize, uniffi::Record)]
+#[derive(
+ Clone, Debug, Serialize, Deserialize, uniffi::Record, uniffi_builder_derive::UniffiBuilder,
+)]
+#[uniffi_builder(crate::SdkBuildError)]
pub struct CreateTemplateRequest {
pub namespace: String,
pub name: String,
diff --git a/libs/fleet/sdk/tests/uniffi_builder.rs b/libs/fleet/sdk/tests/uniffi_builder.rs
new file mode 100644
index 0000000000..9f3144ed35
--- /dev/null
+++ b/libs/fleet/sdk/tests/uniffi_builder.rs
@@ -0,0 +1,59 @@
+use cyclops_sdk::{
+ CreatePoolRequest, CreatePoolRequestBuilder, CreateTemplateRequest,
+ CreateTemplateRequestBuilder, SdkBuildError,
+};
+use cyclops_sdk_schema::{
+ OSGymSandboxTemplateSpecBuilder, OSGymSandboxWarmPoolSpecBuilder, SandboxTemplateRefBuilder,
+ VmTemplateBuilder,
+};
+
+#[test]
+fn builders_cover_request_records() {
+ let template_spec = OSGymSandboxTemplateSpecBuilder::new()
+ .vm_template(
+ VmTemplateBuilder::new()
+ .container_disk_image("image".into())
+ .build()
+ .unwrap(),
+ )
+ .build()
+ .unwrap();
+ let template_request: CreateTemplateRequest = CreateTemplateRequestBuilder::new()
+ .namespace("default".into())
+ .name("template".into())
+ .spec(template_spec)
+ .build()
+ .unwrap();
+ let pool_spec = OSGymSandboxWarmPoolSpecBuilder::new()
+ .replicas(1)
+ .sandbox_template_ref(
+ SandboxTemplateRefBuilder::new()
+ .name("template".into())
+ .build()
+ .unwrap(),
+ )
+ .build()
+ .unwrap();
+ let pool_request: CreatePoolRequest = CreatePoolRequestBuilder::new()
+ .namespace("default".into())
+ .spec(pool_spec)
+ .build()
+ .unwrap();
+
+ assert_eq!(template_request.namespace, "default");
+ assert_eq!(pool_request.namespace, "default");
+}
+
+#[test]
+fn request_required_fields_use_stable_error() {
+ let error = CreatePoolRequestBuilder::new().build().unwrap_err();
+ assert_eq!(
+ error.to_string(),
+ "CreatePoolRequest is missing required field namespace"
+ );
+ assert!(matches!(
+ error,
+ SdkBuildError::MissingRequiredField { record_type, field }
+ if record_type == "CreatePoolRequest" && field == "namespace"
+ ));
+}
diff --git a/libs/fleet/uniffi-builder-derive/Cargo.toml b/libs/fleet/uniffi-builder-derive/Cargo.toml
new file mode 100644
index 0000000000..73298282d3
--- /dev/null
+++ b/libs/fleet/uniffi-builder-derive/Cargo.toml
@@ -0,0 +1,14 @@
+[package]
+name = "uniffi-builder-derive"
+version = "0.1.0"
+edition.workspace = true
+license.workspace = true
+rust-version.workspace = true
+
+[lib]
+proc-macro = true
+
+[dependencies]
+proc-macro2 = "1"
+quote = "1"
+syn = { version = "2", features = ["full"] }
diff --git a/libs/fleet/uniffi-builder-derive/src/lib.rs b/libs/fleet/uniffi-builder-derive/src/lib.rs
new file mode 100644
index 0000000000..936432d2c6
--- /dev/null
+++ b/libs/fleet/uniffi-builder-derive/src/lib.rs
@@ -0,0 +1,231 @@
+use proc_macro::TokenStream;
+use quote::{format_ident, quote};
+use syn::{Data, DeriveInput, Fields, GenericArgument, PathArguments, Type, parse_macro_input};
+
+#[proc_macro_derive(UniffiBuilder, attributes(uniffi_builder))]
+pub fn derive_uniffi_builder(input: TokenStream) -> TokenStream {
+ expand(parse_macro_input!(input as DeriveInput))
+ .unwrap_or_else(syn::Error::into_compile_error)
+ .into()
+}
+
+fn expand(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream> {
+ if !input.generics.params.is_empty() {
+ return Err(syn::Error::new_spanned(
+ &input.generics,
+ "UniffiBuilder does not support generic records",
+ ));
+ }
+ let record = input.ident;
+ let builder = format_ident!("{record}Builder");
+ let error = input
+ .attrs
+ .iter()
+ .find(|attribute| attribute.path().is_ident("uniffi_builder"))
+ .ok_or_else(|| syn::Error::new_spanned(&record, "missing #[uniffi_builder(ErrorType)]"))?
+ .parse_args::<syn::Path>()?;
+ let fields = match input.data {
+ Data::Struct(data) => match data.fields {
+ Fields::Named(fields) => fields.named,
+ fields => {
+ return Err(syn::Error::new_spanned(
+ fields,
+ "UniffiBuilder requires named fields",
+ ));
+ }
+ },
+ _ => {
+ return Err(syn::Error::new_spanned(
+ &record,
+ "UniffiBuilder requires a struct",
+ ));
+ }
+ };
+
+ let mut state_fields = Vec::new();
+ let mut initializers = Vec::new();
+ let mut setters = Vec::new();
+ let mut builds = Vec::new();
+ for field in fields {
+ let name = field.ident.expect("named field");
+ if name == "new" || name == "build" {
+ return Err(syn::Error::new_spanned(
+ name,
+ "UniffiBuilder fields cannot be named `new` or `build`",
+ ));
+ }
+ let ty = field.ty;
+ let optional = option_inner(&ty)?;
+ let setter_ty = optional.unwrap_or(&ty).clone();
+ state_fields.push(quote! { #name: ::std::option::Option<#setter_ty> });
+ initializers.push(quote! { #name: ::std::option::Option::None });
+ setters.push((name.clone(), setter_ty));
+ if optional.is_some() {
+ builds.push(quote! { #name: self.#name.clone() });
+ } else {
+ builds.push(quote! {
+ #name: self.#name.clone().ok_or_else(|| #error::missing(
+ stringify!(#record), stringify!(#name),
+ ))?
+ });
+ }
+ }
+
+ let field_names = setters.iter().map(|(name, _)| name).collect::<Vec<_>>();
+ let setter_methods = setters.iter().map(|(setter_name, setter_ty)| {
+ let assignments = field_names.iter().map(|field_name| {
+ if *field_name == setter_name {
+ quote! { #field_name: ::std::option::Option::Some(value) }
+ } else {
+ quote! { #field_name: self.#field_name.clone() }
+ }
+ });
+ quote! {
+ pub fn #setter_name(&self, value: #setter_ty) -> ::std::sync::Arc<Self> {
+ ::std::sync::Arc::new(Self { #(#assignments,)* })
+ }
+ }
+ });
+
+ Ok(quote! {
+ #[derive(uniffi::Object)]
+ pub struct #builder { #(#state_fields,)* }
+
+ #[uniffi::export]
+ impl #builder {
+ #[uniffi::constructor]
+ pub fn new() -> ::std::sync::Arc<Self> {
+ ::std::sync::Arc::new(Self { #(#initializers,)* })
+ }
+
+ #(#setter_methods)*
+
+ pub fn build(&self) -> ::std::result::Result<#record, #error> {
+ ::std::result::Result::Ok(#record { #(#builds,)* })
+ }
+ }
+ })
+}
+
+fn option_inner(ty: &Type) -> syn::Result<Option<&Type>> {
+ let Type::Path(path) = ty else {
+ return Ok(None);
+ };
+ let segments = path.path.segments.iter().collect::<Vec<_>>();
+ let Some(segment) = segments.last() else {
+ return Ok(None);
+ };
+ if segment.ident != "Option" {
+ return Ok(None);
+ }
+ if path.qself.is_some() {
+ return Err(syn::Error::new_spanned(
+ ty,
+ "UniffiBuilder optional fields must use Option<T>, std::option::Option<T>, or core::option::Option<T>",
+ ));
+ }
+ let supported_path = matches!(segments.as_slice(), [option] if option.ident == "Option")
+ || matches!(segments.as_slice(), [root, module, option]
+ if (root.ident == "std" || root.ident == "core")
+ && module.ident == "option"
+ && option.ident == "Option");
+ if !supported_path {
+ return Err(syn::Error::new_spanned(
+ ty,
+ "UniffiBuilder optional fields must use Option<T>, std::option::Option<T>, or core::option::Option<T>",
+ ));
+ }
+ let PathArguments::AngleBracketed(arguments) = &segment.arguments else {
+ return Ok(None);
+ };
+ match arguments.args.iter().collect::<Vec<_>>().as_slice() {
+ [GenericArgument::Type(inner)] => Ok(Some(inner)),
+ _ => Ok(None),
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::expand;
+ use syn::{DeriveInput, parse_quote};
+
+ #[test]
+ fn rejects_generic_records() {
+ let input: DeriveInput = parse_quote! {
+ #[uniffi_builder(crate::BuildError)]
+ struct Generic<T> { value: T }
+ };
+ assert_eq!(
+ expand(input).unwrap_err().to_string(),
+ "UniffiBuilder does not support generic records"
+ );
+ }
+
+ #[test]
+ fn rejects_reserved_field_names() {
+ let input: DeriveInput = parse_quote! {
+ #[uniffi_builder(crate::BuildError)]
+ struct Reserved { build: String }
+ };
+ assert_eq!(
+ expand(input).unwrap_err().to_string(),
+ "UniffiBuilder fields cannot be named `new` or `build`"
+ );
+ }
+
+ #[test]
+ fn rejects_unnamed_fields() {
+ let input: DeriveInput = parse_quote! {
+ #[uniffi_builder(crate::BuildError)]
+ struct Tuple(String);
+ };
+ assert_eq!(
+ expand(input).unwrap_err().to_string(),
+ "UniffiBuilder requires named fields"
+ );
+ }
+
+ #[test]
+ fn accepts_supported_option_paths() {
+ for input in [
+ parse_quote! {
+ #[uniffi_builder(crate::BuildError)]
+ struct Short { value: Option<String> }
+ },
+ parse_quote! {
+ #[uniffi_builder(crate::BuildError)]
+ struct Std { value: std::option::Option<String> }
+ },
+ parse_quote! {
+ #[uniffi_builder(crate::BuildError)]
+ struct Core { value: core::option::Option<String> }
+ },
+ ] {
+ expand(input).unwrap();
+ }
+ }
+
+ #[test]
+ fn rejects_ambiguous_option_paths() {
+ let input: DeriveInput = parse_quote! {
+ #[uniffi_builder(crate::BuildError)]
+ struct Ambiguous { value: custom::Option<String> }
+ };
+ assert_eq!(
+ expand(input).unwrap_err().to_string(),
+ "UniffiBuilder optional fields must use Option<T>, std::option::Option<T>, or core::option::Option<T>"
+ );
+ }
+
+ #[test]
+ fn rejects_qualified_self_option_paths() {
+ let input: DeriveInput = parse_quote! {
+ #[uniffi_builder(crate::BuildError)]
+ struct Qualified { value: <Custom as Trait>::Option<String> }
+ };
+ assert_eq!(
+ expand(input).unwrap_err().to_string(),
+ "UniffiBuilder optional fields must use Option<T>, std::option::Option<T>, or core::option::Option<T>"
+ );
+ }
+}